Пример #1
0
<?php

# Site title and description
gb::$site_title = 'smisk';
# Private secret
gb::$secret = trim(file_get_contents(dirname(__FILE__) . '/secret'));
# Index prefix -- rewrite rules only engaged live
if ($_SERVER['SERVER_NAME'] === 'python-smisk.org') {
    gb::$index_prefix = '';
}
Пример #2
0
    }
    static function verify()
    {
        if (self::verify_integrity() === 2) {
            header("Location: " . gb::$site_url . "gitblog/admin/setup.php");
            exit(0);
        }
        gb::verify_config();
    }
}
#------------------------------------------------------------------------------
# Initialize constants
gb::$dir = dirname(__FILE__);
ini_set('include_path', ini_get('include_path') . ':' . gb::$dir . '/lib');
if (gb::$request_query === 'PATH_INFO') {
    gb::$index_prefix = rtrim(gb::$index_prefix, '/') . '/';
}
$u = dirname($_SERVER['SCRIPT_NAME']);
$s = dirname($_SERVER['SCRIPT_FILENAME']);
if (substr($_SERVER['SCRIPT_FILENAME'], -20) === '/gitblog/gitblog.php') {
    exit('you can not run gitblog.php directly');
}
gb::$is_internal_call = (strpos($s, '/gitblog/') !== false || substr($s, -8) === '/gitblog') && strpos(realpath($s), realpath(gb::$dir)) === 0;
# gb::$site_dir
if (isset($gb_site_dir)) {
    gb::$site_dir = $gb_site_dir;
    unset($gb_site_dir);
} else {
    if (gb::$is_internal_call) {
        # confirmed: inside gitblog -- back up to before the gitblog dir and
        # assume that's the site dir.