当前位置: 首页>>代码示例>>PHP>>正文


PHP Application::boot方法代码示例

本文整理汇总了PHP中Silex\Application::boot方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::boot方法的具体用法?PHP Application::boot怎么用?PHP Application::boot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Silex\Application的用法示例。


在下文中一共展示了Application::boot方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testBootWithTwig

 public function testBootWithTwig()
 {
     $this->app->register($this->provider);
     $this->app->register(new TwigServiceProvider());
     $this->app->boot();
     $this->assertInstanceOf('CalendR\\Extension\\Twig\\CalendRExtension', $this->app['twig']->getExtension('calendr'));
 }
开发者ID:morloderex,项目名称:CalendR,代码行数:7,代码来源:CalendRServiceProviderTest.php

示例2: testWithLoader

 public function testWithLoader()
 {
     $this->app['env.loader'] = $this->app->protect(function () {
         return $_SERVER;
     });
     $this->app->register(new EnvironmentProvider());
     $this->app->boot();
     $this->assertEquals($_SERVER, $this->app['env']->getVars());
 }
开发者ID:stikmanw,项目名称:rest-event-framework,代码行数:9,代码来源:EnvironmentServiceProviderTest.php

示例3: boot

 /**
  * @return Application
  */
 public function boot()
 {
     if ($this->parameters->isAppClassFilled()) {
         $class = $this->parameters->getAppClass();
         $this->application = new $class(['debug' => $this->parameters->isDebugEnabled(), 'env' => $this->parameters->getEnv()]);
         $this->application->boot();
         return $this->application;
     }
     $this->application = (require $this->parameters->getApp());
     $this->application['debug'] = $this->parameters->isDebugEnabled();
     $this->application['env'] = $this->parameters->getEnv();
     $this->application['session.test'] = $this->parameters->isTestSessionEnabled();
     $this->application->boot();
     return $this->application;
 }
开发者ID:tabbi89,项目名称:Behat-Silex-Extension,代码行数:18,代码来源:ApplicationManager.php

示例4: testRegisteredServices

 /**
  * Ensures the service provider registers the correct services.
  */
 public function testRegisteredServices()
 {
     $firewall = 'http-auth';
     $authenticationListenerServices = ['security.authentication_provider.' . $firewall . '.hmac', 'security.authentication_listener.' . $firewall . '.hmac', 'security.entry_point.' . $firewall . '.hmac', 'pre_auth'];
     $keyLoader = $this->getMock(KeyLoaderInterface::class);
     $app = new Application();
     $app->register(new SecurityServiceProvider());
     $app->register(new HmacSecurityProvider($keyLoader));
     $app['security.firewalls'] = [$firewall => ['pattern' => '^.*$', 'hmac' => true]];
     $app->boot();
     $this->assertArrayHasKey('security.authentication_listener.factory.hmac', $app);
     $this->assertArrayHasKey('security.hmac.response_listener', $app);
     $this->assertArrayHasKey('security.authentication_provider.hmac._proto', $app);
     $this->assertArrayHasKey('security.authentication_listener.hmac._proto', $app);
     $this->assertArrayHasKey('security.entry_point.hmac._proto', $app);
     $this->assertInstanceOf(HmacResponseListener::class, $app['security.hmac.response_listener']);
     $factoryResponse = $app['security.authentication_listener.factory.hmac']($firewall, []);
     $this->assertEquals($authenticationListenerServices, $factoryResponse);
     $this->assertArrayHasKey('security.authentication_provider.' . $firewall . '.hmac', $app);
     $this->assertInstanceOf(HmacAuthenticationProvider::class, $app['security.authentication_provider.' . $firewall . '.hmac']);
     $this->assertArrayHasKey('security.authentication_listener.' . $firewall . '.hmac', $app);
     $this->assertInstanceOf(HmacAuthenticationListener::class, $app['security.authentication_listener.' . $firewall . '.hmac']);
     $this->assertArrayHasKey('security.entry_point.' . $firewall . '.hmac', $app);
     $this->assertInstanceOf(HmacAuthenticationEntryPoint::class, $app['security.entry_point.' . $firewall . '.hmac']);
 }
