本文整理匯總了PHP中JApplication::getName方法的典型用法代碼示例。如果您正苦於以下問題:PHP JApplication::getName方法的具體用法?PHP JApplication::getName怎麽用?PHP JApplication::getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JApplication
的用法示例。
在下文中一共展示了JApplication::getName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _actionLoad
/**
* Loads the application.
*/
protected function _actionLoad($context)
{
//already loaded
if ($this->_application instanceof JApplication) {
return;
}
//legacy register error handling
JError::setErrorHandling(E_ERROR, 'callback', array($this, 'exception'));
//register exception handler
set_exception_handler(array($this, 'exception'));
$identifier = clone $this->getIdentifier();
$identifier->name = 'application';
//load the JSite
$this->getService('koowa:loader')->loadIdentifier($identifier);
jimport('joomla.application.component.helper');
//no need to create session when using CLI (command line interface)
$this->_application = JFactory::getApplication($this->_application, array('session' => PHP_SAPI !== 'cli'));
global $mainframe;
$mainframe = $this->_application;
$error_reporting = $this->_application->getCfg('error_reporting');
define('JDEBUG', $this->_application->getCfg('debug'));
//taken from nooku application dispatcher
if ($error_reporting > 0) {
error_reporting($error_reporting);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
}
$this->getService()->set($identifier, $this->_application);
$this->getService()->setAlias('application', $identifier);
//set the session handler to none for
if (PHP_SAPI == 'cli') {
JFactory::getConfig()->setValue('config.session_handler', 'none');
JFactory::getConfig()->setValue('config.cache_handler', 'file');
}
//set the default timezone to UTC
date_default_timezone_set('UTC');
KRequest::root(str_replace('/' . $this->_application->getName(), '', KRequest::base()));
}