Skip to content
Snippets Groups Projects
Commit 65288bcf authored by Frédéric Carretero's avatar Frédéric Carretero
Browse files

getDirectoryFiles() -> Retourne la liste de tous les fichiers d'un répertoire.

parent 8919664d
Branches
Tags
No related merge requests found
......@@ -1534,4 +1534,21 @@ function uploadFileToLocal($sNomObjet, $sFileType, $sServerPath, $sMaxSize) {
return $sErrorMsg;
}
/**
* Get all the files of a directory
* @param string $sDirectoryPath
* \return array
*/
function getDirectoryFiles($sDirectoryPath) {
$aFiles = array();
if (file_exists($sDirectoryPath) && is_dir($sDirectoryPath)) {
$oIterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($sDirectoryPath));
foreach ($oIterator as $oFileinfo) {
if (!$oFileinfo->isDir())
$aFiles[] = $oFileinfo->getPathname();
}
}
return $aFiles;
}
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment