<?php class MapFolder { public $sDir = '', public function __construct( $sDir ) { $this->sDir = $sDir; } public function Map() { $this->aMap = $this->GetChild( $this->sDir ); foreach( $this->aMap as $mElement => $mValue ) { $this->aMap[$mElement] = $this->GetChild( './'.$mElement ); } } } public function GetMap() { return $this->aMap; } private function GetChild( $sDir ) { $oIterator = new IteratorIterator( new DirectoryIterator( $sDir ) ); foreach( $oIterator as $sElement ) { if( $sElement->isDir() && !$sElement->isDot() ) { } else { $aDir[] = $sElement->getFileName(); } } return $aDir; } } ?>
Wszelkie uwagi i sugestie mile widziane.
Pozdrawiam