本文整理汇总了PHP中URI::isManager方法的典型用法代码示例。如果您正苦于以下问题:PHP URI::isManager方法的具体用法?PHP URI::isManager怎么用?PHP URI::isManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URI
的用法示例。
在下文中一共展示了URI::isManager方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
public static function load($group, $save = true)
{
$paths = array();
$paths[] = J_PATH . "config" . DS . $group . EXT;
$paths[] = J_PATH . "config" . DS . strtolower(Request::env()) . DS . $group . EXT;
if (URI::isManager()) {
$paths[] = J_MANAGERPATH . DS . "config" . DS . $group . EXT;
$paths[] = J_MANAGERPATH . DS . "config" . DS . strtolower(Request::env()) . DS . $group . EXT;
} else {
$paths[] = J_APPPATH . "config" . DS . $group . EXT;
$paths[] = J_APPPATH . "config" . DS . strtolower(Request::env()) . DS . $group . EXT;
}
$items = array();
foreach ($paths as $path) {
if (file_exists($path)) {
$result = (require $path);
if (is_array($result)) {
$items = array_merge($items, $result);
}
}
}
if (count($items) > 0) {
if ($save) {
static::$items[$group] = $items;
}
return $items;
}
}
示例2: root
/**
* Returns the root URL of the project. If addManager = false, don't append 'manager/' if we are calling this function from a manager route.
* @param boolean $addManager
* @return string
*/
public static function root($addManager = true)
{
$root = Request::rootURL();
if ($addManager && URI::isManager()) {
$root .= "manager/";
}
return $root;
}
示例3: current
public static function current()
{
if (!is_null(self::$uri)) {
return self::$uri;
}
$uri = trim(Request::pathInfo(), "/");
$uri = $uri ? $uri : "/";
self::$uri = $uri;
$segments = array_diff(explode("/", trim($uri, "/")), array(""));
if (array_get($segments, 0) == "manager") {
self::$isManager = true;
array_shift($segments);
}
self::$segments = $segments;
return $uri;
}
示例4: implode
$allowed = true;
break;
}
}
if (!$allowed || count($pieces) == 0) {
return Response::code(403);
}
$path = implode(DS, $pieces);
if (!File::exists(J_PATH . $path) || is_dir(J_PATH . $path)) {
return Response::code(404);
}
$im = new Image(J_PATH . $path);
$im->resize((int) Request::get("width"), (int) Request::get("height"), Request::get("method", "fit"), Request::get("background", 0xffffff));
$im->header();
});
Router::register("*", "(:all)", function () {
Response::code(404);
if (Request::isLocal()) {
echo "URI: " . URI::full() . "<br>\n";
echo "Path Info: " . Request::pathInfo() . "\n";
}
return;
});
if (URI::isManager()) {
Structure::routes();
}
Request::$route = Router::route(Request::method(), URI::current());
Event::fire(J_EVENT_RESPONSE_START);
echo Request::$route->call();
Event::fire(J_EVENT_RESPONSE_END);
//echo "<br><br>" . round(elapsed_time() * 1000000) / 1000 . "ms";