Bug #26128

Doctrine persistence manager compilation should be configurable

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

Status:
Resolved
Priority:
Should have
Category:
Persistence
Target version:
-
Start date:
2011-04-19
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

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');

        $bootstrap->registerCompiletimeCommandController('flow3:object');
        $bootstrap->registerCompiletimeCommandController('flow3:core');
        $bootstrap->registerCompiletimeCommandController('flow3:cache');

        $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.

Also available in: Atom PDF