当前位置: 首页>>代码示例>>PHP>>正文


PHP Route::init方法代码示例

本文整理汇总了PHP中Route::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::init方法的具体用法?PHP Route::init怎么用?PHP Route::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Route的用法示例。


在下文中一共展示了Route::init方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: route

 /**
  * Initializes the route.
  * Prevents browser from trying to load a physical file.
  */
 private function route()
 {
     Route::init();
     // Checks if the browser tried to load a physical file who doesn't exists
     $error = false;
     $query = Route::getQuery();
     $length = strlen($query);
     if (substr($query, $length - 3, 1) == '.') {
         $ext = substr($query, $length - 2, 2);
         if ($ext == 'js') {
             $error = true;
         }
     } else {
         if (substr($query, $length - 4, 1) == '.') {
             $ext = substr($query, $length - 3, 3);
             if (in_array($ext, array('css', 'png', 'jpg', 'gif', 'ico', 'svg', 'eot', 'ttf'))) {
                 $error = true;
             }
         } else {
             if (substr($query, $length - 5, 1) == '.') {
                 $ext = substr($query, $length - 4, 4);
                 if (in_array($ext, array('jpeg', 'woff'))) {
                     $error = true;
                 }
             }
         }
     }
     $this->is404 = $error;
 }
开发者ID:ThibaultVlacich,项目名称:Event-You-All,代码行数:33,代码来源:Main.php

示例2: run

 public static function run()
 {
     require_once 'Database.php';
     require_once 'Route.php';
     require_once 'Load.php';
     require_once 'Engine.php';
     DB::init('localhost', 'icourse', 'root', '');
     Route::init();
     Load::$path = OBJ_ROOT . Route::$class . '.php';
     Load::init();
     foreach ($_REQUEST as $key => $val) {
         Engine::$oil[$key] = $val;
     }
     Engine::$class = Route::$class;
     Engine::$function = Route::$function;
     Engine::init();
 }
开发者ID:soakiz,项目名称:pinhub,代码行数:17,代码来源:Pin.php

