jubianchi / phpswitch

Using the installer

$ bin/installer --usage
        > phpswitch installer
        --global        : Install phpswitch as a global command
        --check         : Only run system requirements check

        Environment :
        PHPSWITCH_GIT_URL : Git repository (default : git://github.com/jubianchi/phpswitch.git)
        PHPSWITCH_PATH : Installation directory (default : /usr/share)
        PHPSWITCH_SYMLINK : phpswitch bin symlink path (default: /usr/local/bin)

        Examples :
        $ curl https://raw.github.com/jubianchi/phpswitch/master/bin/installer | sudo php -- --global
        $ curl https://raw.github.com/jubianchi/phpswitch/master/bin/installer | PHPSWITCH_PREFIX=/home/me php

Default installation

The default option is to install phpswitch in the current directory. The installer will check requirements and checkout if everything is ok. Once done, you wil be able to initalize phpswitch workspace :

$ bin/installer

# ...

$ ./phpswitch/bin/phpswitch init

Global installation

The installer has an option to install phpswitch globally in /usr/share/phpswitch and link the executable to /usr/local/bin/phpswitch :

$ bin/installer --global

When using this method, you will have to ensure that you have write access to the directories.

Custom installation

If you want to install phpswitch in another directory, you can use the following variables :

# This will change the installation directory to /path/to/install/phpswitch
$ PHPSWITCH_PATH=/path/to/install bin/installer

# This will change the link target to /path/to/bin/phpswitch
$ PHPSWITCH_SYMLINK=/path/to/bin bin/installer

# This will change both at the same time
$ PHPSWITCH_PATH=/path/to/install PHPSWITCH_SYMLINK=/path/to/bin bin/installer

# ...

$ phpswitch init