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


PHP Core\Bootstrap类代码示例

本文整理汇总了PHP中TYPO3\Flow\Core\Bootstrap的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap类的具体用法?PHP Bootstrap怎么用?PHP Bootstrap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: setUp

 /**
  * Sets up this test case
  *
  */
 protected function setUp()
 {
     ComposerUtility::flushCaches();
     vfsStream::setup('Test');
     $this->mockBootstrap = $this->getMockBuilder(Bootstrap::class)->disableOriginalConstructor()->getMock();
     $this->mockBootstrap->expects($this->any())->method('getSignalSlotDispatcher')->will($this->returnValue($this->createMock(\TYPO3\Flow\SignalSlot\Dispatcher::class)));
     $this->mockApplicationContext = $this->getMockBuilder(ApplicationContext::class)->disableOriginalConstructor()->getMock();
     $this->mockBootstrap->expects($this->any())->method('getContext')->will($this->returnValue($this->mockApplicationContext));
     $mockObjectManager = $this->createMock(\TYPO3\Flow\Object\ObjectManagerInterface::class);
     $this->mockBootstrap->expects($this->any())->method('getObjectManager')->will($this->returnValue($mockObjectManager));
     $mockReflectionService = $this->createMock(\TYPO3\Flow\Reflection\ReflectionService::class);
     $mockReflectionService->expects($this->any())->method('getClassNameByObject')->will($this->returnCallback(function ($object) {
         if ($object instanceof \Doctrine\ORM\Proxy\Proxy) {
             return get_parent_class($object);
         }
         return get_class($object);
     }));
     $mockObjectManager->expects($this->any())->method('get')->with(\TYPO3\Flow\Reflection\ReflectionService::class)->will($this->returnValue($mockReflectionService));
     mkdir('vfs://Test/Packages/Application', 0700, true);
     mkdir('vfs://Test/Configuration');
     $this->packageManager = new PackageManager('vfs://Test/Configuration/PackageStates.php');
     $composerNameToPackageKeyMap = array('typo3/flow' => 'TYPO3.Flow');
     $this->inject($this->packageManager, 'composerNameToPackageKeyMap', $composerNameToPackageKeyMap);
     $this->inject($this->packageManager, 'packagesBasePath', 'vfs://Test/Packages/');
     $this->mockDispatcher = $this->getMockBuilder(Dispatcher::class)->disableOriginalConstructor()->getMock();
     $this->inject($this->packageManager, 'dispatcher', $this->mockDispatcher);
     $this->packageManager->initialize($this->mockBootstrap);
 }
开发者ID:cerlestes,项目名称:flow-development-collection,代码行数:32,代码来源:PackageManagerTest.php

示例2: boot

 /**
  * Invokes custom PHP code directly after the package manager has been initialized.
  *
  * @param Bootstrap $bootstrap The current bootstrap
  * @return void
  */
 public function boot(Bootstrap $bootstrap)
 {
     $dispatcher = $bootstrap->getSignalSlotDispatcher();
     $context = $bootstrap->getContext();
     if (!$context->isProduction()) {
         $dispatcher->connect('TYPO3\\Flow\\Core\\Booting\\Sequence', 'afterInvokeStep', function ($step) use($bootstrap, $dispatcher) {
             if ($step->getIdentifier() === 'typo3.flow:systemfilemonitor') {
                 $typoScriptFileMonitor = \TYPO3\Flow\Monitor\FileMonitor::createFileMonitorAtBoot('TypoScript_Files', $bootstrap);
                 $packageManager = $bootstrap->getEarlyInstance('TYPO3\\Flow\\Package\\PackageManagerInterface');
                 foreach ($packageManager->getActivePackages() as $packageKey => $package) {
                     if ($packageManager->isPackageFrozen($packageKey)) {
                         continue;
                     }
                     $typoScriptPaths = array($package->getResourcesPath() . 'Private/TypoScript', $package->getResourcesPath() . 'Private/TypoScripts');
                     foreach ($typoScriptPaths as $typoScriptPath) {
                         if (is_dir($typoScriptPath)) {
                             $typoScriptFileMonitor->monitorDirectory($typoScriptPath);
                         }
                     }
                 }
                 $typoScriptFileMonitor->detectChanges();
                 $typoScriptFileMonitor->shutdownObject();
             }
             if ($step->getIdentifier() === 'typo3.flow:cachemanagement') {
                 $cacheManager = $bootstrap->getEarlyInstance('TYPO3\\Flow\\Cache\\CacheManager');
                 $listener = new \TYPO3\TypoScript\Core\Cache\FileMonitorListener($cacheManager);
                 $dispatcher->connect('TYPO3\\Flow\\Monitor\\FileMonitor', 'filesHaveChanged', $listener, 'flushContentCacheOnFileChanges');
             }
         });
     }
 }
