protected function execute(InputInterface $input, OutputInterface $output)
 {
     $vendorDir = $this->getContainer()->getParameter('claroline.param.vendor_directory');
     $configDir = $this->getContainer()->getParameter('kernel.root_dir') . '/config';
     $recorder = new Recorder(new Detector($vendorDir), new BundleHandler($configDir . '/bundles.ini'), new OperationHandler($configDir . '/operations.xml'), $vendorDir);
     $recorder->buildBundleFile();
 }
Beispiel #2
0
//dsn driver... hardcoded. Change this if you really need it.
//or use the connexion from sf2
$driver = 'mysql';
$dsn = "{$driver}:host={$host};dbname={$dbName}";
$username = $value['parameters']['database_user'];
$password = $value['parameters']['database_password'];
//create connection
$conn = new \PDO($dsn, $username, $password, array());
//Let's use stefk stuff !
$operationFilePath = __DIR__ . "/../../app/config/operations.xml";
//remove the old operation file if it exists (maybe it would be better to do a backup).
unlink($operationFilePath);
$operationHandler = new OperationHandler($operationFilePath);
$detector = new Detector($vendorDir);
$bundleHandler = new BundleHandler($configDir . '/bundles.ini');
$recorder = new Recorder(new Detector($vendorDir), new BundleHandler($configDir . '/bundles.ini'), new OperationHandler($configDir . '/operations.xml'), $vendorDir);
$recorder->buildBundleFile();
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
//I need to do that in order to access some services required for the installation...
$kernel->boot();
$bundles = array();
//retrieve the current bundles
foreach ($recorder->getOperations() as $operation) {
    $package = $operation->getPackage();
    if ($package->getType() === 'claroline-plugin' || $package->getType() === 'claroline-core') {
        $bundles[] = array('type' => $package->getType(), 'name' => $package->getPrettyName(), 'new_version' => $package->getVersion(), 'is_installed' => false, 'fqcn' => $detector->detectBundle($package->getPrettyName()), 'dependencies' => array($recorder->getDependencies($package)));
    }
}
//retrieve the already installed bundles
$sql = "SELECT * from `claro_bundle`";