Merge pull request 'Removed ownership for ftpdata folder' (#1406) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 26s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 26s
Reviewed-on: #1406
This commit was merged in pull request #1406.
This commit is contained in:
@@ -263,7 +263,6 @@ class ProcessSftpFiles extends Command
|
||||
$allFiles = [];
|
||||
$logMessages = [];
|
||||
|
||||
// Check whether data2 exists
|
||||
if (!File::isDirectory($basePath)) {
|
||||
$this->error("Directory not found: {$basePath}");
|
||||
return;
|
||||
@@ -279,14 +278,12 @@ class ProcessSftpFiles extends Command
|
||||
|
||||
File::makeDirectory($folderPath, 0755, true);
|
||||
|
||||
// Set ownership
|
||||
exec("chown www-data:www-data " . escapeshellarg($folderPath));
|
||||
// exec("chown www-data:www-data " . escapeshellarg($folderPath));
|
||||
|
||||
$this->info("Created missing folder: {$folderName}");
|
||||
}
|
||||
}
|
||||
|
||||
// Get plant folders: 1000, 1010, etc.
|
||||
$folders = File::directories($basePath);
|
||||
|
||||
if (empty($folders)) {
|
||||
@@ -294,14 +291,12 @@ class ProcessSftpFiles extends Command
|
||||
return;
|
||||
}
|
||||
|
||||
// Collect TXT files from each plant folder
|
||||
foreach ($folders as $folderPath) {
|
||||
|
||||
$folderName = basename($folderPath);
|
||||
|
||||
Log::info("Checking plant folder: {$folderName}");
|
||||
|
||||
// Get files inside the plant folder
|
||||
$files = File::files($folderPath);
|
||||
|
||||
foreach ($files as $file) {
|
||||
@@ -324,7 +319,6 @@ class ProcessSftpFiles extends Command
|
||||
|
||||
$dbColumns = Schema::getColumnListing('production_temps');
|
||||
|
||||
// Process each TXT file
|
||||
foreach ($allFiles as $fileDetails) {
|
||||
|
||||
$file = $fileDetails['path'];
|
||||
@@ -332,7 +326,6 @@ class ProcessSftpFiles extends Command
|
||||
|
||||
$this->info("Processing file: {$file}");
|
||||
|
||||
// Find plant using folder name
|
||||
$plant = Plant::where('code', $folderName)->first();
|
||||
|
||||
if (!$plant) {
|
||||
|
||||
Reference in New Issue
Block a user