本文整理汇总了PHP中Mage_Core_Model_App::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_App::run方法的具体用法?PHP Mage_Core_Model_App::run怎么用?PHP Mage_Core_Model_App::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_App
的用法示例。
在下文中一共展示了Mage_Core_Model_App::run方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRun
/**
* @magentoAppIsolation enabled
*/
public function testRun()
{
if (!Magento_Test_Bootstrap::canTestHeaders()) {
$this->markTestSkipped('Can\'t test application run without sending headers');
}
$_SERVER['HTTP_HOST'] = 'localhost';
$this->_mageModel->getRequest()->setRequestUri('core/index/index');
$this->_mageModel->run(array());
$this->assertTrue($this->_mageModel->getRequest()->isDispatched());
}
示例2: run
/**
* Front end main entry point
*
* @param string $code
* @param string $type
* @param string|array $options
*/
public static function run($code = '', $type = 'store', $options = array())
{
try {
Magento_Profiler::start('mage');
self::setRoot();
if (isset($options['edition'])) {
self::$_currentEdition = $options['edition'];
}
self::$_app = new Mage_Core_Model_App();
if (isset($options['request'])) {
self::$_app->setRequest($options['request']);
}
if (isset($options['response'])) {
self::$_app->setResponse($options['response']);
}
self::$_events = new Varien_Event_Collection();
self::_setIsInstalled($options);
self::_setConfigModel($options);
self::$_app->run(array('scope_code' => $code, 'scope_type' => $type, 'options' => $options));
Magento_Profiler::stop('mage');
} catch (Mage_Core_Model_Session_Exception $e) {
header('Location: ' . self::getBaseUrl());
} catch (Mage_Core_Model_Store_Exception $e) {
require_once self::getBaseDir() . '/pub/errors/404.php';
} catch (Exception $e) {
self::printException($e);
}
}
示例3: run
/**
* Front end main entry point
*
* @param string $code
* @param string $type
* @param string|array $options
*/
public static function run($code = '', $type = 'store', $options = array())
{
try {
Varien_Profiler::start('mage');
self::setRoot();
self::$_app = new Mage_Core_Model_App();
self::$_events = new Varien_Event_Collection();
self::$_config = new Mage_Core_Model_Config($options);
self::$_app->run(array('scope_code' => $code, 'scope_type' => $type, 'options' => $options));
Varien_Profiler::stop('mage');
} catch (Mage_Core_Model_Session_Exception $e) {
header('Location: ' . self::getBaseUrl());
die;
} catch (Mage_Core_Model_Store_Exception $e) {
require_once self::getBaseDir() . DS . 'errors' . DS . '404.php';
die;
} catch (Exception $e) {
if (self::isInstalled() || self::$_isDownloader) {
self::printException($e);
exit;
}
try {
self::dispatchEvent('mage_run_exception', array('exception' => $e));
if (!headers_sent()) {
header('Location:' . self::getUrl('install'));
} else {
self::printException($e);
}
} catch (Exception $ne) {
self::printException($ne, $e->getMessage());
}
}
}
示例4: run
/**
* Front end main entry point
*
* @param string $code
* @param string $type
* @param string|array $options
*/
public static function run($code = '', $type = 'store', $options = array())
{
try {
Varien_Profiler::start('mage');
self::setRoot();
self::$_app = new Mage_Core_Model_App();
self::$_events = new Varien_Event_Collection();
self::$_config = new Mage_Core_Model_Config();
self::$_app->run(array('scope_code' => $code, 'scope_type' => $type, 'options' => $options));
Varien_Profiler::stop('mage');
} catch (Mage_Core_Model_Session_Exception $e) {
header('Location: ' . self::getBaseUrl());
die;
} catch (Mage_Core_Model_Store_Exception $e) {
$baseUrl = rtrim(self::getScriptSystemUrl('errors'), '/') . '/errors/404.php';
if (!headers_sent()) {
header('Location: ' . $baseUrl);
} else {
print '<script type="text/javascript">';
print "window.location.href = '{$baseUrl}';";
print '</script>';
}
die;
} catch (Exception $e) {
if (self::isInstalled() || self::$_isDownloader) {
self::printException($e);
exit;
}
try {
self::dispatchEvent('mage_run_exception', array('exception' => $e));
if (!headers_sent()) {
header('Location:' . self::getUrl('install'));
} else {
self::printException($e);
}
} catch (Exception $ne) {
self::printException($ne, $e->getMessage());
}
}
}