-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstall.php
More file actions
23 lines (23 loc) · 804 Bytes
/
Install.php
File metadata and controls
23 lines (23 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
namespace BWCore\AssetsBundle;
//script to add bundle to the kernel
use Sensio\Bundle\GeneratorBundle\Manipulator\KernelManipulator;
class Install{
public function install(){
$loader = require __DIR__.'/../../autoload.php';
require_once __DIR__.'/../../../var/bootstrap.php.cache';
$kernel = new \AppKernel('prod', false);
$kernelManipulator = new KernelManipulator($kernel);
$bundleClassName = 'BW\AssetsBundle\BWAssetsBundle';
try {
$ret = $kernelManipulator->addBundle($bundleClassName);
if(!$ret){
echo 'Add the bundle '.$bundleClassName.'() to your AppKernel.php manually';
}
} catch (\RuntimeException $e) {
echo sprintf("Bundle %s is already defined in AppKernel::registerBundles()\n", $bundleClassName);
}
}
}
$install = new Install();
$install->install();