开发者ID:hlubek,项目名称:neos-development-collection,代码行数:37,代码来源:Package.php

示例3: boot

 /**
  * @param Bootstrap $bootstrap
  */
 public function boot(Bootstrap $bootstrap)
 {
     $dispatcher = $bootstrap->getSignalSlotDispatcher();
     $dispatcher->connect('TYPO3\\Flow\\Configuration\\ConfigurationManager', 'configurationManagerReady', function ($configurationManager) {
         $configurationManager->registerConfigurationType('Sprints');
     });
 }
开发者ID:randomresult,项目名称:WMDB.Forger,代码行数:10,代码来源:Package.php

示例4: boot

 /**
  * @param Bootstrap $bootstrap The current bootstrap
  * @return void
  */
 public function boot(Bootstrap $bootstrap)
 {
     $dispatcher = $bootstrap->getSignalSlotDispatcher();
     $dispatcher->connect('TYPO3\\TYPO3CR\\Domain\\Model\\Node', 'nodeUpdated', 'Nezaniel\\SystemNodes\\Service\\SystemNodeService', 'refreshCacheIfNecessary');
     $dispatcher->connect('TYPO3\\TYPO3CR\\Domain\\Model\\Node', 'nodeAdded', 'Nezaniel\\SystemNodes\\Service\\SystemNodeService', 'refreshCacheIfNecessary');
     $dispatcher->connect('TYPO3\\TYPO3CR\\Domain\\Model\\Node', 'nodeRemoved', 'Nezaniel\\SystemNodes\\Service\\SystemNodeService', 'refreshCacheIfNecessary');
 }
开发者ID:nezaniel,项目名称:systemnodes,代码行数:11,代码来源:Package.php

示例5: boot

 /**
  * Boot the package. We wire some signals to slots here.
  *
  * @param \TYPO3\Flow\Core\Bootstrap $bootstrap The current bootstrap
  * @return void
  */
 public function boot(\TYPO3\Flow\Core\Bootstrap $bootstrap)
 {
     $dispatcher = $bootstrap->getSignalSlotDispatcher();
     $dispatcher->connect('Lightwerk\\SurfCaptain\\GitApi\\ApiRequest', 'apiCall', 'Lightwerk\\SurfCaptain\\GitApi\\RequestListener', 'saveApiCall');
     $dispatcher->connect('Lightwerk\\SurfCaptain\\GitApi\\ApiRequest', 'apiCall', 'Lightwerk\\SurfCaptain\\GitApi\\RequestListener', 'logApiCall');
     $dispatcher->connect('Lightwerk\\SurfCaptain\\GitApi\\ApiRequest', 'beforeApiCall', 'Lightwerk\\SurfCaptain\\GitApi\\RequestListener', 'logBeforeApiCall');
 }
开发者ID:lightwerk,项目名称:surfcaptain,代码行数:13,代码来源:Package.php

