本文整理汇总了PHP中TYPO3\Flow\Core\Bootstrap::getSignalSlotDispatcher方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap::getSignalSlotDispatcher方法的具体用法?PHP Bootstrap::getSignalSlotDispatcher怎么用?PHP Bootstrap::getSignalSlotDispatcher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Core\Bootstrap
的用法示例。
在下文中一共展示了Bootstrap::getSignalSlotDispatcher方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boot
public function boot(\TYPO3\Flow\Core\Bootstrap $bootstrap)
{
// 1. Make Gedmo\Translatable\Entity\Translation known to Doctrine, so that it can participate in Database Schema Generation
//
// Internally, we use a MappingDriverChain for that, which delegates almost all of its behavior to the already-existing
// FlowAnnotationDriver. We additionally add the (default doctrine) Annotation Driver for the Gedmo namespace.
//
// Note: We replace FlowAnnotationDriver *on a very low level* with the *MappingDriverChain* object; because this class
// is only used inside EntityManagerFactory -- so we know quite exactly what methods are called on that object.
$bootstrap->getSignalSlotDispatcher()->connect('TYPO3\\Flow\\Core\\Booting\\Sequence', 'beforeInvokeStep', function ($step) use($bootstrap) {
if ($step->getIdentifier() === 'typo3.flow:resources') {
$flowAnnotationDriver = $bootstrap->getObjectManager()->get('TYPO3\\Flow\\Persistence\\Doctrine\\Mapping\\Driver\\FlowAnnotationDriver');
$driverChain = new MappingDriverChainWithFlowAnnotationDriverAsDefault($flowAnnotationDriver);
$driverChain->addDriver(new AnnotationDriver(ObjectAccess::getProperty($flowAnnotationDriver, 'reader', TRUE), FLOW_PATH_PACKAGES . 'Libraries/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity'), 'Gedmo');
$bootstrap->getObjectManager()->setInstance('TYPO3\\Flow\\Persistence\\Doctrine\\Mapping\\Driver\\FlowAnnotationDriver', $driverChain);
}
});
// 2. Work around a bug in TYPO3\Flow\Persistence\Doctrine\PersistenceManager::onFlush which expects that all objects in the
// Doctrine subsystem are entities known to Flow.
//
// The line $this->reflectionService->getClassSchema($entity)->getModelType() triggers a fatal error, for get_class($entity) == 'Gedmo\Translatable\Entity\Translation'
// because this class is known only to Doctrine (see 1. above), but not to the Flow reflection service.
//
// As a workaround, we just add an empty placeholder class schema to the Class Schemata cache, right before the class schema is saved
// inside the TYPO3\Flow\Core\Bootstrap::bootstrapShuttingDown signal (which is fired directly after "finishedCompiletimeRun").
$bootstrap->getSignalSlotDispatcher()->connect('TYPO3\\Flow\\Core\\Bootstrap', 'finishedCompiletimeRun', function () use($bootstrap) {
$classSchemataCache = $bootstrap->getObjectManager()->get('TYPO3\\Flow\\Cache\\CacheManager')->getCache('Flow_Reflection_RuntimeClassSchemata');
if (!$classSchemataCache->has('Gedmo_Translatable_Entity_Translation')) {
$classSchemataCache->set('Gedmo_Translatable_Entity_Translation', new ClassSchema('Gedmo\\Translatable\\Entity\\Translation'));
}
});
}
示例2: 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');
}
}
示例3: registerIndexingSlots
/**
* Registers slots for signals in order to be able to index nodes
*
* @param Bootstrap $bootstrap
*/
public function registerIndexingSlots(Bootstrap $bootstrap)
{
$configurationManager = $bootstrap->getObjectManager()->get('TYPO3\\Flow\\Configuration\\ConfigurationManager');
$settings = $configurationManager->getConfiguration(\TYPO3\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, $this->getPackageKey());
if (isset($settings['realtimeIndexing']['enabled']) && $settings['realtimeIndexing']['enabled'] === TRUE) {
$bootstrap->getSignalSlotDispatcher()->connect('TYPO3\\TYPO3CR\\Domain\\Model\\Node', 'nodeAdded', 'TYPO3\\TYPO3CR\\Search\\Indexer\\NodeIndexingManager', 'indexNode');
$bootstrap->getSignalSlotDispatcher()->connect('TYPO3\\TYPO3CR\\Domain\\Model\\Node', 'nodeUpdated', 'TYPO3\\TYPO3CR\\Search\\Indexer\\NodeIndexingManager', 'indexNode');
$bootstrap->getSignalSlotDispatcher()->connect('TYPO3\\TYPO3CR\\Domain\\Model\\Node', 'nodeRemoved', 'TYPO3\\TYPO3CR\\Search\\Indexer\\NodeIndexingManager', 'removeNode');
$bootstrap->getSignalSlotDispatcher()->connect('TYPO3\\Neos\\Service\\PublishingService', 'nodePublished', 'TYPO3\\TYPO3CR\\Search\\Indexer\\NodeIndexingManager', 'indexNode', FALSE);
$bootstrap->getSignalSlotDispatcher()->connect('TYPO3\\Flow\\Persistence\\Doctrine\\PersistenceManager', 'allObjectsPersisted', 'TYPO3\\TYPO3CR\\Search\\Indexer\\NodeIndexingManager', 'flushQueues');
}
}
示例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
/**
* 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');
}
});
}
}
示例6: 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');
}
示例7: boot
/**
* @param Bootstrap $bootstrap
*/
public function boot(Bootstrap $bootstrap)
{
$dispatcher = $bootstrap->getSignalSlotDispatcher();
$dispatcher->connect('TYPO3\\Flow\\Configuration\\ConfigurationManager', 'configurationManagerReady', function ($configurationManager) {
$configurationManager->registerConfigurationType('Sprints');
});
}
示例8: 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');
}
}
示例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
/**
* 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);
});
}
示例11: 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');
}
示例12: 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');
}
});
}
示例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: 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');
}
示例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');
}
});
// Make Sentry DSN settable via Environment Variables. Only used in context Production/Heroku.
if (getenv('ENV_SENTRY_DSN')) {
define('ENV_SENTRY_DSN', getenv('ENV_SENTRY_DSN'));
}
}