Example #1
0
 */
/**
 * This script rebuilds build.log used by build-chms.php ($build_history)
 * without actually rebuilding the CHM files
 */
/**
 * Configuration
 */
include_once __DIR__ . '/build-chms-config.php';
/**
 * The languages to build are retrieved from https://svn.php.net/repository/web/php/trunk/include/languages.inc
 */
if (file_exists(__DIR__ . '\\languages.inc')) {
    unlink(__DIR__ . '\\languages.inc');
}
execute_task('Get list of online languages', PATH_WGET, '--debug --verbose --no-check-certificate https://svn.php.net/repository/web/php/trunk/include/languages.inc --output-document=' . __DIR__ . '\\languages.inc', false);
if (file_exists(__DIR__ . '\\languages.inc')) {
    include_once __DIR__ . '\\languages.inc';
}
/**
 * Always build English first.
 */
unset($ACTIVE_ONLINE_LANGUAGES['en']);
ksort($ACTIVE_ONLINE_LANGUAGES);
$ACTIVE_ONLINE_LANGUAGES = array('en' => 'English') + $ACTIVE_ONLINE_LANGUAGES;
/**
 * Hold the results of this build
 */
$build_history = array();
foreach ($ACTIVE_ONLINE_LANGUAGES as $lang_code => $language) {
    $chm_filename = PATH_CHM . '\\' . 'php_manual_' . $lang_code . '.chm';
Example #2
0
    }
}
$pids = $unix->PIDOF_PATTERN_ALL(basename(__FILE__));
if (count($pids) > 6) {
    echo "Starting......: " . date("H:i:s") . " Too many instances " . count($pids) . " dying...\n";
}
if ($argv[1] == "--run-schedules") {
    run_schedules($argv[2]);
    die;
}
if ($argv[1] == "--defaults") {
    Defaults($argv[2]);
    die;
}
if ($argv[1] == "--run") {
    execute_task($argv[2]);
    die;
}
if ($argv[1] == "--run-squid") {
    execute_task_squid($argv[2]);
    die;
}
build_schedules();
function Defaults()
{
    $task = new system_tasks();
    if ($GLOBALS["VERBOSE"]) {
        echo "CheckDefaultSchedules()\n";
    }
    $task->CheckDefaultSchedules();
    build_schedules();
Example #3
0
     /**
      * Add to history
      */
     $build_history[] = array('php_manual_' . $lang_code . '.chm', md5_file($chm_filename), filemtime($chm_filename));
 }
 /**
  * Check if we are supposed to build the enhanced version
  */
 if (EXTENDED) {
     /**
      * Run the HTML Help Compiler to generate the actual CHM file
      */
     if ($multibyte_search_enabled) {
         execute_task('- [Enhanced] HHC (with Fulltext Search)', PATH_APPLOCALE, $lcid . ' "' . PATH_HHC . '" "' . PATH_DOC . '\\tmp\\' . $lang_code . '\\php-enhancedchm\\php_manual_' . $lang_code . '.hhp"', 'hhc_enhanced_' . $lang_code);
     } else {
         execute_task('- [Enhanced] HHC', PATH_HHC, '"' . PATH_DOC . '\\tmp\\' . $lang_code . '\\php-enhancedchm\\php_manual_' . $lang_code . '.hhp"', 'hhc_enhanced_' . $lang_code);
     }
     if (!is_file(PATH_DOC . '\\tmp\\' . $lang_code . '\\php-enhancedchm\\php_manual_' . $lang_code . '.chm')) {
         echo date('r') . ' - Build error: Enhanced: HHC failed' . PHP_EOL;
         goto cleanup;
     }
     /**
      * Anything smaller than ~5MB is broken. Common broken sizes are 2MB and 15K. Common good size are 10-12MB.
      */
     if (filesize(PATH_DOC . '\\tmp\\' . $lang_code . '\\php-enhancedchm\\php_manual_' . $lang_code . '.chm') < 5000000) {
         echo date('r') . ' - Build error: Enhanced: CHM file too small, something went wrong' . PHP_EOL;
         goto cleanup;
     }
     /**
      * Copy the CHM file into the archive
      */