Example #1
0
            if ($relpath[0] === '/') {
                $uplevels = 1;
            }
            if ($relpath[0] === '.') {
                function _empty($x)
                {
                    return empty($x);
                }
                $max_uplevels = count(explode('/', trim(parse_url(gb::$site_url, PHP_URL_PATH), '/')));
                $uplevels = count(array_filter(explode('../', $relpath), '_empty'));
            }
            if ($uplevels > $max_uplevels) {
                trigger_error('gb::$theme_url could not be deduced since the theme you are ' . 'using (' . gb::$theme_dir . ') is not reachable from ' . gb::$site_url . '. You need to manually define $gb_theme_url before including gitblog.php', E_USER_ERROR);
            }
        } else {
            gb::$theme_url = gb::$site_url . $relpath . '/';
        }
    }
}
unset($s);
unset($u);
#------------------------------------------------------------------------------
# Define error handler which throws PHPException s
function gb_throw_php_error($errno, $errstr, $errfile = null, $errline = -1, $errcontext = null)
{
    if (error_reporting() === 0) {
        return;
    }
    try {
        gb::vlog(LOG_WARNING, array($errstr), 2);
    } catch (Exception $e) {