本文整理汇总了PHP中Application::app方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::app方法的具体用法?PHP Application::app怎么用?PHP Application::app使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::app方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAppInfo
public static function getAppInfo()
{
if (self::$app == NULL) {
self::$app = new Application();
}
return self::$app;
}
示例2: trigger_error
public static function trigger_error($errmsg = '', $errtype = 0)
{
$app = Application::app();
if ($app != null) {
$app->setErrorNo($errtype);
$app->setErrorMsg($errmsg);
}
trigger_error($errmsg, $errtype);
}
示例3: init
/**
* Ініціалізація роутера
*/
public static function init()
{
$requestUrl = explode('/', $_SERVER['REQUEST_URI']);
self::$controller = ucfirst(isset($requestUrl[1]) ? $requestUrl[1] : '');
self::$action = strtolower(isset($requestUrl[2]) ? $requestUrl[2] : '');
self::$id = strtolower(isset($requestUrl[3]) ? $requestUrl[3] : '');
if (!self::$controller) {
self::$controller = Application::app()->getConfig('DefaultController');
}
if (!self::$action) {
self::$action = 'index';
}
self::runController();
}
示例4: set
public static function set($_key, $_default = "")
{
if (empty($_key)) {
return $_default;
}
$subkeys = explode('.', $_key);
$_len = count($subkeys);
if ($_len == 1) {
Application::app()->{$subkeys}[0] = $_default;
} else {
if ($_len <= 2) {
$_tobj = Application::app()->{$subkeys}[0];
if (is_array($_tobj) && isset($_tobj[$subkeys[1]])) {
$_tobj[$subkeys[1]] = $_default;
Application::app()->{$subkeys}[0] = $_tobj;
}
}
}
}
示例5: loginoutAction
/**
* 退出登录
*/
public function loginoutAction()
{
$send['state'] = false;
$params = $this->filterParams($this->_params);
$model = new MobileModel();
$patternArr = Application::app()->getConfig()->application->environment;
$configArr = $patternArr->toArray();
$pattern = $configArr['mode'];
// 移动端已修改用户退出方案,这里不论私有云还是公有云,都只退出当前移动终端上的app
if ($pattern == 'public') {
$res = $model->loginOutPublicCloud($params);
} else {
$res = $model->loginOutPublicCloud($params);
}
if (!$res) {
$send['error'] = 'Loginout failed';
} else {
$send['state'] = true;
$send['data']['message'] = 'success';
}
$this->sendOutput($send);
}
示例6: getApplication
/**
* returns the application
*
* @return Yaf_Application
*/
public function getApplication()
{
return Application::app();
}
示例7: appInit
/**
* Static method to initialise the application
*
* This method is called from {@link index.php} and inititalises the an application of
* the class defined in {@link sys.config.php}. When developing an application with
* RocketSled, you will usually override the Application class of an 'Application
* Level Package'. In order for that class to be used by RocketSled, you need to set
* the required constant in {@link sys.config.php}, and then it will be returned by
* {@link index.php}'s call to Application::appInit().
*
* The Application::appInit() function also calls several functions that setup the
* application, which also give any overriding applications a good chance to do some
* things they may required:
* - {@link Application::systemSetup()}
* - {@link Application::initUser()}
* - {@link Application::siteNavigationInit()}
*
* @return Application - an initialised application class
* @see Session,User,SiteNavigation,NavigationItem,sys.config.php
* @access public
* @static
*/
public static function appInit()
{
Application::initSession();
$app_class = constant('APPLICATION');
self::$app = new $app_class();
$ret = self::$app;
$ret->systemSetup();
$ret->initUser();
$ret->siteNavigationInit();
$ret->setRedirectionListener(Display::current(false));
$ret->fetchRedirectedParameters();
return $ret;
}
示例8: __construct
public function __construct()
{
$this->application = Application::app();
}
示例9: checkController
public static function checkController($_name)
{
self::$_router->strNameSpace = sprintf("\\%s\\%s\\Controller\\%s", Application::app()->src, self::$_router->getAppName(), $_name);
$controller = self::$_router->getControllerNameSpace();
if (is_file(self::$appsPath . sprintf("%s/Controller/%s.php", self::$_router->getAppName(), $_name)) && class_exists(self::$_router->strNameSpace)) {
self::$_router->setController(new $controller());
return true;
}
return false;
}
示例10: isSuperAdmin
/**
* 最小的ID 是Admin
*/
public function isSuperAdmin()
{
if (!$this->isLogin()) {
redirect('index/login');
}
Session::getInstance()->set('redirect', Application::app()->request()->curUrl());
$db = \hmvc\Db\Db::getConnection();
$user = $db->getRow("SELECT MIN( id ) as id FROM `h_admin`");
if ($user['id'] == $this->session->get('auth.id')) {
return true;
}
return false;
}
示例11: urlRef
public function urlRef()
{
$rtn = Application::session()->get('hurlref');
return $rtn ? $rtn : Application::app()->request()->curUrl();
}
示例12: app
public static function app()
{
return Application::app();
}