public function copyFromTo($sFrom, $sTo) { if (preg_match('/test/', $sFrom) or preg_match('/script/', $sFrom)) { return; } if (is_dir($sFrom)) { $oDir = new _dir($sFrom); try { mkdir($sTo); } catch (Exception $e) { throw new Exception('Erreur creation repertoire ' . $sTo . ' Verifier les droits du repertoire ' . $this->sGenere . ' du mkf4builder On doit pouvoir ecrire dedans (generation de projet) '); } chmod($sTo, 0777); foreach ($oDir->getList() as $oFile) { if (preg_match('/example/', $oFile->getAdresse())) { continue; } self::copyFromTo($oFile->getAdresse(), $sTo . '/' . $oFile->getName()); } } else { copy($sFrom, $sTo); chmod($sTo, 0666); } }
public function copyFromTo($sFrom, $sTo) { if (is_dir($sFrom)) { $oDir = new _dir($sFrom); mkdir($sTo); chmod($sTo, 0777); foreach ($oDir->getList() as $oFile) { self::copyFromTo($oFile->getAdresse(), $sTo . '/' . $oFile->getName()); } } else { copy($sFrom, $sTo); chmod($sTo, 0777); } }
public function getListTable() { $oDir = new _dir($this->_tConfig[$this->_sConfig . '.database']); $tDir = $oDir->getList(); $tSDir = array(); foreach ($tDir as $oDir) { $tSDir[] = preg_replace('/\\.csv/', '', $oDir->getName()); } return $tSDir; }
<?php $sPath = _root::getParam('path', '..'); $oDir = new _dir($sPath); $tDir = $oDir->getList(); $sParent = '..'; if (preg_match('/\\//', $sPath)) { $tParent = explode('/', $sPath); array_pop($tParent); $sParent = implode('/', $tParent); } $tReturn = $this->tReturn; if (isset($tReturn['error'])) { ?> <p class="error" style="padding:8px;border:1px dotted red;margin:8px;"><strong>ERROR:</strong> <?php echo $tReturn['error']; ?> </p> <?php } ?> Vous allez exporter votre projet vers le répertoire ci-dessous: <h2><?php echo $sPath; ?> </h2> <div class="smenu"> <ul> <h3>Sélectionnez le répertoire où copier le projet:</h3> <li><a href="<?php