function r_proc_files($path)
{
    global $eol, $into, $relative, $whitelist;
    $fd = opendir($path);
    $to = str_replace($relative, $into, $path);
    if (!file_exists($to)) {
        mkdir($to);
    }
    // over each zone
    while (false !== ($file = readdir($fd))) {
        if (false !== strpos($file, '.')) {
            continue;
        }
        if (is_dir($path . $file)) {
            if (in_array($file, $whitelist)) {
                r_proc_files($path . $file . '/');
            } else {
                echo 'Dropped: `' . $file . '` - Not in whitelist' . $eol;
            }
            continue;
        }
        $tz = new tz_decode2($path . $file);
        if (!$tz->open()) {
            die("Count not open file: {$tz->tz_file}\n");
        }
        $tz->exec();
        $tz->load_current_offsets();
        $code = build_php($tz);
        file_put_contents($to . $file . '.php', $code);
        echo 'Proc: ' . $path . $file . $eol;
        //		echo $to . $eol;
    }
    closedir($fd);
}
Beispiel #2
0
function build_packages()
{
    build_php();
    build_minihttpd();
    build_wol();
    build_ezipupdate();
    build_bpalogin();
    build_ucdsnmp();
}
Beispiel #3
0
     $prefix = realpath(DIR_BUILD_PREFIX) . '/' . $fileinfo->getFileName();
     // Rudimentary cache check
     if (file_exists($prefix . '/bin/php')) {
         if (VERBOSE) {
             echo 'INFO: Already successfully built from: ', $fileinfo->getBaseName(), PHP_EOL;
         }
         continue;
     }
     // Optional version specific options, see inc/config.php
     if ($more_options = get_version_configs($config_options_versions, $fileinfo->getFileName())) {
         $config_options_run = array_merge($config_options_all, array($more_options));
     } else {
         $config_options_run = $config_options_all;
     }
     // Rudimentary build system
     build_php($fileinfo->getPathName(), $prefix, realpath(DIR_LOGS), $config_options_run);
     if (file_exists($prefix . '/bin/php')) {
         if (copy($prefix . '/bin/php', DIR_PHP_BINARIES . DIRECTORY_SEPARATOR . $fileinfo->getBaseName())) {
             chmod(DIR_PHP_BINARIES . DIRECTORY_SEPARATOR . $fileinfo->getBaseName(), 0755);
         }
     }
 }
 if (VERBOSE) {
     echo PHP_EOL;
     $status = get_status_binaries(DIR_BUILD_PREFIX);
     if ($status['bad']) {
         echo 'INFO: These PHP versions failed to build:', PHP_EOL;
         echo 'INFO: Check the logs for reasons why, as found in: ', DIR_LOGS, PHP_EOL;
         foreach ($status['bad'] as $version => $it) {
             echo "\t", $version, PHP_EOL;
         }