示例3: parse_ini_file

 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 */
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
$ini = parse_ini_file("./config.ini");
//-----------------------------------------------------------------------------
require_once './app/autoload.php';
//-----------------------------------------------------------------------------
Render::init();
$tmplData = Template::init();
$initedOK = Route::init();
if ($initedOK == false) {
    Render::antiTampering($tmplData);
}
//-----------------------------------------------------------------------------
if ($_GET['logoff']) {
    //echo "Logoff.";
    Session::logoff();
    Render::login($tmplData);
} elseif ($_POST['login'] && Session::login($tmplData) == false) {
    //echo "Login Failed.";
    Render::login($tmplData);
}
if (Session::isLoggedIn() === false) {
    //echo "Not logged in.";
    Render::login($tmplData);
开发者ID:Kloadut,项目名称:phpFileManager,代码行数:31,代码来源:index.php

示例4: Route

<?php

require_once 'controller.php';
require_once 'model.php';
require_once 'route.php';
$app = new Route();
$app->init();
开发者ID:VladimirShaganian,项目名称:LoginRegister,代码行数:7,代码来源:core.php

示例5: array

$_GET['id'] = '19';
$_GET['login'] = '';
$_GET['nick'] = 'userNick19 updated!';
$_GET['email'] = '';
*/
/* getbyid test
$_GET['action'] = 'getbyid';
$_GET['id'] = '286';
*/
/* add test
$_GET['action'] = 'add';
$_GET['data'] = array('login'=>'test1221');
*/
/* update test
$_GET['action'] = 'update';
$_GET['id'] = '6';
$_GET['data'] = array('nick'=>'test2222');
*/
/* delete test
$_GET['action'] = 'delete';
$_GET['id'] = '7';
*/
/* заглушка авторизации
$_GET['authorization'] = array('login'=>'test', 'pass'=>'test');
$_POST['authorization'] = array('login'=>'test', 'pass'=>'test');
*/
try {
    Route::init()->run();
} catch (Exception $e) {
    echo $e->getMessage() . '<br>';
}
开发者ID:freecod,项目名称:UserList,代码行数:31,代码来源:index.php

示例6: ob_start

<?php

ob_start();
//session_set_cookie_params(172800);
include_once MAIN_DIR . DS . ENGINE_DIR_PREFIX . 'core/defines.php';
include_once CLASS_DIR . DS . 'Load.class.php';
Load::file(array('Temp.class.php', 'File.class.php'), CLASS_DIR);
spl_autoload_register('Load::autoLoadClasses');
register_shutdown_function('Core::shutDown');
//Debug::start();
//$GLOBALS['_SESSION'] = new SessionArray();
Load::getClasses();
Route::init();
App::load(Request::get('app'));
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:14,代码来源:init.php

示例7: makeRouteAny

 /**
  * Создание роута работающего через любой
  * @param $params
  * @throws \Exception
  */
 protected static function makeRouteAny($params)
 {
     $route = new Route();
     static::addRoute($route->init($params, 'any'));
 }
开发者ID:ArmSALArmy,项目名称:Banants,代码行数:10,代码来源:Router.php

示例8: __construct

 /**
  * __construct
  * @param array $config optional
  **/
 public function __construct($config = array())
 {
     self::$instance = $this;
     //** Config
     $this->config = new Config();
     if (is_array($config) && count($config)) {
         while (list($key, $value) = each($config)) {
             $this->config->set($key, $value);
         }
     }
     //-- End Config
     if ($this->config->get('path.basepath') == '') {
         $this->config->set('path.basepath', getcwd() . '/');
     }
     self::$header[] = $_SERVER["SERVER_PROTOCOL"] . ' ' . Route::$HTTP_RESPONSE[200];
     $this->route = new Route();
     Route::init();
     Route::$BASEPATH = $this->config->get('path.basepath');
     $this->url = new Url(Route::$PROTOCOL, Route::$BASEURL, Route::$BASEPATH);
     $this->assets = new Assets($this->url);
     $this->request = new Request();
     //** ID: Memasukan Libary/Pustaka berdasarkan config | EN: Load Dynamic Libraries from config
     $libraries = $this->config->get('libraries');
     if (is_array($libraries) && count($libraries) > 0) {
         while (list($library, $params) = each($libraries)) {
             $clsLibrary = 'Kecik\\' . $library;
             if (class_exists($clsLibrary)) {
                 if (isset($params['enable']) && $params['enable'] === TRUE) {
                     $library = strtolower($library);
                     //** ID: Untuk Library/Pustaka tanpa parameter
                     //** EN: For Library without parameter
                     if (!isset($params['config']) && !isset($params['params'])) {
                         //** ID: Untuk Library/Pustaka DIC | EN: For DIC Library
                         if ($library == 'dic') {
                             $this->container = new DIC();
                         } elseif ($library == 'mvc') {
                             if (isset($this->db)) {
                                 MVC::setDB($this->db);
                             }
                         } else {
                             // ID: Untuk Library/Pustaka lain | EN: Other Library
                             $this->{$library} = new $clsLibrary();
                         }
                         //** ID: Untuk Library/Pustaka dengan parameter Kelas Kecik
                         //** EN: For Library with parameter of Kecik CLass
                     } elseif (isset($params['config'])) {
                         //** ID: Buat variabel config
                         //** EN: Create config variable
                         while (list($key, $value) = each($params['config'])) {
                             $this->config->set($library . '.' . $key, $value);
                         }
                         //** ID: untuk Library/Pustaka Database | EN: For Database Library
                         if ($library == 'database') {
                             $this->db = new Database();
                             if (class_exists('MVC')) {
                                 MVC::setDB($this->db);
                             }
                         } else {
                             //** ID: untuk Library/Pustaka lain | EN: For Other library
                             $this->{$library} = new $clsLibrary();
                         }
                         //** ID: Untuk Library/Pustaka tanpa parameter Kelas Kecik
                         //** EN: For Library without parameter of Kecik CLass
                     } elseif (isset($params['params'])) {
                         $this->{$library} = new $clsLibrary($params['params']);
                     }
                 }
             }
         }
     }
     //-- ID: Akhir untuk memasukan library/pustaka secara dinamis
     //-- EN: End Load Dynamic Library
     spl_autoload_register(array($this, 'autoload'), true, true);
 }
开发者ID:pandigresik,项目名称:kecik,代码行数:78,代码来源:Kecik.php


注:本文中的Route::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。