Bug #26128

Doctrine persistence manager compilation should be configurable

Added by Christopher Hlubek over 10 years ago. Updated over 10 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


Estimated time:
PHP Version:
Has patch:


The compile method of the Doctrine persistence manager is currently hard-coded inside the FLOW3 Metapackage:

class Package extends BasePackage {

     * Invokes custom PHP code directly after the package manager has been initialized.
     * @param \F3\FLOW3\Core\Bootstrap $bootstrap The current bootstrap
     * @return void
    public function boot(\F3\FLOW3\Core\Bootstrap $bootstrap) {
        require_once(__DIR__ . '/../Resources/PHP/AutoLoader.php');


        $dispatcher = $bootstrap->getSignalSlotDispatcher();
        $dispatcher->connect('F3\FLOW3\Core\Bootstrap', 'finishedRuntimeRun', 'F3\FLOW3\Persistence\PersistenceManagerInterface', 'persistAll');
        $dispatcher->connect('F3\FLOW3\Core\Bootstrap', 'bootstrapShuttingDown', 'F3\FLOW3\Configuration\ConfigurationManager', 'shutdown');
        $dispatcher->connect('F3\FLOW3\Core\Bootstrap', 'bootstrapShuttingDown', 'F3\FLOW3\Object\ObjectManagerInterface', 'shutdown');
        $dispatcher->connect('F3\FLOW3\Core\Bootstrap', 'bootstrapShuttingDown', 'F3\FLOW3\Reflection\ReflectionService', 'saveToCache');

        $dispatcher->connect('F3\FLOW3\Command\CoreCommandController', 'finishedCompileCommand', 'F3\FLOW3\Persistence\Doctrine\PersistenceManager', 'compile');

If an alternative (generic) persistence is used, there is no need for the compile call, especially since Doctrine puts restrictions on the model.

There should be some kind of configuration option to prevent the Doctrine compilation.


Updated by Christopher Hlubek over 10 years ago

The mere existence of the PersistenceManager is a problem if no driver is configured:

Uncaught exception in line 147 of .../Packages/Framework/FLOW3/Resources/PHP/Doctrine/DBAL/DriverManager.php: The options 'driver' or 'driverClass' are mandatory if no PDO instance is given to DriverManager::getConnection()

Disabling the connect between finishedCompileCommand and PersistenceManager->compile fixes this problem, since no PersistenceManager will be created (given that another Backend and the generic PersistenceManager are configured).


Updated by Karsten Dambekalns over 10 years ago

  • Category set to Persistence
  • Status changed from New to Accepted

Updated by Christopher Hlubek over 10 years ago

The problem inside the package is gone. Now I face the problem, that the Doctrine compilation is always executed in non-production contexts in Bootstrap->initializeForRuntime:

        if ($this->context !== 'Production') {
            $coreCache = $this->cacheManager->getCache('FLOW3_Core');
            if ($coreCache->has('doctrineSetupRunning') === FALSE) {
                $coreCache->set('doctrineSetupRunning', 'White Russian', array(), 60);
                $this->systemLogger->log('Updating Doctrine DB and proxies', LOG_DEBUG);

Updated by Mr. Hudson over 10 years ago

Patch set 1 of change I95165074115d16c70d00ccfb42512de2e8009cb6 has been pushed to the review server.
It is available at http://review.typo3.org/2305


Updated by Christopher Hlubek over 10 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF