Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
introduce an "util" function to hide file or folder for Win OS
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanomani committed Nov 29, 2014
1 parent 100a472 commit 3478554
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions core/src/core/classes/class.AJXP_Utils.php
Expand Up @@ -1941,4 +1941,14 @@ public static function regexpToLdap($regexp)
}
return $left.$regexp.$right;
}
/**
* Hide file or folder for Windows OS
* @static
* @param $path
* @return void
*/
public static function winSetHidden($file)
{
@shell_exec("attrib +H " . escapeshellarg($file));
}
}
2 changes: 1 addition & 1 deletion core/src/plugins/access.fs/class.fsAccessDriver.php
Expand Up @@ -71,7 +71,7 @@ public function initRepository()
if (!is_dir($path."/".$recycle)) {
throw new AJXP_Exception("Cannot create recycle bin folder. Please check repository configuration or that your folder is writeable!");
} elseif (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
@shell_exec('attrib +H ' . escapeshellarg($path . "/" . $recycle));
AJXP_Utils::winSetHidden($path."/".$recycle);
}
}
$dataTemplate = $this->repository->getOption("DATA_TEMPLATE");
Expand Down

0 comments on commit 3478554

Please sign in to comment.