change composer repository

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

change composer repository

Postby natty » May 16th, 2017, 9:57 am

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
natty
 
Posts: 2
Joined: May 16th, 2017, 9:54 am

Re: change composer repository

Postby Miloslav Beno » May 17th, 2017, 8:45 am

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,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: change composer repository

Postby natty » May 17th, 2017, 12:41 pm

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
natty
 
Posts: 2
Joined: May 16th, 2017, 9:54 am


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 62 guests

cron

User Control Panel

Login

Who is online

In total there are 62 users online :: 0 registered, 0 hidden and 62 guests (based on users active over the past 5 minutes)
Most users ever online was 256 on March 28th, 2024, 9:42 am

Users browsing this forum: No registered users and 62 guests