Closed arturf closed 10 years ago
When installed yiisoft/yii2-debug
should define @yii/debug
alias in vendor/yiisoft/extensions.php
so framework is able to recognize it.
What's inside your extensions.php
, what's in your composer.json
, which command was used to install packages?
extensions.php
$vendorDir = dirname(__DIR__);
return array (
'yiisoft/yii2-bootstrap' =>
array (
'name' => 'yiisoft/yii2-bootstrap',
'version' => '2.0.0.0-beta',
'alias' =>
array (
'@yii/bootstrap' => $vendorDir . '/yiisoft/yii2-bootstrap',
),
),
'yiisoft/yii2-debug' =>
array (
'name' => 'yiisoft/yii2-debug',
'version' => '2.0.0.0-beta',
'alias' =>
array (
'@yii/debug' => $vendorDir . '/yiisoft/yii2-debug',
),
),
);
my composer.json
{
"name": "binn/erp",
"description": "",
"authors": [],
"require": {
"php":">=5.4.0",
"yiisoft/yii2": "2.0.0-beta",
"yiisoft/yii2-composer": "2.0.0-beta",
"yiisoft/yii2-debug": "2.0.0-beta",
"yiisoft/yii2-bootstrap": "2.0.0-beta",
"binn/sbuilder": "dev-master"
},
"repositories": [
{
"type": "git",
"url": "git@git.devlabs.me:base/yii_cmf.git"
}
]
}
Command for install - composer.phar install
Later (when added debug extension dependency into composer) - composer.phar update
And when I added Yii::setAlias('@yii/debug', Yii::getAlias('@vendor/yiisoft/yii2'))
to main config file debug start works, but markup is broken - http://joxi.ru/cMt9UxjKTJASTqEEED8
extensions.php
seems to be generated correctly. Need to reproduce it.
@arturf do you have the following line in your application config?
https://github.com/yiisoft/yii2/blob/master/apps/basic/config/web.php#L9
@cebe no.. my mistake, thanks.
But what about to automatically include this config on framework core? Also with mapping with custom user config?
@arturf it's included by default in both basic and advanced application configs. Probably worth moving it from configs to the application code. @yiisoft/core-developers what do you think?
when @vendor
is set we could easily use it to determine location of extension. Worth setting a default value to @vendor/yiisoft/extensions.php
for it.
Sounds good to me.
I'll handle it.
Done.
@samdark great, thanks )
sourcePath
default value inDebugAsset
is@yii/debug/assets
, but when installing framework wia composer like this:vendor/yiisoft/yii2
does not contain debug extension so we have an errorThe file or directory to be published does not exist: /home/.../vendor/yiisoft/yii2/debug/assets
.Maybe make sense set
sourcePath
to '@vendor/yiisoft/yii2-debug/assets' by default like inBootstrapAsset
?