/** * Emits a signal when an Advice is invoked * * The advice is not proxyable, so the signal is dispatched manually here. * * @param object $aspectObject * @param string $methodName * @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint * @return void * @Flow\Signal */ protected function emitAdviceInvoked($aspectObject, $methodName, $joinPoint) { if ($this->dispatcher === null) { $this->dispatcher = $this->objectManager->get(\TYPO3\Flow\SignalSlot\Dispatcher::class); } $this->dispatcher->dispatch(\TYPO3\Flow\Aop\Advice\AbstractAdvice::class, 'adviceInvoked', array($aspectObject, $methodName, $joinPoint)); }
/** * Emits a signal when package states have been changed (e.g. when a package was created or activated) * * The advice is not proxyable, so the signal is dispatched manually here. * * @return void * @Flow\Signal */ protected function emitPackageStatesUpdated() { if ($this->dispatcher === null) { $this->dispatcher = $this->bootstrap->getEarlyInstance(Dispatcher::class); } $this->dispatcher->dispatch(PackageManager::class, 'packageStatesUpdated'); }
/** * Emits a signal when an Advice is invoked * * The advice is not proxyable, so the signal is dispatched manually here. * * @param object $aspectObject * @param string $methodName * @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint * @return void * @Flow\Signal */ protected function emitAdviceInvoked($aspectObject, $methodName, $joinPoint) { if ($this->dispatcher === NULL) { $this->dispatcher = $this->objectManager->get('TYPO3\\Flow\\SignalSlot\\Dispatcher'); } $this->dispatcher->dispatch('TYPO3\\Flow\\Aop\\Advice\\AbstractAdvice', 'adviceInvoked', array($aspectObject, $methodName, $joinPoint)); }
/** * @test */ public function unfreezePackageEmitsPackageStatesUpdatedSignal() { $this->mockApplicationContext->expects($this->atLeastOnce())->method('isDevelopment')->will($this->returnValue(true)); $this->packageManager->createPackage('Some.Package', null, null, null, ['name' => 'some/package', 'type' => 'typo3-flow-package']); $this->packageManager->freezePackage('Some.Package'); $this->mockDispatcher->expects($this->once())->method('dispatch')->with(PackageManager::class, 'packageStatesUpdated'); $this->packageManager->unfreezePackage('Some.Package'); }
/** * @test */ public function unfreezePackageEmitsPackageStatesUpdatedSignal() { $this->mockApplicationContext->expects($this->atLeastOnce())->method('isDevelopment')->will($this->returnValue(TRUE)); $this->packageManager->createPackage('Some.Package'); $this->packageManager->freezePackage('Some.Package'); $this->mockDispatcher->expects($this->once())->method('dispatch')->with('TYPO3\\Flow\\Package\\PackageManager', 'packageStatesUpdated'); $this->packageManager->unfreezePackage('Some.Package'); }
/** * Signals that the compile command was successfully finished. * * @param integer $classCount Number of compiled proxy classes * @return void * @Flow\Signal */ protected function emitFinishedCompilationRun($classCount) { $this->signalSlotDispatcher->dispatch(__CLASS__, 'finishedCompilationRun', array($classCount)); }
/** * Passes the signal over to the Dispatcher * * @Flow\AfterReturning("methodAnnotatedWith(TYPO3\Flow\Annotations\Signal)") * @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint The current join point * @return void */ public function forwardSignalToDispatcher(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint) { $signalName = lcfirst(str_replace('emit', '', $joinPoint->getMethodName())); $this->dispatcher->dispatch($joinPoint->getClassName(), $signalName, $joinPoint->getMethodArguments()); }
/** * Signalizes that the specified directory has changed * * @param string $monitorIdentifier Name of the monitor which detected the change * @param array $changedDirectories An array of changed directories (key = path) and their status (value) * @return void * @Flow\Signal * @api */ protected function emitDirectoriesHaveChanged($monitorIdentifier, array $changedDirectories) { $this->signalDispatcher->dispatch(\TYPO3\Flow\Monitor\FileMonitor::class, 'directoriesHaveChanged', array($monitorIdentifier, $changedDirectories)); }
/** * Wire signals to slots as needed in TYPO3 Neos. * * @param \TYPO3\Flow\SignalSlot\Dispatcher $dispatcher * @param Profiler $profiler * @param \Sandstorm\PhpProfiler\Domain\Model\ProfilingRun $run * @param \TYPO3\Flow\Core\Bootstrap $bootstrap * @return void */ protected function connectToNeosSignals(\TYPO3\Flow\SignalSlot\Dispatcher $dispatcher, Profiler $profiler, \Sandstorm\PhpProfiler\Domain\Model\ProfilingRun $run, \TYPO3\Flow\Core\Bootstrap $bootstrap) { $dispatcher->connect('TYPO3\\TypoScript\\Core\\Runtime', 'beginEvaluation', function ($typoScriptPath) use($run) { $run->startTimer('TypoScript Runtime: ' . $typoScriptPath); }); $dispatcher->connect('TYPO3\\TypoScript\\Core\\Runtime', 'endEvaluation', function ($typoScriptPath) use($run) { $run->stopTimer('TypoScript Runtime: ' . $typoScriptPath); }); $dispatcher->connect('TYPO3\\Neos\\View\\TypoScriptView', 'beginRender', function () use($run) { $run->startTimer('Neos TypoScript Rendering'); }); $dispatcher->connect('TYPO3\\Neos\\View\\TypoScriptView', 'endRender', function () use($run) { $run->stopTimer('Neos TypoScript Rendering'); }); }