示例6: isCompileTimeCommandControllerChecksIfTheGivenCommandIdentifierRefersToACompileTimeController

 /**
  * @test
  * @dataProvider commandIdentifiersAndCompiletimeControllerInfo
  */
 public function isCompileTimeCommandControllerChecksIfTheGivenCommandIdentifierRefersToACompileTimeController($compiletimeCommandControllerIdentifiers, $givenCommandIdentifier, $expectedResult)
 {
     $bootstrap = new Bootstrap('Testing');
     foreach ($compiletimeCommandControllerIdentifiers as $compiletimeCommandControllerIdentifier) {
         $bootstrap->registerCompiletimeCommand($compiletimeCommandControllerIdentifier);
     }
     $this->assertSame($expectedResult, $bootstrap->isCompiletimeCommand($givenCommandIdentifier));
 }
开发者ID:nlx-sascha,项目名称:flow-development-collection,代码行数:12,代码来源:BootstrapTest.php

示例7: registerExtractionSlot

 /**
  * Registers slots for signals in order to be able to index nodes
  *
  * @param Bootstrap $bootstrap
  */
 public function registerExtractionSlot(Bootstrap $bootstrap)
 {
     $configurationManager = $bootstrap->getObjectManager()->get(ConfigurationManager::class);
     $settings = $configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, $this->getPackageKey());
     if (isset($settings['realtimeExtraction']['enabled']) && $settings['realtimeExtraction']['enabled'] === TRUE) {
         $dispatcher = $bootstrap->getSignalSlotDispatcher();
         $dispatcher->connect(Asset::class, 'assetCreated', ExtractionManager::class, 'extractMetaData');
     }
 }
开发者ID:neos,项目名称:metadata-extractor,代码行数:14,代码来源:Package.php

示例8: prepareRealtimeIndexing

 /**
  * @param \TYPO3\Flow\Core\Bootstrap $bootstrap
  */
 public function prepareRealtimeIndexing(\TYPO3\Flow\Core\Bootstrap $bootstrap)
 {
     $this->configurationManager = $bootstrap->getObjectManager()->get('TYPO3\\Flow\\Configuration\\ConfigurationManager');
     $settings = $this->configurationManager->getConfiguration(\TYPO3\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, $this->getPackageKey());
     if (isset($settings['realtimeIndexing']['enabled']) && $settings['realtimeIndexing']['enabled'] === TRUE) {
         $bootstrap->getSignalSlotDispatcher()->connect('Flowpack\\ElasticSearch\\Indexer\\Object\\Signal\\SignalEmitter', 'objectUpdated', 'Flowpack\\ElasticSearch\\Indexer\\Object\\ObjectIndexer', 'indexObject');
         $bootstrap->getSignalSlotDispatcher()->connect('Flowpack\\ElasticSearch\\Indexer\\Object\\Signal\\SignalEmitter', 'objectPersisted', 'Flowpack\\ElasticSearch\\Indexer\\Object\\ObjectIndexer', 'indexObject');
         $bootstrap->getSignalSlotDispatcher()->connect('Flowpack\\ElasticSearch\\Indexer\\Object\\Signal\\SignalEmitter', 'objectRemoved', 'Flowpack\\ElasticSearch\\Indexer\\Object\\ObjectIndexer', 'removeObject');
     }
 }
开发者ID:johannessteu,项目名称:Flowpack.ElasticSearch,代码行数:13,代码来源:Package.php

示例9: boot

 /**
  * Invokes custom PHP code directly after the package manager has been
  * initialized.
  *
  * @param Bootstrap $bootstrap The current bootstrap
  * @return void
  */
 public function boot(Bootstrap $bootstrap)
 {
     $dispatcher = $bootstrap->getSignalSlotDispatcher();
     // HitChat Notifier
     $dispatcher->connect('Lightwerk\\SurfRunner\\Service\\DeploymentService', 'deploymentStarted', 'Lightwerk\\SurfRunner\\Notification\\HitChatNotifier', 'deploymentStarted');
     $dispatcher->connect('Lightwerk\\SurfRunner\\Service\\DeploymentService', 'deploymentFinished', 'Lightwerk\\SurfRunner\\Notification\\HitChatNotifier', 'deploymentFinished');
     // Email Notifier
     $dispatcher->connect('Lightwerk\\SurfRunner\\Service\\DeploymentService', 'deploymentStarted', 'Lightwerk\\SurfRunner\\Notification\\EmailNotifier', 'deploymentStarted');
     $dispatcher->connect('Lightwerk\\SurfRunner\\Service\\DeploymentService', 'deploymentFinished', 'Lightwerk\\SurfRunner\\Notification\\EmailNotifier', 'deploymentFinished');
 }
