示例#1
0
function require_view($viewName, $locals = array())
{
    setg("locals", $locals);
    require $GLOBALS["appDir"] . "/views/{$viewName}.html.php";
}
示例#2
0
<?php

require_once '_config.php';
setg("title", "UAS-ENGINE");
setg("route", "homepage");
require_view('layout/wrapper');
示例#3
0
<?php

if (function_exists('date_default_timezone_set')) {
    date_default_timezone_set('America/New_York');
}
$GLOBALS["appDir"] = resolve_path("app");
$GLOBALS["viewables"] = array();
$GLOBALS["configDir"] = resolve_path("config");
$GLOBALS["vendorDir"] = realpath($_SERVER["DOCUMENT_ROOT"] . "/../app/vendor");
$GLOBALS["baseDir"] = realpath($_SERVER["DOCUMENT_ROOT"] . "/..");
$GLOBALS["testsDir"] = realpath($_SERVER["DOCUMENT_ROOT"] . "/../app/tests");
setg("pageName", basename($_SERVER['PHP_SELF']));
function resolve_path($name)
{
    if ($name == ".") {
        $publicRoot = $_SERVER["DOCUMENT_ROOT"] . "/..";
        $appRoot = $_SERVER["DOCUMENT_ROOT"];
    } else {
        if ($_SERVER["DOCUMENT_ROOT"] != "") {
            $publicRoot = $_SERVER["DOCUMENT_ROOT"] . "/../{$name}";
            $appRoot = $_SERVER["DOCUMENT_ROOT"] . "/{$name}";
        } else {
            return "../{$name}";
        }
    }
    return file_exists($publicRoot) ? realpath($publicRoot) : realpath($appRoot);
}
function __autoload($class_name)
{
    if (file_exists($GLOBALS["appDir"] . "/models/{$class_name}.php")) {
        require_once $GLOBALS["appDir"] . "/models/{$class_name}.php";
示例#4
0
文件: dung.php 项目: itafroma/zork
<?php

/**
 * @file
 * Dungeon code.
 */
namespace Itafroma\Zork;

setg('STAR_BITS', 0);