Subject: | Changed the parseDirectory function... |
Summary: | Package rating comment |
Messages: | 1 |
Author: | Felix Mrdx |
Date: | 2017-02-01 21:03:15 |
|
|
|
Felix Mrdx rated this package as follows:
Utility: | Sufficient |
Consistency: | Sufficient |
Examples: | Sufficient |
|
Felix Mrdx - 2017-02-01 21:03:15
Changed the parseDirectory function to :
function parseDirectory($rootPath, $returnOnlyFiles = true, $seperator = "/"){
$fileArray = array();
if (($handle = opendir($rootPath)) !== false) {
while( ($file = readdir($handle)) !== false) {
if($file != '.' && $file != '..' && stristr($file, "pdf")){
if (is_dir($rootPath.$seperator.$file)){
$array = $this->parseDirectory($rootPath.$seperator.$file);
$fileArray = array_merge($array, $fileArray);
if($returnOnlyFiles !== true){
$fileArray[] = $rootPath.$seperator.$file;
}
}
else {
if($returnOnlyFiles != true){
$fileArray[] = $rootPath.$seperator.$file;
}
else{
$fileArray[] = $file;
}
}
}
}
}
return $fileArray;
}
|