开发者ID:lightwerk,项目名称:surfrunner,代码行数:17,代码来源:Package.php

示例10: boot

 /**
  * @param \TYPO3\Flow\Core\Bootstrap $bootstrap The current bootstrap
  * @return void
  */
 public function boot(\TYPO3\Flow\Core\Bootstrap $bootstrap)
 {
     $dispatcher = $bootstrap->getSignalSlotDispatcher();
     $dispatcher->connect('TYPO3\\Flow\\Mvc\\Dispatcher', 'afterControllerInvocation', function ($request) use($bootstrap) {
         if (!$request instanceof \TYPO3\Flow\Mvc\ActionRequest || $request->getHttpRequest()->isMethodSafe() !== TRUE) {
             $bootstrap->getObjectManager()->get('Radmiraal\\CouchDB\\CouchDBHelper')->flush();
         }
     });
     $dispatcher->connect('TYPO3\\Flow\\Cli\\SlaveRequestHandler', 'dispatchedCommandLineSlaveRequest', 'Radmiraal\\CouchDB\\CouchDBHelper', 'flush');
 }
开发者ID:rfyio,项目名称:Radmiraal.CouchDB,代码行数:14,代码来源:Package.php

示例11: boot

 /**
  * Invokes custom PHP code directly after the package manager has been initialized.
  *
  * @param \TYPO3\Flow\Core\Bootstrap $bootstrap The current bootstrap
  * @return void
  */
 public function boot(\TYPO3\Flow\Core\Bootstrap $bootstrap)
 {
     $dispatcher = $bootstrap->getSignalSlotDispatcher();
     $dispatcher->connect('TYPO3\\Flow\\Persistence\\Doctrine\\PersistenceManager', 'allObjectsPersisted', 'TYPO3\\TYPO3CR\\Domain\\Repository\\NodeDataRepository', 'flushNodeRegistry');
     $dispatcher->connect('TYPO3\\TYPO3CR\\Domain\\Repository\\NodeDataRepository', 'repositoryObjectsPersisted', 'TYPO3\\TYPO3CR\\Domain\\Repository\\NodeDataRepository', 'flushNodeRegistry');
     $dispatcher->connect('TYPO3\\TYPO3CR\\Domain\\Model\\NodeData', 'nodePathChanged', 'TYPO3\\Flow\\Mvc\\Routing\\RouterCachingService', 'flushCaches');
     $dispatcher->connect('TYPO3\\Flow\\Configuration\\ConfigurationManager', 'configurationManagerReady', function ($configurationManager) {
         $configurationManager->registerConfigurationType('NodeTypes', \TYPO3\Flow\Configuration\ConfigurationManager::CONFIGURATION_PROCESSING_TYPE_DEFAULT);
     });
 }
开发者ID:radmiraal,项目名称:TYPO3.TYPO3CR,代码行数:16,代码来源:Package.php

