<?
require_once 'application/controllers/autoload.php';

// require_once 'application/controllers/connect_wsdl.inc.php';
// include_once 'application/controllers/bib_oxalys.inc.php';
function ScanRepertoire(& $file, $path, $autre)
{
    global $scan_rep;
    if ($handle = opendir($path . $autre)) {
        // Lecture du dossier
        while (false !== ($fileo = readdir($handle))) {
            if (filetype($path . $autre . "/" . $fileo) == "dir") {
                if ($fileo != ".." && $fileo != ".") {
                    ScanRepertoire($file, $path, $autre . "/" . $fileo);
                }
            } else {
                if (strpos($fileo, "#") == 0 && false == strpos($fileo, ".bak.xsl"))
                    if (strpos($fileo, ".xsl") > 1) {
                        $file[] = $scan_rep . $autre . "/" . $fileo;
                    }
            }
        }
        closedir($handle);
    }
}

$path = "";
ScanRepertoire($file, $path, ".");

$catalogue_require_once = null;

// Lecture des differents fichiers à analyse
$chemin_base = $directory . "/" . $dirTo;
print $chemin_base . "\n";
@mkdir($chemin_base);

if (is_array($file)) {
    
    $cl_trad = new TradXsl("10.30aa");
    foreach ($file as $index => $fichier) {
        $catalogue_require_once = null;
        
        $fichier = str_replace(".xsl", "", $fichier);
        
        $cl_trad->ExtraitMot($fichier, true);
        print $index . " / " . count($file) . "\t" . $fichier . "\n";
    }
}

?>