<?php
namespace Galilee\MigrationsBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class GalileeMigrationsBundle extends Bundle
{
const INSTALL_CLASSES_PATH = PIMCORE_APP_ROOT . '/Resources/install/class_sources/';
public function __construct()
{
// $overrideSymfonyPassRegister is to be used only on deployment issue of class install
// gitlab-ci must use
if(file_exists(PIMCORE_APP_ROOT.'/deploy.flag')){
$jsonFiles = glob(self::INSTALL_CLASSES_PATH . '*.json');
foreach ($jsonFiles as $path) {
preg_match('~_class_(.*?)_export~', $path, $output);
$className = end($output);
if (!class_exists('\\Pimcore\\Model\\DataObject\\'.$className)) {
class_alias('\\Pimcore\\Model\\DataObject\\Concrete', '\\Pimcore\\Model\\DataObject\\'.$className, true);
}
}
}
}
}