Example #1
0
File: index.php Project: gohai/jms
<?php

@(require_once 'config.inc.php');
require_once 'jms.inc.php';
$query_string = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';
$tmp = explode('&', $query_string);
if (substr($tmp[0], 0, 7) === 'object/') {
    /* show the work template if the parameter starts with "object/" */
    $name = get_name_from_url(substr($tmp[0], 7));
    if ($name === false) {
        /* url doesn't exist, show a 404 */
        serve_404();
    }
    echo generate_work($name);
} else {
    if ($tmp[0] === 'browse') {
        /* show the browse template if the parameter is "browse" */
        echo generate_browse();
    } else {
        if (is_file('template-' . $tmp[0] . '.php')) {
            /* show any other static file (template) if it exists */
            echo run_template('template-' . $tmp[0] . '.php');
        } else {
            if (empty($tmp[0])) {
                /* if no parameter is given, show either the intro or browse */
                /* depending on a configuration setting */
                if (config('show_intro', true)) {
                    echo run_template('template-intro.php');
                } else {
                    echo generate_browse();
                }
 */
require_once dirname(__FILE__) . '/zippyzip.conf';
require_once dirname(__FILE__) . '/zippyzip-fragment.conf';
require_once dirname(__FILE__) . '/zippyzip-common.php';
log_info(__FILE__);
log_info("Start.");
mkdirs(array(PATH_TMP));
$updated = false;
/*
 * CSV データと JSON データの処理
 */
if (GENERATE_CSV_FRAGMENTS || GENERATE_JSON) {
    if (!update_x0402()) {
        exit(1);
    }
    if (!generate_work()) {
        exit(1);
    }
    if (GENERATE_CSV_FRAGMENTS) {
        if (!update_csv()) {
            exit(1);
        }
    }
    if (GENERATE_JSON) {
        if (!update_json()) {
            exit(1);
        }
    }
    rmdirs(array(PATH_TMP . "/work"));
}
/*