本文整理汇总了PHP中Env::Set方法的典型用法代码示例。如果您正苦于以下问题:PHP Env::Set方法的具体用法?PHP Env::Set怎么用?PHP Env::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Env
的用法示例。
在下文中一共展示了Env::Set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$dispatch = $app_root . $url;
// Generate route table.
/*
$route['alias'] = $is_alias;
$route['rewrite_base'] = $rewrite_base; // TODO: Toolbox::GetRewriteBase();
$route['meta_path'] = $_SERVER['DOCUMENT_ROOT'].$request_uri;
$route['file_name'] = $file_name;
*/
$route = array();
$route['app_root'] = $app_root;
$route['arguments'] = null;
$route['smart_url'] = null;
$route['real_path'] = $dispatch;
$route['extension'] = Router::CalcExtension($dispatch);
$route['mime'] = Router::CalcMime($route['extension']);
Env::Set('route', $route);
// Do dispatch.
if ($io = file_exists($dispatch)) {
$io = $op->Template($dispatch);
}
// Dispatch was failed.
if ($io === false) {
OnePiece5::StackError("\\Dispatch\\ was failed.\n (file={$dispatch}, URI={$_SERVER['REQUEST_URI']})", 'en');
}
/****************************************************************************************************
*
* Finish
*
****************************************************************************************************/
if (Toolbox::isHtml()) {
// Debug.
示例2: array
<?php
/**
* op-unit-wikipedia/bootstrap.php
*
* @creation 2015-12-10
* @version 1.0
* @package op-unit-wikipedia
* @author Tomoaki Nagahara <tomoaki.nagahara@gmail.com>
* @copyright Tomoaki Nagahara All right reserved.
*/
// Route table registration.
$route = array();
$route[Router::_END_POINT_] = $_SERVER['SCRIPT_FILENAME'];
$route[Router::_REWRITE_BASE_] = '/op-unit/_wikipedia/';
$route['mime'] = 'text/html';
Env::Set('route', $route);
// Unit root registration.
Env::Set('unit-root', dirname($_SERVER['APP_ROOT']));
示例3: explode
/**
* op-unit-markdown/index.php
*
* @creation 2015-12-05
* @version 1.0
* @package op-unit-markdown
* @author Tomoaki Nagahara <tomoaki.nagahara@gmail.com>
* @copyright Tomoaki Nagahara All right reserved.
*/
// Do check of include.
if (!class_exists('OnePiece5')) {
require '';
}
// Set route table.
Env::Set('controller-name', 'index,php');
Env::Set('route', Router::GetRoute());
// Init of unit root directory.
if (!($root = Env::Get('unit-root'))) {
$root = explode('/', dirname($_SERVER['SCRIPT_FILENAME']));
$root[count($root) - 1] = null;
$root = join('/', $root);
Env::Set('unit-root', $root);
}
// Instanciate
$op = new OnePiece5();
if (Toolbox::GetRequest('testcase')) {
$op->Template('testcase.php');
} else {
$op->Template('action.php');
}