本文整理汇总了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);
}
示例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');
}
});
}
}
示例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');
});
}
示例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');
}
示例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');
}
示例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));
}
示例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');
}
}
示例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');
}
}
示例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');
}
示例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');
}
示例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);
});
}
示例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');
}
示例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');
}
});
}
示例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);
}
示例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');
}
});
}