Ejemplo n.º 1
0
 function get_package_parts($edition_num)
 {
     $edition_id = get_edition_id($edition_num);
     $zip_root_url = '../../' . get_package_path($edition_num) . $edition_id;
     $zip_root_path = get_package_dir($edition_num) . DIRECTORY_SEPARATOR . $edition_id;
     return array('html' => array('url' => $zip_root_url . '-html-0.zip', 'path' => $zip_root_path . '-html-0.zip'), 'assets' => array('url' => $zip_root_url . '-assets-0.zip', 'path' => $zip_root_path . '-assets-0.zip'));
 }
    <h1><?php 
print $title;
?>
</h1>
<?php 
$force = array_key_exists('force', $_GET);
if ($force) {
    print "<h2>Forcing re-building existing packages...</h2>";
}
$scheme = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http';
$root = $scheme . '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/';
print "<ul>";
for ($edition_num = get_number_of_editions(); $edition_num > 0; $edition_num--) {
    $server_root = $scheme . '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'];
    $edition_id = urlencode(get_edition_id($edition_num));
    $save_root = urlencode(get_package_dir($edition_num));
    $relative_path = urlencode(ltrim($_SERVER['SCRIPT_NAME'] . '/edition/' . $edition_id, '/'));
    $scheme = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http';
    $atom = urlencode($server_root . $_SERVER['SCRIPT_NAME'] . '/edition/' . $edition_id . '/content.xml');
    $package_url = $server_root . CONTENT_TEST_PATH . 'build-package.php?edition_id=' . $edition_id . '&save_root=' . $save_root . '&atom=' . $atom . '&relative_path=' . $relative_path;
    $package_xml_exists = pugpig_get_edition_package_exists($edition_num);
    print "<li>{$edition_id}... (<a href=\"{$package_url}\">build url</a>) ";
    if ($package_xml_exists) {
        print "<span class=\"exists\">already exists</span>";
    } else {
        print "<span class=\"notexists\">does not exist</span>";
    }
    print " - ";
    if ($package_xml_exists && !$force) {
        _print_immediately("skipping");
    } else {