Skip to content

Commit

Permalink
codestyle: improve isInWokringFolder
Browse files Browse the repository at this point in the history
  • Loading branch information
YakovL committed Dec 19, 2023
1 parent 27b3003 commit 5e73c77
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,13 +748,14 @@ function isTwLike($file_full_path_and_name) { // doesn't allow PureStore for now
return false;
return true;
}
function isInWokringFolder($file_name_in_current_workingFolder) { // file or folder
function isInWokringFolder($file_or_folder_name) {

$workingFolder = Options::getWorkingFolder();
if(!is_dir($workingFolder)) // workingFolder may be unavailable
return false;
$filesAndFolders = scandir($workingFolder); // files' and folders' names in current directory
return in_array($file_name_in_current_workingFolder, $filesAndFolders);
// workingFolder may be unavailable
if(!is_dir($workingFolder)) return false;

$filesAndFoldersNames = scandir($workingFolder);
return in_array($file_or_folder_name, $filesAndFoldersNames);
}
function isTwLikeInCurrentWorkingFolder($file_name) {

Expand Down

0 comments on commit 5e73c77

Please sign in to comment.