34 $this->_sBaseDirectory = $sDir;
59 throw new Exception(
'Parameter $sFile is empty!');
62 if (empty($this->_sBaseDirectory)) {
63 throw new Exception(
'Base directory is not set, please use setter setBaseDirectory!');
66 if (is_file($this->_sBaseDirectory . $sFile)) {
68 $this->_aFiles[] = $sFile;
89 if (empty($sFolder)) {
90 throw new Exception(
'Parameter $sFolder is empty!');
93 if (empty($this->_sBaseDirectory)) {
94 throw new Exception(
'Base directory is not set, please use setter setBaseDirectory!');
97 $aCurrentList = array();
99 if (!is_dir($this->_sBaseDirectory . $sFolder)) {
103 $handle = opendir($this->_sBaseDirectory . $sFolder);
105 while ($sFile = readdir($handle)) {
107 if ($sFile !=
"." && $sFile !=
"..") {
108 if (is_dir($this->_sBaseDirectory . $sFolder . $sFile)) {
110 $aResultList = $this->
addDirectoryFiles($sFolder . $sFile .
'/', $aExtensions, $blRecursive);
112 if (is_array($aResultList)) {
113 $aCurrentList = array_merge($aCurrentList, $aResultList);
117 $sExt = substr(strrchr($sFile,
'.'), 1);
119 if ((!empty($aExtensions) && is_array($aExtensions) && in_array($sExt, $aExtensions)) ||
120 (empty($aExtensions))
123 $this->
addFile($sFolder . $sFile);