coder123
(Aniltc)
February 14, 2017, 9:31am
1
hi all
For some reasons, my composer doesn’t work.I would like to manually install some extensions. how can I do. I checked documentation but I am not getting an idea
http://www.yiiframework.com/doc-2.0/guide-structure-extensions.html
I prefer to add manually. I just downloaded and copied extension to vendor directory
Should I add in following files ?
1.autoload_namespaces.php
2.autoload_files.php
what are the files I need to include path ?
jacmoe
(Jacob Moena)
February 14, 2017, 2:34pm
2
You are honestly just postponing the one thing that you really need to do: fix your Composer installation.
What’s wrong with it?
coder123
(Aniltc)
February 15, 2017, 5:13am
3
Thanks
I use yii 2.03. When I try to install an extension it shows that some plugin 1.0.0 it is required for my version .I run composer using --no-plugins options but still it shows. When I try to install 1.0.0 version.
it shows
yiisoft/yii2-composer 2.0.3 requires composer-plugin-api 1.0.0 -> no match ing package found.
I updated with’ composerglobal require “fxp/composer-asset-plugin:*” ’ but its run smoothly but when I run
C:\xampp\htdocs\opalwp\portal>composer require --prefer-dist yiisoft/yii2-jui "*
" --no-plugins
it shows the same error
yiisoft/yii2-composer 2.0.3 requires composer-plugin-api 1.0.0 -> no match ing package found.
I tried
composer global require "fxp/composer-asset-plugin:1.0.0-beta3"
biut it shows package not available.
jacmoe
(Jacob Moena)
February 15, 2017, 3:57pm
4
Okay, there are several things that you can do.
composer self-update
composer global require "fxp/composer-asset-plugin:^1.2.0" --no-plugins
And then, in your project, upgrade Yii:
composer require "yiisoft/yii2:~2.0.10" --update-with-dependencies
See the upgrade guide
If that fails too, then you can remove the global Composer installation, including the configuration file.
Or remove the ‘vendor’ directory and the ‘composer.lock’ in your project.
Or both.
And require the composer asset plugin globally.
And run composer install locally (project).
I am sorry, but yes: sometimes Composer borks itself…
Most of the time, though, you simply would not go without it - because it makes PHP development so much more enjoyable.
coder123
(Aniltc)
February 16, 2017, 5:41am
5
Thanks
now when i run my application it shows
Call to undefined method yii\helpers\Url::baseWebDir()
$baseWebDir = Url::baseWebDir()
samdark
(Alexander Makarov)
February 18, 2017, 7:52pm
6
There’s no such method in the framework and there never was one.