本文整理汇总了PHP中Engine_Api::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Engine_Api::getInstance方法的具体用法?PHP Engine_Api::getInstance怎么用?PHP Engine_Api::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine_Api
的用法示例。
在下文中一共展示了Engine_Api::getInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
define('_ENGINE_R_MAIN', false);
define('_ENGINE_R_INIT', true);
}
}
}
}
}
// Boot
if (_ENGINE_R_INIT) {
// Application
require_once 'Engine/Loader.php';
require_once 'Engine/Application.php';
Engine_Loader::getInstance()->register('Zend', APPLICATION_PATH_COR . DS . 'libraries' . DS . 'Zend')->register('Engine', APPLICATION_PATH_COR . DS . 'libraries' . DS . 'Engine')->register('Facebook', APPLICATION_PATH_COR . DS . 'libraries' . DS . 'Facebook')->register('Plugin', APPLICATION_PATH_COR . DS . 'plugins')->register('Widget', APPLICATION_PATH_COR . DS . 'widgets');
// Create application, bootstrap, and run
$application = new Engine_Application(APPLICATION_ENV, array('bootstrap' => array('path' => APPLICATION_PATH_COR . DS . 'modules' . DS . APPLICATION_NAME . DS . 'Bootstrap.php', 'class' => ucfirst(APPLICATION_NAME) . '_Bootstrap')));
Engine_Api::getInstance()->setApplication($application);
}
// config mode
if (defined('_ENGINE_R_CONF') && _ENGINE_R_CONF) {
return;
}
if (!empty($_SERVER['_ENGINE_TRACE_ALLOW']) && extension_loaded('xdebug')) {
xdebug_start_trace();
}
// Sub apps
if (_ENGINE_R_MAIN) {
require dirname(__FILE__) . DS . _ENGINE_R_MAIN;
exit;
} else {
if (APPLICATION_ENV !== 'development') {
try {
示例2: ini_set
ini_set('display_startup_errors', 0);
ini_set('error_reporting', E_STRICT);
}
define('_ENGINE_CUR_PATH', dirname(__FILE__));
defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__))))))));
// Config
if (!defined('_ENGINE_R_MAIN')) {
define('_ENGINE_R_REWRITE', true);
define('_ENGINE_R_CONF', true);
define('_ENGINE_R_INIT', true);
$indexFile = APPLICATION_PATH . '/application/index.php';
//exit($indexFile);
include_once $indexFile;
}
// Create application, bootstrap, and run
$application = Engine_Api::getInstance()->getApplication();
//$application = Engine_Api::getInstance()->getApplication();
$application->getBootstrap()->bootstrap('frontcontroller');
$application->getBootstrap()->bootstrap('cache');
$application->getBootstrap()->bootstrap('db');
$application->getBootstrap()->bootstrap('translate');
$application->getBootstrap()->bootstrap('frontcontrollermodules');
$application->getBootstrap()->bootstrap('session');
$application->getBootstrap()->bootstrap('manifest');
$application->getBootstrap()->bootstrap('router');
$application->getBootstrap()->bootstrap('view');
$application->getBootstrap()->bootstrap('layout');
$application->getBootstrap()->bootstrap('modules');
function getLog($filename = 'store.notify.log')
{
$writer = new Zend_Log_Writer_Stream(APPLICATION_PATH . '/temporary/log/' . $filename);
示例3: _before
public function _before(\Codeception\TestCase $test)
{
// Create application, bootstrap, and run
$this->bootstrap = new \Engine_Application(array('environment' => APPLICATION_ENV, 'bootstrap' => array('path' => APPLICATION_PATH_COR . DS . 'modules' . DS . APPLICATION_NAME . DS . 'Bootstrap.php', 'class' => ucfirst(APPLICATION_NAME) . '_Bootstrap'), 'autoloaderNamespaces' => array('Zend' => APPLICATION_PATH_LIB . DS . 'Zend', 'Engine' => APPLICATION_PATH_LIB . DS . 'Engine', 'Facebook' => APPLICATION_PATH_LIB . DS . 'Facebook', 'Bootstrap' => APPLICATION_PATH_BTS, 'Plugin' => APPLICATION_PATH_PLU, 'Widget' => APPLICATION_PATH_WID)));
\Zend_Session::$_unitTestEnabled = true;
\Engine_Application::setInstance($this->bootstrap);
\Engine_Api::getInstance()->setApplication($this->bootstrap);
$this->bootstrap->bootstrap();
$this->client->setBootstrap($this->bootstrap);
}