Update readFiles method in SapFileController to change directory path and improve debug information
This commit is contained in:
@@ -30,7 +30,7 @@ class SapFileController extends Controller
|
|||||||
public function readFiles()
|
public function readFiles()
|
||||||
{
|
{
|
||||||
|
|
||||||
$path = "/var/www/";
|
$path = "/LaserPRD";
|
||||||
|
|
||||||
$isDir = is_dir($path);
|
$isDir = is_dir($path);
|
||||||
$isReadable = is_readable($path);
|
$isReadable = is_readable($path);
|
||||||
@@ -43,7 +43,6 @@ class SapFileController extends Controller
|
|||||||
'path_checked' => $path,
|
'path_checked' => $path,
|
||||||
'is_dir' => $isDir,
|
'is_dir' => $isDir,
|
||||||
'is_readable' => $isReadable,
|
'is_readable' => $isReadable,
|
||||||
'php_user' => exec('whoami'),
|
|
||||||
]
|
]
|
||||||
], 500);
|
], 500);
|
||||||
}
|
}
|
||||||
@@ -64,15 +63,15 @@ class SapFileController extends Controller
|
|||||||
&& pathinfo($file, PATHINFO_EXTENSION) === 'txt';
|
&& pathinfo($file, PATHINFO_EXTENSION) === 'txt';
|
||||||
});
|
});
|
||||||
|
|
||||||
if (empty($files)) {
|
if (empty($files)) {
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'status' => 'error',
|
'status' => 'error',
|
||||||
'message' => 'No text files found',
|
'message' => 'No text files found',
|
||||||
'debug' => [
|
'debug' => [
|
||||||
'scanned_files' => $allFiles
|
'scanned_files' => $allFiles
|
||||||
]
|
]
|
||||||
], 404);
|
], 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user