function parcourirDossierCopie($pPath, $pDest)
 {
     $d = dir($pPath);
     while (false !== ($entry = $d->read())) {
         if ($entry != '.' && $entry != '..' && $entry != '.svn' && $entry != '.project' && $entry != 'conf') {
             if (is_dir($d->path . '/' . $entry)) {
                 if (!is_dir($pDest . '/' . $entry)) {
                     mkdir($pDest . '/' . $entry);
                 }
                 if ($entry != "ancien" && $entry != "archive" && $entry != "deploiement" && $entry != "logs" && $entry != "nouveau") {
                     parcourirDossierCopie($d->path . '/' . $entry, $pDest . '/' . $entry);
                 }
             } else {
                 copy($d->path . '/' . $entry, $pDest . '/' . $entry);
             }
         }
     }
     $d->close();
 }
Ejemplo n.º 2
0
                function parcourirDossierCopieMaintenance($pPath, $pDest, $lVersionTechnique)
                {
                    $d = dir($pPath);
                    while (false !== ($entry = $d->read())) {
                        if ($entry != '.' && $entry != '..' && $entry != '.svn' && $entry != '.project' && $entry != 'DB.php' && $entry != 'LogLevel.php' && $entry != 'Mail.php' && $entry != 'Maintenance.php' && $entry != 'Proprietaire.php' && $entry != 'SOAP.php' && $entry != 'Titre.php') {
                            if (is_dir($d->path . '/' . $entry)) {
                                if (!is_dir($pDest . '/' . $entry)) {
                                    mkdir($pDest . '/' . $entry);
                                }
                                parcourirDossierCopie($d->path . '/' . $entry, $pDest . '/' . $entry, $lVersionTechnique);
                            } else {
                                if ($entry == 'Version.php') {
                                    $filename = $d->path . '/' . $entry;
                                    $lLigne = file_get_contents($filename);
                                    $lLigne = str_replace('?>', 'define("ZEYBUX_VERSION_TECHNIQUE","' . $lVersionTechnique . '");
?>', $lLigne);
                                    $fp = fopen($pDest . '/' . $entry, 'w');
                                    fwrite($fp, $lLigne);
                                    fclose($fp);
                                } else {
                                    copy($d->path . '/' . $entry, $pDest . '/' . $entry);
                                }
                            }
                        }
                    }
                    $d->close();
                }