コード例 #1
0
ファイル: revcheck.php プロジェクト: phpsource/doc-gtk
        // Provide info about number of WIP files
        $files_by_mark[REV_WIP] += count($translation['allfiles']);
    }
    // Return with collected info in two vars
    return array($output_charset, $translation);
}
// parse_translation() function end()
// =========================================================================
// Start of the program execution
// =========================================================================
// Check for directory validity
if (!@is_dir($DOCDIR . $LANG)) {
    die("The {$LANG} language code is not valid");
}
// Parse translation.xml file for more information
list($charset, $translation) = parse_translation($DOCDIR, $LANG, $MAINT);
// Add WIP files to maintainers file count and figure out,
// if we need to use optional date and revision columns
$using_date = FALSE;
$using_rev = FALSE;
foreach ($translation["files"] as $num => $fileinfo) {
    $files_by_maint[$fileinfo["person"]][REV_WIP]++;
    if (isset($fileinfo["date"])) {
        $using_date = TRUE;
    }
    if (isset($fileinfo["revision"])) {
        $using_rev = TRUE;
    }
}
// Get all files status
$files_status = get_dir_status($DOCDIR . "en/");
コード例 #2
0
ファイル: rev.php プロジェクト: phpsource/web-doc
    $db = new SQLite3($tmp_db);
    /* Didn't throw exception at some point? */
    if (!$db) {
        throw Exception("Cant open {$tmp_db}");
    }
} catch (Exception $e) {
    echo $e->getMessage();
    echo "Could not open {$tmp_db}";
    exit;
}
$db->exec($CREATE);
// 3 - Fill in the description table while cleaning the langs
// without revision.xml file
foreach ($LANGS as $id => $lang) {
    echo "Fetching the {$lang} description\n";
    parse_translation($lang);
}
// 4 - Recurse in the manual seeking for files and fill $SQL_BUFF
do_revcheck();
// 4:1 - Recurse in the manuel seeking for old files for each language and fill $SQL_BUFF
foreach ($LANGS as $lang) {
    check_old_files('', $lang);
}
// 5 - Query $SQL_BUFF and exit
$db->exec('BEGIN TRANSACTION');
$db->exec($SQL_BUFF);
$db->exec('COMMIT');
$db->close();
echo "Copying temporary database to final database\n";
copy($tmp_db, $db_name);
@unlink($tmp_db);