Пример #1
0
$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.
<?php

/**
 * op-unit-wikipedia/bootstrap.php
 * 
 * @creation  2015-12-10
 * @version   1.0
 * @package   op-unit-wikipedia
 * @author    Tomoaki Nagahara <*****@*****.**>
 * @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
0
/**
 * op-unit-markdown/index.php
 *
 * @creation  2015-12-05
 * @version   1.0
 * @package   op-unit-markdown
 * @author    Tomoaki Nagahara <*****@*****.**>
 * @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');
}