<?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; }
static function setConfigFile($file) { self::$_RouteConfigFile = $file; self::$_Routes = array_merge(self::$_Routes, parse_ini_file(self::$_RouteConfigFile, true)); self::parse(); }
<?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; }