示例12: boot

 /**
  * Invokes custom PHP code directly after the package manager has been initialized.
  *
  * @param Bootstrap $bootstrap The current bootstrap
  * @return void
  */
 public function boot(Bootstrap $bootstrap)
 {
     $dispatcher = $bootstrap->getSignalSlotDispatcher();
     # Command Auditing
     $dispatcher->connect('Flow2Lab\\EventSourcing\\Command\\Bus\\InternalCommandBus', 'commandHandlingSuccess', 'Flow2Lab\\EventSourcing\\Auditing\\CommandLogger', 'onCommandHandlingSuccess');
     $dispatcher->connect('Flow2Lab\\EventSourcing\\Command\\Bus\\InternalCommandBus', 'commandHandlingFailure', 'Flow2Lab\\EventSourcing\\Auditing\\CommandLogger', 'onCommandHandlingFailure');
     # Event Auditing
     $dispatcher->connect('Flow2Lab\\EventSourcing\\Event\\Bus\\InternalEventBus', 'eventHandlingSuccess', 'Flow2Lab\\EventSourcing\\Auditing\\EventLogger', 'onEventHandlingSuccess');
     $dispatcher->connect('Flow2Lab\\EventSourcing\\Event\\Bus\\InternalEventBus', 'eventHandlingFailure', 'Flow2Lab\\EventSourcing\\Auditing\\EventLogger', 'onEventHandlingFailure');
     $dispatcher->connect('Flow2Lab\\EventSourcing\\Event\\Bus\\InternalEventBus', 'eventQueueingSuccess', 'Flow2Lab\\EventSourcing\\Auditing\\EventLogger', 'onEventQueueingSuccess');
 }
开发者ID:flow2lab,项目名称:eventsourcing,代码行数:17,代码来源:Package.php

示例13: boot

 /**
  * @param Bootstrap $bootstrap The current bootstrap
  * @return void
  */
 public function boot(Bootstrap $bootstrap)
 {
     $dispatcher = $bootstrap->getSignalSlotDispatcher();
     $dispatcher->connect('TYPO3\\Flow\\Core\\Booting\\Sequence', 'afterInvokeStep', function ($step) use($bootstrap) {
         if ($step instanceof \TYPO3\Flow\Core\Booting\Step && $step->getIdentifier() == 'typo3.flow:persistence') {
             /** @var \Doctrine\Common\Persistence\ObjectManager $entityManager */
             $entityManager = $bootstrap->getObjectManager()->get(\Doctrine\Common\Persistence\ObjectManager::class);
             $entityManager->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
         }
     });
 }
开发者ID:HofUniversityIWS,项目名称:backend,代码行数:15,代码来源:Package.php

示例14: setUp

 public function setUp()
 {
     $this->fileSystemTarget = new FileSystemTarget('test');
     $this->mockBootstrap = $this->getMockBuilder(Bootstrap::class)->disableOriginalConstructor()->getMock();
     $this->mockRequestHandler = $this->getMockBuilder(HttpRequestHandlerInterface::class)->getMock();
     $this->mockHttpRequest = $this->getMockBuilder(Request::class)->disableOriginalConstructor()->getMock();
     $this->mockHttpRequest->expects($this->any())->method('getBaseUri')->will($this->returnValue(new Uri('http://detected/base/uri/')));
     $this->mockRequestHandler->expects($this->any())->method('getHttpRequest')->will($this->returnValue($this->mockHttpRequest));
     $this->mockBootstrap->expects($this->any())->method('getActiveRequestHandler')->will($this->returnValue($this->mockRequestHandler));
     $this->inject($this->fileSystemTarget, 'bootstrap', $this->mockBootstrap);
 }
开发者ID:kszyma,项目名称:flow-development-collection,代码行数:11,代码来源:FileSystemTargetTest.php

示例15: boot

 /**
  * {@inheritdoc}
  */
 public function boot(\TYPO3\Flow\Core\Bootstrap $bootstrap)
 {
     require_once FLOW_PATH_PACKAGES . '/Libraries/raven/raven/lib/Raven/Autoloader.php';
     \Raven_Autoloader::register();
     $bootstrap->getSignalSlotDispatcher()->connect('TYPO3\\Flow\\Core\\Booting\\Sequence', 'afterInvokeStep', function ($step, $runlevel) use($bootstrap) {
         if ($step->getIdentifier() === 'typo3.flow:objectmanagement:runtime') {
             // This triggers the initializeObject method
             $bootstrap->getObjectManager()->get('Networkteam\\SentryClient\\ErrorHandler');
         }
     });
 }
开发者ID:netlogix,项目名称:Networkteam.SentryClient,代码行数:14,代码来源:Package.php


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