本文整理汇总了PHP中Zend_Application::bootstrap方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Application::bootstrap方法的具体用法?PHP Zend_Application::bootstrap怎么用?PHP Zend_Application::bootstrap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Application
的用法示例。
在下文中一共展示了Zend_Application::bootstrap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: qsBootstrap
public function qsBootstrap()
{
$this->application->bootstrap();
$bootstrap = $this->application->getBootstrap();
$frontController = $bootstrap->getResource('FrontController');
$frontController->setParam('bootstrap', $bootstrap);
$configApplication = $this->application->bootstrap('config');
$requestConfig = $configApplication->getOption('request');
$this->requestParameterName = $requestConfig['parameter'];
}
示例2: _before
public function _before(\Codeception\TestCase $test)
{
$this->bootstrap = new \Zend_Application($this->config['env'], getcwd() . DIRECTORY_SEPARATOR . $this->config['config']);
$this->bootstrap->bootstrap();
$this->client->setBootstrap($this->bootstrap);
$db = $this->bootstrap->getBootstrap()->getResource('db');
if ($db instanceof \Zend_Db_Adapter_Abstract) {
$this->db = $db;
$this->db->getProfiler()->setEnabled(true);
$this->db->getProfiler()->clear();
}
}
示例3: setUp
public function setUp()
{
$application = new Zend_Application('testing', APPLICATION_PATH . '/configs/application.ini');
$bootstrap = $application->bootstrap()->getBootstrap();
$this->em = $bootstrap->getResource('entityManager');
parent::setUp();
}
示例4: testBootstrap
public function testBootstrap()
{
$application = new Zend_Application('tests', dirname(__FILE__) . '/application.ini');
$rediska = $application->bootstrap()->getBootstrap()->getResource('rediska');
$this->assertType('Rediska', $rediska);
$this->assertEquals('Rediska_Test_', $rediska->getOption('namespace'));
}
示例5: testBootstrap
public function testBootstrap()
{
$application = new Zend_Application('tests', REDISKA_TESTS_PATH . '/Test/Zend/Application/application.ini');
$rediska = $application->bootstrap()->getBootstrap()->getResource('rediska');
$this->assertType('Rediska', $rediska);
$this->assertEquals('Rediska_Test_', $rediska->getOption('namespace'));
}
示例6: setUpBeforeClass
/**
* Prepares the environment before running ALL tests.
*/
public static function setUpBeforeClass()
{
// Inicializa o ZF
$inifile = getenv('TRAVIS') !== false ? 'application.travis.ini' : 'application.ini';
$bootstrap = new Zend_Application('testing', TEST_ROOT . '/assets/application/configs/' . $inifile);
$bootstrap->bootstrap();
}
示例7: setUp
/**
* Overwrite standard setUp method, no database connection needed. Will
* create a file listing of class files instead.
*
* @return void
*/
public function setUp()
{
require_once 'Zend/Application.php';
set_include_path('../modules' . PATH_SEPARATOR . get_include_path());
// Do test environment initializiation.
$application = new Zend_Application(APPLICATION_ENV, array("config" => array(APPLICATION_PATH . '/application/configs/application.ini', APPLICATION_PATH . '/tests/config.ini')));
$application->bootstrap();
}
示例8: testNewInstance
public function testNewInstance()
{
$application = new Zend_Application('tests', dirname(__FILE__) . '/application4.ini');
$application->bootstrap()->getBootstrap()->getResource('session');
$rediska = Zend_Session::getSaveHandler()->getRediska();
$this->assertEquals('default', $rediska->getOption('name'));
$this->assertEquals(array(), Rediska_Manager::getAll());
}
示例9: testCleanWithNoIdsToClean
public function testCleanWithNoIdsToClean()
{
$application = new Zend_Application('tests', dirname(__FILE__) . '/application5.ini');
/* @var Zend_Cache_Manager $manager */
$manager = $application->bootstrap()->getBootstrap()->getResource('cachemanager');
$actual = $manager->getCache('test')->clean(Zend_Cache::CLEANING_MODE_ALL);
$this->assertFalse($actual);
}
示例10: setUp
protected function setUp()
{
parent::setUp();
$app = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . "/configs/application.ini");
$app->bootstrap('translate');
$this->translate = $app->getBootstrap()->getResource('translate');
$this->translate->setLocale(new Zend_Locale('vi_VN'));
}
示例11: _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);
}
示例12: testNewInstance
public function testNewInstance()
{
$application = new Zend_Application('tests', dirname(__FILE__) . '/application4.ini');
$manager = $application->bootstrap()->getBootstrap()->getResource('cachemanager');
$manager->getCache('test')->save('1', 'test');
$rediska = new Rediska(array('redisVersion' => '2.0', 'addToManager' => false));
$one = $rediska->get('test');
$this->assertEquals('1', $one[0]);
$this->assertEquals(array(), Rediska_Manager::getAll());
}
示例13: testDefaultAndAnother
public function testDefaultAndAnother()
{
$application = new Zend_Application('tests', dirname(__FILE__) . '/application4.ini');
$application->bootstrap()->getBootstrap()->getResource('rediska');
$default = Rediska_Manager::get('default');
$this->assertEquals('defaultInstance', $default->getOption('namespace'));
$another = Rediska_Manager::get('another');
$this->assertEquals('anotherInstance', $another->getOption('namespace'));
$this->assertEquals(2, count(Rediska_Manager::getAll()));
$this->assertEquals($default, Zend_Registry::get('rediska'));
}
示例14: bootstrap
public static function bootstrap()
{
// Define path to application directory
defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
defined('APPLICATION_ENV') || define('APPLICATION_ENV', getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'testing');
!defined('UPLOAD_PATH') ? define('UPLOAD_PATH', realpath(dirname(__FILE__) . '/../public/upload')) : null;
defined('HTTP_PATH') || define('HTTP_PATH', realpath(dirname(__FILE__)) . '/../public');
require_once 'Zend/Application.php';
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
$application->bootstrap();
}
示例15: _before
public function _before(\Codeception\TestCase $test)
{
\Zend_Session::$_unitTestEnabled = true;
$this->bootstrap = new \Zend_Application($this->config['env'], Configuration::projectDir() . $this->config['config']);
$this->bootstrap->bootstrap();
$this->client->setBootstrap($this->bootstrap);
$db = $this->bootstrap->getBootstrap()->getResource('db');
if ($db instanceof \Zend_Db_Adapter_Abstract) {
$this->db = $db;
$this->db->getProfiler()->setEnabled(true);
$this->db->getProfiler()->clear();
}
}