當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Application::bootstrap方法代碼示例

本文整理匯總了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'];
 }
開發者ID:rukzuk,項目名稱:rukzuk,代碼行數:10,代碼來源:ControllerTestCase.php

示例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();
     }
 }
開發者ID:BatVane,項目名稱:Codeception,代碼行數:12,代碼來源:ZF1.php

示例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();
 }
開發者ID:JernejKorosec,項目名稱:z2d2,代碼行數:7,代碼來源:ModelTestCase.php

示例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'));
 }
開發者ID:grenzr,項目名稱:sfRediskaPlugin,代碼行數:7,代碼來源:Resource.php

示例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'));
 }
開發者ID:utachkin,項目名稱:Rediska,代碼行數:7,代碼來源:Resource.php

示例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();
 }
開發者ID:realejo,項目名稱:library-zf1,代碼行數:10,代碼來源:BaseTestCase.php

示例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();
 }
開發者ID:belapp,項目名稱:opus4-application,代碼行數:14,代碼來源:RequireTest.php

示例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());
 }
開發者ID:r-kovalenko,項目名稱:Rediska,代碼行數:8,代碼來源:ResourceTest.php

示例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);
 }
開發者ID:r-kovalenko,項目名稱:Rediska,代碼行數:8,代碼來源:ResourceTest.php

示例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'));
 }
開發者ID:hungtrinh,項目名稱:ProfileManager,代碼行數:8,代碼來源:VietnameseTest.php

示例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);
 }
開發者ID:BatVane,項目名稱:Codeception,代碼行數:10,代碼來源:SocialEngine.php

示例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());
 }
開發者ID:J3FF3,項目名稱:Rediska,代碼行數:10,代碼來源:ResourceTest.php

示例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'));
 }
開發者ID:r-kovalenko,項目名稱:Rediska,代碼行數:11,代碼來源:ResourceTest.php

示例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();
 }
開發者ID:KasaiDot,項目名稱:FansubCMS,代碼行數:12,代碼來源:Bootstrap.php

示例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();
     }
 }
開發者ID:gargallo,項目名稱:tfs-test,代碼行數:13,代碼來源:ZF1.php


注:本文中的Zend_Application::bootstrap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。