Exemplo n.º 1
0
function check_php_syntax($dir)
{
    global $syntax_errors;
    if (is_dir($dir)) {
        $objects = scandir($dir);
        foreach ($objects as $object) {
            if ($object != '.' && $object != '..') {
                if (filetype($dir . '/' . $object) == 'dir') {
                    check_php_syntax($dir . '/' . $object);
                } elseif (substr($object, -4) == '.php') {
                    //$x = `php -d error_reporting=0 -l {$dir}/{$object}`;
                    $x = `php -d error_reporting=1 -l {$dir}/{$object}`;
                    if (substr($x, 0, 25) != 'No syntax errors detected') {
                        $syntax_errors[] = $dir . '/' . $object;
                    }
                }
            }
        }
        reset($objects);
    }
}
Exemplo n.º 2
0
    }
    unset($ucf);
}
$nbCommiters = 0;
if (!$options['no-copyright-update'] && important_step("Update '" . COPYRIGHTS_FILENAME . "' file (using final version number '{$version}')")) {
    if ($ucf = update_copyright_file($mainversion . '.0')) {
        info("\r>> Copyrights updated: " . ($ucf['newContributors'] == 0 ? 'No new contributor, ' : "+{$ucf['newContributors']} contributor(s), ") . ($ucf['newCommits'] == 0 ? 'No new commit' : "+{$ucf['newCommits']} commit(s)"));
        important_step("Commit new " . COPYRIGHTS_FILENAME, true, "[REL] Update " . COPYRIGHTS_FILENAME . " for {$secdbVersion}");
    } else {
        error('Copyrights update failed.');
    }
}
if (!$options['no-check-php'] && important_step("Check syntax of all PHP files")) {
    $error_msg = '';
    $dir = '.';
    check_php_syntax($dir, $error_msg, $options['no-check-php-warnings']) or error($error_msg);
    info('>> Current PHP code successfully passed the syntax check.');
}
if (!$options['no-check-smarty'] && important_step("Check syntax of all Smarty templates")) {
    $error_msg = '';
    check_smarty_syntax($error_msg);
    info('>> Current Smarty code successfully passed the syntax check.');
}
if (!$options['no-secdb'] && important_step("Generate SecDB file 'db/tiki-secdb_{$version}_mysql.sql'")) {
    write_secdb(ROOT . "/db/tiki-secdb_{$version}_mysql.sql", ROOT, $secdbVersion);
    important_step("Commit SecDB file", true, "[REL] SecDB for {$secdbVersion}");
}
if ($isPre) {
    if (!$options['no-packaging'] && important_step("Build packages files (based on the branch)")) {
        build_packages($packageVersion, $branch);
        echo color("\nMake sure these tarballs are tested by at least 3 different people.\n\n", 'cyan');