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


PHP router::createApp方法代码示例

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


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

示例1: error_reporting

 * @package     chanzhiEPS
 * @version     $Id$
 * @link        http://www.chanzhi.org
 */
/* Turn off error reporting first. */
error_reporting(0);
/* Start output buffer. */
ob_start();
/* Define the run mode as admin. */
define('RUN_MODE', 'admin');
/* Load the framework.*/
include 'loader.php';
/* Check admin entry. */
checkAdminEntry();
/* Instance the app. */
$app = router::createApp('chanzhi', $systemRoot);
$config = $app->config;
/* Check the reqeust is getconfig or not. Check installed or not. */
if (isset($_GET['mode']) and $_GET['mode'] == 'getconfig') {
    die($app->exportConfig());
}
if (!isset($config->installed) or !$config->installed) {
    die(header('location: install.php'));
}
/* Change the request settings. */
$config->frontRequestType = $config->requestType;
$config->requestType = 'GET';
$config->default->module = 'admin';
$config->default->method = 'index';
/* Run it. */
$common = $app->loadCommon();
开发者ID:dyp8848,项目名称:chanzhieps,代码行数:31,代码来源:admin.php

示例2: error_reporting

<?php

/* Set error reporting level. */
error_reporting(E_ALL ^ E_STRICT);
/* Save current working directory and then change the directory of init.php. */
$cwd = getcwd();
chdir(dirname(__FILE__));
/* Load the framework. */
include '../framework/router.class.php';
include '../framework/control.class.php';
include '../framework/model.class.php';
include '../framework/helper.class.php';
/* Create the app. */
$app = router::createApp('pms', dirname(dirname(__FILE__)));
/* Reconnect to the test database. */
include '../config/test.php';
$app->connectDB();
/* Load the common module. */
$common = $app->loadCommon();
/* Change directory back again. */
chdir($cwd);
开发者ID:xianglongzhang,项目名称:zentaopms,代码行数:21,代码来源:init.php

示例3: error_reporting

/**
 * The router file of zentaophp.
 *
 * All request should be routed by this router.
 *
 * The author disclaims copyright to this source code.  In place of
 * a legal notice, here is a blessing:
 * 
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */
/* Set the error reporting. */
error_reporting(0);
/* Start output buffer. */
ob_start();
/* Load the framework. */
include './framework/router.class.php';
include './framework/control.class.php';
include './framework/model.class.php';
include './framework/helper.class.php';
/* Instance the app. */
$startTime = getTime();
$app = router::createApp('demo');
/* Run the app. */
$common = $app->loadCommon();
$app->parseRequest();
$app->loadModule();
/* Flush the buffer. */
echo helper::removeUTF8Bom(ob_get_clean());
开发者ID:dyp8848,项目名称:zentaophp,代码行数:30,代码来源:index.php

示例4: error_reporting

 * @copyright   Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Chunsheng Wang <chunsheng@cnezsoft.com>
 * @package     RanZhi
 * @version     $Id: install.php 3138 2015-11-09 07:32:18Z chujilu $
 * @link        http://www.ranzhico.com
 */
error_reporting(E_ALL);
session_start();
define('RUN_MODE', 'install');
/* Load the framework. */
include '../../framework/router.class.php';
include '../../framework/control.class.php';
include '../../framework/model.class.php';
include '../../framework/helper.class.php';
/* Instance the app. */
$app = router::createApp('sys');
/* Check installed or not. */
if (!isset($_SESSION['installing']) and isset($config->installed) and $config->installed) {
    die(header('location: index.php'));
}
/* Reset the config params to make sure the install program will be lauched. */
$config->set('requestType', 'GET');
$config->set('default.module', 'install');
$app->setDebug();
/* During the installation, if the database params is setted, auto connect the db. */
if (isset($config->installed) and $config->installed) {
    $app->connectDB();
}
$app->parseRequest();
$app->loadModule();
开发者ID:leowh,项目名称:colla,代码行数:31,代码来源:install.php

示例5: error_reporting

 * @link        http://www.ranzhico.com
 */
/* Set the error reporting. */
error_reporting(E_ALL);
/* Start output buffer. */
ob_start();
/* Define the run mode as front. */
define('RUN_MODE', 'front');
/* Load the framework. */
$frameworkRoot = dirname(__FILE__);
include "{$frameworkRoot}/router.class.php";
include "{$frameworkRoot}/control.class.php";
include "{$frameworkRoot}/model.class.php";
include "{$frameworkRoot}/helper.class.php";
/* Log the time and define the run mode. */
$startTime = getTime();
/* Run the app. */
$app = router::createApp($appName);
$common = $app->loadCommon();
/* Check for need upgrade. */
if (RUN_MODE != 'upgrade') {
    $config->installedVersion = $common->loadModel('setting')->getVersion();
    if (!(!is_numeric($config->version[0]) and $config->version[0] != $config->installedVersion[0]) and version_compare($config->version, $config->installedVersion, '>')) {
        die(header('location: upgrade.php'));
    }
}
$app->parseRequest();
$common->checkPriv();
$app->loadModule();
/* Flush the buffer. */
echo helper::removeUTF8Bom(ob_get_clean());
开发者ID:leowh,项目名称:colla,代码行数:31,代码来源:loader.php

示例6: title

#!/usr/bin/env php
<?php 
include '../../../tests/init.php';
// Include the init file of testing framework.
include '../../router.class.php';
// Include router class.
include '../../helper.class.php';
// Include helper class.
title("testing the logic for site code.");
$router = router::createApp('test', '../../../');
run(helper::getSiteCode('www.xirang.com')) && expect('xirang');
run(helper::getSiteCode('xirang.com')) && expect('xirang');
run(helper::getSiteCode('xirang.com.cn')) && expect('xirang');
run(helper::getSiteCode('www.xirang.cn')) && expect('xirang');
run(helper::getSiteCode('xirang')) && expect('xirang');
run(helper::getSiteCode('192.168.1.1')) && expect('192.168.1.1');
run(helper::getSiteCode('www.xirang.com.cn')) && expect('xirang');
run(appendChanzhiDomain());
run(helper::getSiteCode('xirang.n1.chanzhi.net')) && expect('xirang');
function appendChanzhiDomain()
{
    global $router;
    $router->config->domainPostfix .= '|n1.chanzhi.net|';
}
开发者ID:dyp8848,项目名称:chanzhieps,代码行数:24,代码来源:01_setsitecode.php


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