Yii2: Question: How to disable extension bootstrapping?

Created on 30 Mar 2016  路  3Comments  路  Source: yiisoft/yii2

What steps will reproduce the problem?

We have a metapackage which contains some other Yii 2.0 extensions. If someone installs the package several extensions/modules are registered automatically in the application bootstrap process.

Is there a way to disable calls to bootstrap() in the configuration, eg. via $extensions?

Additional info

| Q | A |
| --- | --- |
| Yii version | 2.0.7 |
| PHP version | 5.6.18 |
| Operating system | Linux (Docker) |
| Related issues | https://github.com/dmstr/yii2-cms-metapackage/issues/2#issuecomment-203553611 |

Most helpful comment

another why. in bootstrap.php and

Yii::$container->set('ext\ns\Bootstrap',function(){
    return new yii\base\Object(); // or new stdClass();
});

All 3 comments

manually update file @vendor/yiisoft/extensions.php then remark specific bootstrap :grinning:

I am using some kind of hack:

$extensions = require Yii::getAlias('@vendor/yiisoft/extensions.php');
unset($extensions['packageName']);
$config  = [
    ...
    'extensions' = $extensions
    ...
];

another why. in bootstrap.php and

Yii::$container->set('ext\ns\Bootstrap',function(){
    return new yii\base\Object(); // or new stdClass();
});
Was this page helpful?
0 / 5 - 0 ratings

Related issues

AstRonin picture AstRonin  路  49Comments

sapsxxxil picture sapsxxxil  路  50Comments

dhiman252 picture dhiman252  路  44Comments

samdark picture samdark  路  63Comments

samdark picture samdark  路  52Comments