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


PHP Application::initialize方法代碼示例

本文整理匯總了PHP中Eccube\Application::initialize方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application::initialize方法的具體用法?PHP Application::initialize怎麽用?PHP Application::initialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Eccube\Application的用法示例。


在下文中一共展示了Application::initialize方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     $this->app = new \Eccube\Application(array('env' => 'test'));
     $this->app->initialize();
     $this->app->boot();
     // CSRF tokenを無効にしてFormを作成
     $this->form = $this->app['form.factory']->createBuilder('form', null, array('csrf_protection' => false))->add('tel', 'tel')->getForm();
 }
開發者ID:noadless,項目名稱:ec-cube,代碼行數:9,代碼來源:TelTypeTest.php

示例2: createApplication

 /**
  * {@inheritdoc}
  */
 public function createApplication()
 {
     $app = new Application();
     $app->initialize();
     $app['session.test'] = true;
     $app['exception_handler']->disable();
     $app->boot();
     return $app;
 }
開發者ID:hiroyasu55,項目名稱:ec-cube,代碼行數:12,代碼來源:AbstractRepositoryTestCase.php

示例3: __construct

 public function __construct(\Eccube\Application $app, $name = null)
 {
     parent::__construct($name);
     $app['debug'] = true;
     $app->initialize();
     // executeでdump($app)を使いたいので.
     $dumper = new \Sorien\Provider\PimpleDumpProvider();
     $app->register($dumper, array('dumper' => $dumper));
     $app->boot();
     $this->app = $app;
 }
開發者ID:nanasess,項目名稱:nagoya-eccube-study,代碼行數:11,代碼來源:PhpStormCommand.php

示例4: createApplication

 /**
  * {@inheritdoc}
  */
 public function createApplication()
 {
     $app = new Application();
     $app->initialize();
     $app->initPluginEventDispatcher();
     $app['session.test'] = true;
     $app['exception_handler']->disable();
     $app['form.csrf_provider'] = $app->share(function () {
         return new CsrfTokenMock();
     });
     $app->boot();
     return $app;
 }
開發者ID:nahaichuan,項目名稱:ec-cube,代碼行數:16,代碼來源:AbstractWebTestCase.php

示例5: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     // TODO Abstract にしたい.
     $app = new Application();
     $app['debug'] = true;
     $app->initialize();
     $app->initPluginEventDispatcher();
     $app['session.test'] = true;
     $app['exception_handler']->disable();
     $app->boot();
     $softDeleteFilter = $app['orm.em']->getFilters()->getFilter('soft_delete');
     $softDeleteFilter->setExcludes(array('Eccube\\Entity\\ProductClass'));
     // soft_delete filter を有効にする
     $config = $app['orm.em']->getConfiguration();
     $config->addFilter("soft_delete", '\\Eccube\\Doctrine\\Filter\\SoftDeleteFilter');
     $app['orm.em']->getFilters()->enable('soft_delete');
     self::$app = $app;
 }
開發者ID:nanasess,項目名稱:nagoya-eccube-study,代碼行數:18,代碼來源:EntityUtilTest.php

示例6: testInstallPluginWithConst

 public function testInstallPluginWithConst()
 {
     #self::markTestSkipped();
     // インストールするプラグインを作成する
     $tmpname = "dummy" . sha1(mt_rand());
     $config = array();
     $config['name'] = $tmpname . "_name";
     $config['code'] = $tmpname;
     $config['version'] = $tmpname . "_version";
     $config['const']['A'] = 'A';
     $config['const']['C'] = 1;
     $tmpdir = $this->createTempDir();
     $tmpfile = $tmpdir . '/plugin.tar';
     $tar = new \PharData($tmpfile);
     $tar->addFromString('config.yml', Yaml::dump($config));
     $service = $this->app['eccube.service.plugin'];
     // インストールできるか
     $this->assertTrue($service->install($tmpfile));
     $this->assertTrue((bool) ($plugin = $this->app['eccube.repository.plugin']->findOneBy(array('code' => $tmpname))));
     // インストール後disable狀態でもconstがロードされているか
     $app = new Application();
     $app->initialize();
     $app->initializePlugin();
     $app->boot();
     $this->assertEquals('A', $app['config'][$tmpname]['const']['A']);
     $this->assertEquals('1', $app['config'][$tmpname]['const']['C']);
     // アンインストールできるか
     $this->assertTrue($service->uninstall($plugin));
 }
開發者ID:nanasess,項目名稱:nagoya-eccube-study,代碼行數:29,代碼來源:PluginServiceTest.php


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