Using the littled lib Library in PHP Projects: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
Line 38: Line 38:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
$ rm ./installer
$ rm ./installer
</syntaxhighlight>
Install the libraries specified in `composer.json`.
<syntaxhighlight lang="bash">
$ php composer.phar install
</syntaxhighlight>
Add the `--no-dev` option to skip over installing development dependencies:
<syntaxhighlight lang="bash">
$ php composer.phar install --no-dev
</syntaxhighlight>
</syntaxhighlight>

Revision as of 20:48, 5 February 2017

Using composer

Add a composer.json file in the root of the PHP web project and configure it to fetch the littled_lib library from from GitHub.

{
  "require": {
    "php": ">=5.6.0",
    "ext-curl": "*",
    "dbarchowsky/littled": "dev-develop"
  },
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/dbarchowsky/littled_lib.git"
    }
  ]
}

Installing composer

Download the installer, which is a PHP script.

$ wget https://getcomposer.org/installer

Run the installer script.

$ php -f ./installer

Clean up the installer script.

$ rm ./installer

Install the libraries specified in composer.json.

$ php composer.phar install

Add the --no-dev option to skip over installing development dependencies:

$ php composer.phar install --no-dev