diff --git a/src/Plugin.php b/src/Plugin.php index 9ddad50..29de0d8 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -130,7 +130,12 @@ public function onPostAutoloadDump(Event $event) protected function initAutoload() { - require_once dirname(dirname(dirname(__DIR__))) . '/autoload.php'; + $dir = dirname(dirname(dirname(__DIR__))); + $yii = "$dir/yiisoft/yii2/Yii.php"; + require_once "$dir/autoload.php"; + if (file_exists($yii)) { + require_once $yii; + } } protected function scanPackages()