예제 #1
0
파일: index.php 프로젝트: hetao29/slightphp
<?php

/**
 * sample to test
 *
 * http://localhost/samples/www/index.php/zone/default/entry/a/b/c
 * http://localhost/samples/www/index.php/zone-default-entry-a-b-c.html
 *
 */
require_once "global.php";
//SlightPHP::setDebug(true);
SlightPHP::setAppDir(ROOT_APP);
SlightPHP::setDefaultZone("index");
SlightPHP::setDefaultPage("main");
SlightPHP::setDefaultEntry("entry");
SlightPHP::setSplitFlag("-_.");
//{{{
SDb::setConfigFile(ROOT_CONFIG . "/db.conf");
SRoute::setConfigFile(ROOT_CONFIG . "/route.conf");
SRedis::setConfigFile(ROOT_CONFIG . "/redis.conf");
//}}}
if (($r = SlightPHP::run()) === false) {
    echo "404 error";
} elseif (is_object($r)) {
    var_dump($r);
} else {
    echo $r;
}
예제 #2
0
 static function setConfigFile($file)
 {
     self::$_RouteConfigFile = $file;
     self::$_Routes = array_merge(self::$_Routes, parse_ini_file(self::$_RouteConfigFile, true));
     self::parse();
 }
예제 #3
0
<?php

/**
 * sample to test
 *
 * http://localhost/samples/www/index.php/zone/default/entry/a/b/c
 * http://localhost/samples/www/index.php/zone-default-entry-a-b-c.html
 *
 */
require_once "global.php";
SlightPHP::setDebug(true);
SlightPHP::setAppDir(ROOT_APP);
SlightPHP::setDefaultZone("index");
SlightPHP::setDefaultPage("main");
SlightPHP::setDefaultEntry("entry");
SlightPHP::setSplitFlag("-_.");
//{{{
SDb::setConfigFile(ROOT_CONFIG . "/db.ini");
SRoute::setConfigFile(ROOT_CONFIG . "/route.ini");
//}}}
if (($r = SlightPHP::run()) === false) {
    echo "404 error";
} elseif (is_object($r)) {
    var_dump($r);
} else {
    echo $r;
}