Page 1 of 1

change composer repository

PostPosted: May 16th, 2017, 9:57 am
by natty
hi there

I am wanting to change the composer repository from the default packagist.org to wpackagist.org as we are working on a wordpress project, and would like to manage the plugins/thems in this way.
I cannot however see any options to change the default.

I have tried updating the composer.json in the root of the project thusly:

"repositories": [
{
"packagist.org": false,
"type": "composer",
"url": "https://wpackagist.org"
}
],

to no avail. is it indeed possible to switch repos?
I am using VS 2017 [15.1.26403.7] (also tried 2015)

as a bit of an aside, I would be happy (at least initially) to simply use composer form the command line, but cant seem to find the composer executable - I presume php tools puts this somewhere?

last thing - how can I deal with premium plugins which are not mirrored on the standard repos - other than i guess making a local repo..?
any help much appreciated

thanks

Re: change composer repository

PostPosted: May 17th, 2017, 8:45 am
by Miloslav Beno
Hello!

Thanks for the excelent questions.

Currently our Install New package dialog searches only on packagist, but we're planing to make it work with any repository configures in composer.json.

Of course this currently doesn't limit you to packagist, you just need to alter composer.json manually or through command line. e.g. You can start command line with php configured by right clicking on project node and select Open command line.

We put composer.phar to this location
Code: Select all
%appdata%\..\Local\DEVSENSE\Composer
, but you can use any composer.phar you want.

About premium plugins... I would be interested in the answer as well. What is the common approach on this? I guess local repos is way to go?

Thanks,

Re: change composer repository

PostPosted: May 17th, 2017, 12:41 pm
by natty
Hi Miloslav

thanks for the reply.
I will try and do everything from the command line for now. but I am experiencing another problem around installation directories, as the packages always seem to land in a vendors folder instead of the wp-content/plugins as specified by the wordpress-plugin type
seems to relate to the lack of 'composer/installers' - is this a dev-dependency?
for example I get this when running the following from the command line:
>php composer.phar install

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for wpackagist-plugin/akismet 3.3.2 -> satisfiable by wpackagist-plugin/akismet[3.3.2].
- wpackagist-plugin/akismet 3.3.2 requires composer/installers ~1.0 -> no matching package found.
... etc

not sure where I can get hold of this composer/installers?

ps couldnt find composer as part of the devsense install, am on windows 10 and it couldnt find composer.phar anywhere, ended up installing it seperately - dont have a devsense directory in my appdata anywhere

thanks again