public function generateMigrationSql($return, &$hasMigrations) { $config = \Config::getInstance(); $modules = $config->getActiveModules(); $connection = $GLOBALS['container']['doctrine.connection.default']; $output = new OutputWriter(); foreach ($modules as $module) { $path = sprintf('%s/system/modules/%s/migrations', TL_ROOT, $module); if (is_dir($path)) { $namespace = preg_split('~[\\-_]~', $module); $namespace = array_map('ucfirst', $namespace); $namespace = implode('', $namespace); $configuration = new Configuration($connection, $output); $configuration->setName($module); $configuration->setMigrationsNamespace('DoctrineMigrations\\' . $namespace); $configuration->setMigrationsDirectory($path); $configuration->registerMigrationsFromDirectory($path); $migration = new Migration($configuration); $versions = $migration->getSql(); if (count($versions)) { foreach ($versions as $version => $queries) { if (count($queries)) { $_SESSION['TL_CONFIRM'][] = sprintf($GLOBALS['TL_LANG']['doctrine']['migration'], $module, $version); $hasMigrations = true; $return = $this->appendQueries($return, $queries); } } } } } return $return; }