开发者ID:acquia,项目名称:http-hmac-php,代码行数:28,代码来源:HmacSecurityProviderTest.php

示例5: testSettingOfDependencyInjectionControllerResolver

 /**
  * @covers Fudge\SilexComponents\DependencyInjection\DependencyInjectionServiceProvider::register
  * @covers Fudge\SilexComponents\DependencyInjection\DependencyInjectionServiceProvider::boot
  */
 public function testSettingOfDependencyInjectionControllerResolver()
 {
     $app = new Application();
     $app->register(new DependencyInjectionServiceProvider());
     $app->boot();
     $this->assertInstanceOf(__NAMESPACE__ . "\\ControllerResolver", $app['resolver']);
 }
开发者ID:BennyC,项目名称:silex-dependency-injection,代码行数:11,代码来源:DependencyInjectionServiceProviderTest.php

示例6: testGaufretteCache

 public function testGaufretteCache()
 {
     $app = new Application();
     $app->register(new GaufretteServiceProvider(), array('gaufrette.adapter.class' => 'InMemory', 'gaufrette.adapter.cache.class' => 'Local', 'gaufrette.cache.options' => array(__DIR__ . '/cache')));
     $app->boot();
     $this->assertInstanceOf('\\Gaufrette\\Adapter\\Cache', $app['gaufrette.cache']);
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:7,代码来源:GaufretteServiceProviderTest.php

示例7: getApplication

 /**
  * Returns an initialized Silex application with a registered instance
  * of PBKDF2ServiceProvider.
  *
  * @param Array $providerConfiguration Parameters for the provider configuration.
  * @return Application
  */
 protected function getApplication(array $providerConfiguration = array())
 {
     $app = new Application();
     $app->register(new PBKDF2(), $providerConfiguration);
     $app->boot();
     return $app;
 }
开发者ID:nrk,项目名称:PBKDF2ServiceProvider,代码行数:14,代码来源:PBKDF2ServiceProvider.php

示例8: testItAddsRequestTrustedProxiesSubscriberOnBoot

 public function testItAddsRequestTrustedProxiesSubscriberOnBoot()
 {
     $app = new Application();
     $app['root.path'] = __DIR__ . '/../../../../../..';
     $app->register(new ConfigurationServiceProvider());
     $app['phraseanet.configuration.config-path'] = __DIR__ . '/fixtures/config-proxies.yml';
     $app['phraseanet.configuration.config-compiled-path'] = __DIR__ . '/fixtures/config-proxies.php';
     $app->boot();
     /** @var EventDispatcherInterface $dispatcher */
     $dispatcher = $app['dispatcher'];
     $listener = null;
     $method = null;
     foreach ($dispatcher->getListeners(KernelEvents::REQUEST) as $callable) {
         // Only look for TrustedProxySubscriber instances
         if (!is_array($callable)) {
             continue;
         }
         list($listener, $method) = $callable;
         if ($listener instanceof TrustedProxySubscriber) {
             break;
         }
     }
     $this->assertInstanceOf('Alchemy\\Phrasea\\Core\\Event\\Subscriber\\TrustedProxySubscriber', $listener, 'TrustedProxySubscriber was not properly registered');
     $this->assertEquals('setProxyConf', $method);
     $this->assertSame([], Request::getTrustedProxies());
     $listener->setProxyConf();
     $this->assertSame(['127.0.0.1', '66.6.66.6'], Request::getTrustedProxies());
     unlink($app['phraseanet.configuration.config-compiled-path']);
 }
开发者ID:luisbrito,项目名称:Phraseanet,代码行数:29,代码来源:ConfigurationServiceProviderTest.php

示例9: __construct

 public function __construct(SilexApplication $application, $projectDirectory, $name = 'UNKNOWN', $version = 'UNKNOWN')
 {
     parent::__construct($name, $version);
     $this->silexApplication = $application;
     $this->projectDirectory = $projectDirectory;
     $application->boot();
 }
开发者ID:ygeneration666,项目名称:ec,代码行数:7,代码来源:Application.php

示例10: testRegisterServiceProvidersWithRegisterWithValidValueAndParametersWithTypeError

 /**
  * @expectedException \InvalidArgumentException
  */
 public function testRegisterServiceProvidersWithRegisterWithValidValueAndParametersWithTypeError()
 {
     $app = new Application();
     $app['cekurte.manager.providers'] = ['Silex\\Provider\\HttpFragmentServiceProvider' => ['register' => true, 'type' => 'invalid-value']];
     $app->register(new ManagerServiceProvider());
     $app->boot();
 }
开发者ID:jpcercal,项目名称:silex-manager-provider,代码行数:10,代码来源:ManagerServiceProviderTest.php

示例11: boot

 public function boot()
 {
     $booted = $this->booted;
     if (!$booted) {
         foreach ($this->providers as $provider) {
             // handle pack's options
             $this->registerOptionnablePack($provider);
             // handle pack's commands
             // must be done before the orm provider register()
             $this->registerConsolablePack($provider);
             // handle pack's assets for assetic
             $this->registerAssetablePack($provider);
         }
         // find pack's translations
         $this->registerTranslatablePacks();
         // handle pack's entities
         // must be done before the console boot()
         $this->registerEntitablePacks();
     }
     parent::boot();
     if (!$booted) {
         foreach ($this->providers as $provider) {
             // handle twig pack
             $this->registerTwiggablePack($provider);
             // add namespace to assetic
             $this->postBootRegisterAssetablePack($provider);
             // connect pack
             $this->registerMountablePack($provider);
         }
         // handle twig template override
         $this->addPackOverridingTemplatePathToTwig();
     }
 }
开发者ID:quazardous,项目名称:silex-pack,代码行数:33,代码来源:PackableApplication.php

示例12: createApplication

 public function createApplication()
 {
     $app = new Application(['env' => 'test']);
     require __DIR__ . '/../app/AppKernel.php';
     $app->boot();
     return $app;
 }
开发者ID:miguelbemartin,项目名称:oauth2-php,代码行数:7,代码来源:WebTestCase.php

示例13: boot

 /**
  * Load configuration and boot the applications
  *
  * {@inheritdoc}
  */
 public function boot()
 {
     $this->initializeConfig();
     foreach ($this->apps as $app) {
         $app->boot($this);
     }
     parent::boot();
 }
开发者ID:sergiors,项目名称:lullaby,代码行数:13,代码来源:Kernel.php

示例14: testCoverBoot

 public function testCoverBoot()
 {
     $app = new Application();
     $app['monolog.logfile'] = false;
     $app->register(new MonologServiceProvider());
     $app->register(new ExtendedLoggerServiceProvider());
     $app->boot();
 }
开发者ID:aptoma,项目名称:silex-extras,代码行数:8,代码来源:ExtendedLoggerServiceProviderTest.php

示例15: testConfiguredApplicationWithTwigExtensionDisabled

 public function testConfiguredApplicationWithTwigExtensionDisabled()
 {
     $app = new Application();
     $app->register(new TwigServiceProvider());
     $app->register(new PuliServiceProvider(), array('puli.enable_twig' => false));
     $app->boot();
     $this->assertFalse($app['twig']->hasExtension('puli'));
     $this->assertNotInstanceOf('Puli\\TwigExtension\\PuliTemplateLoader', $app['twig.loader']);
 }
开发者ID:tgalopin,项目名称:silex-provider,代码行数:9,代码来源:PuliServiceProviderTest.php


注:本文中的Silex\Application::boot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。