Coder Social home page Coder Social logo

composer-sublime's Introduction

#Composer integration for Sublime Text 2 & 3

ST3 support is still beta, please report issues

With this plugin you can manage your dependencies with composer

Currently the following features are supported:

  • Execute composer install
  • Execute composer update
  • Execute composer self-update
  • Execute composer dump-autoload
  • Package management:
    • Add package
    • Remove package
  • Edit composer.json file
  • Validate a composer.json file

##Instalation

Via Package Control

First install Package Control if you haven't done so yet.

Then go to Preferences -> Package Control -> Install Package and type composer to install this plugin.

This is the recommended installation method.

Manual Instalation

Go to your sublime package folder and type: git clone [email protected]:francodacosta/composer-sublime.git

##Running Composer Just open the command prompt (ctrl + shifp + p) and type composer, context menus are also provided

##Features Help ###Composer install executes the composer install command, with the default settings the following command will be executed

composer.phar install -n -v

###Composer update executes the composer update command, with the default settings the following command will be executed

composer.phar update -n -v

###Composer self update executes the composer self update command, updating the composer binary to the latest version. With the default settings the following command will be executed

composer.phar self-update -n -v

###Composer dump autoload executes the composer dump autoload command to regenerate the autloader configuration With the default settings the following command will be executed

composer.phar dump-autoload -n -v

###Composer validade executes the composer validate command With the default settings the following command will be executed

composer.phar validate -n -v

###Composer Add Package You can add a package to the required package list.

When you execute this command a prompt is presented (in the bottom of the screen) allowing you to specify the package name and version contraints

The syntax for adding a package is as follows:

package name : version

if you do not specify a version the default will be *

###Composer Remove Package Removes a package from the required packages section in composer.json

When you select this option a list of required packages will pop up, you only need to select the package to be removed

Note: this just removes the reference from composer.json_ it will not remove any files

###Edit composer.json file this option will open a new window pointing to the composer.json file

##Configuration Options

  • show_status: show messages in the status bar
  • show_output: opens an output window and shows composer working
  • composer_command: Path to composer.phar file
  • composer_install_extra: extra arguments to pass to the install command
  • composer_update_extra: extra arguments to pass to the update command
  • composer_dumpautoload_extra: extra arguments to pass to the dump-autoload command
  • composer_selfupdate_extra: extra arguments to pass to the self-update command

##How is composer.json found? The plugin tries to locate the composer.json file. It starts at the same folder of the file beeing edited and goes all the way up to the root folder. If you do not specify the composer_command option the default is to look for composer.phar on the same folder where composer.json was found

composer-sublime's People

Contributors

francodacosta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

composer-sublime's Issues

Composer from global installation.

am currently having composer installed as global at ~/.composer

when i add ~/.composer/2014-10-17_19-28-38-373c688-old.phar to the "composer_command" i get an error of

 -- COMPOSER -- 

executing: ~/.composer/2014-10-17_19-28-38-373c688-old.phar update -n -v
Error: [Errno 2] No such file or directory: '~/.composer/2014-10-17_19-28-38-373c688-old.phar'

so what should i do ?
am on ST B3065 ,OSX 10.9.5.

Add dump-autoload

Would be nice to have the "dump-autoload" command added. I've done it on my local copy but it may be useful for other people.

Composer & PHP aliasing and Mcrypt errors

Hi,

This isn't an issue which is one of the package though, I did want to share it just the same.

I'm running MAMP Pro and have aliased PHP in my .profile to use a version which is included with MAMP Pro.

alias php='/Applications/MAMP/bin/php/php5.5.23/bin/php'

I've also setup Composer globally. I've moved and renamed the composer.phar per the instructions on getcomposer.org etc.

alias composer="php /usr/local/bin/composer"
(the php in the composer alias is chaining in the php alias above it for MAMP Pro)

I've updated your composer_command config path to point to the new location for composer but, it's not taking into account the aliasing of global composer rather, php aliasing.

With that said, I keep getting errors within your package when I run the install command with Laravel because it can't find the mcrypt extension.

Note: I installed mcrypt via homebrew but, without setting up PHP in a normal MAC OS X MAMP type setup, it's not working and why I'm aliasing to MAMP Pro's version instead.

I'm able to run composer install directly from terminal without errors so I know my setup is correct and it seems to make sense as to why it's not working from your package.

With that said, and as a nice to have within this package, having an option for setting a command to run with composer_command would be amazing!

For example:

{
    "composer_command": "php ",
    "composer_path": "/usr/local/bin/composer"
}

or maybe just allowing for:

{
    "composer_command": "php /usr/local/bin/composer"
}

Thanks!

Dump-autoload not working in SublimeText3

I get the following error when attempting to use Composer: Dump Autoload command.
Composer is installed on my machine and properly setup in my environmental path (windows machine).

`executing:` ./composer.phar dump-autoload -n -v
'.' is not recognized as an internal or external command,

operable program or batch file.

How to use on Windows?

I get this error: maximum recursion depth exceeded while calling a Python object when I set the composer_command to point to my composer.phar

Any help?

User defined setting not overridding default settings

I use Windows 7 and have my composer globally installed to only require "composer".

I've tried to update ("composer_command": "./composer.phar") to ("composer_command": "composer") in the user defined settings, but the sublime terminal is still showing the original composer command. I tried to change a few other settings. None of the changes I made seemed to affect the package settings.

Sublime Text 3

Do you have any plans on adding Sublime Text 3 compatibility?

Composer fails to find php extensions when executed through ST2

When trying to install https://packagist.org/packages/doctrine/mongodb-odm recently I ran into the following error:

executing: /bin/composer.phar update -n -v
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - doctrine/mongodb 1.0.x-dev requires ext-mongo >=1.2.12,<1.4-dev -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.0.2 requires ext-mongo >=1.2.12,<1.4-dev -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.0.1 requires ext-mongo >=1.2.12,<1.4-dev -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.0.0-BETA3 requires ext-mongo >=1.3.1,<1.4-dev -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.0.0-BETA2 requires ext-mongo >=1.2.12,<1.3-dev -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.0.0-BETA1 requires ext-mongo * -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.0.0 requires ext-mongo >=1.2.12,<1.4-dev -> the requested PHP extension mongo is missing from your system.
    - Installation request for doctrine/mongodb 1.0.*@dev -> satisfiable by doctrine/mongodb 1.0.0, doctrine/mongodb 1.0.0-BETA1, doctrine/mongodb 1.0.0-BETA2, doctrine/mongodb 1.0.0-BETA3, doctrine/mongodb 1.0.1, doctrine/mongodb 1.0.2, doctrine/mongodb 1.0.x-dev.

However php -m has:

[PHP Modules]
...
mongo
...

And /bin/composer.phar show --platform has:

...
ext-mongo        1.3.5     The mongo PHP extension
...

And if I open up Terminal (this is on OS X) and run /bin/composer.phar update -n -v it works fine.

My user settings looks like this:

{
    "composer_command":  "/bin/composer.phar"
}

composer commands via standard OS CLI?

Hey,

maybe it is damn easy but my composer commands did not execute...

I've sync my ST3 3062 settings through google drive to my Mac and Windows-Notebook. So I want to use composer through the CLI because of different file systems.

I've configure my composer like this:

{
    "composer_command":  "composer"
}

but it is not execute. (File did not found)
I do not want to place a single composer.phar to each project, so the CLI way is wanted.

Is there any way to reach any cross OS configuration?

Open composer.phar

After config path to composer.phar in settings, when I try to use plugin command in Sublime Text, Windows 10 (64-bit) asking me in which program I want to open the file composer.phar.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.