32 if ( !empty( $sDir ) )
34 $this->_sBaseDirectory = $sDir;
57 if ( empty( $sFile ) ) {
58 throw new Exception(
'Parameter $sFile is empty!' );
61 if ( empty( $this->_sBaseDirectory ) ) {
62 throw new Exception(
'Base directory is not set, please use setter setBaseDirectory!' );
65 if ( is_file( $this->_sBaseDirectory . $sFile ) ) {
67 $this->_aFiles[] = $sFile;
86 if ( empty( $sFolder ) ) {
87 throw new Exception(
'Parameter $sFolder is empty!' );
90 if ( empty( $this->_sBaseDirectory ) ) {
91 throw new Exception(
'Base directory is not set, please use setter setBaseDirectory!' );
94 $aCurrentList = array();
96 if (!is_dir( $this->_sBaseDirectory . $sFolder ) ) {
100 $handle = opendir( $this->_sBaseDirectory . $sFolder );
102 while ( $sFile = readdir( $handle ) ){
104 if ( $sFile !=
"." && $sFile !=
"..") {
105 if ( is_dir( $this->_sBaseDirectory . $sFolder . $sFile ) ) {
106 if ( $blRecursive ) {
107 $aResultList = $this->
addDirectoryFiles( $sFolder . $sFile .
'/', $aExtensions, $blRecursive );
109 if ( is_array( $aResultList ) ) {
110 $aCurrentList = array_merge( $aCurrentList, $aResultList );
116 $sExt = substr( strrchr( $sFile,
'.'), 1 );
118 if ( ( !empty( $aExtensions ) && is_array( $aExtensions ) && in_array( $sExt, $aExtensions ) ) ||
119 ( empty( $aExtensions ) ) ) {
121 $this->
addFile( $sFolder . $sFile );