Re: [RFC] Deprecate PEAR/PECL & Replace withcomposer/pickle
| From: | Daniel Morris | Date: | Thu, 08 Sep 2016 18:45:19 +0000 |
| Subject: | Re: [RFC] Deprecate PEAR/PECL & Replace withcomposer/pickle | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-95809@lists.php.net to get a copy of this message | ||
On Thu, 8 Sep 2016, at 05:21 PM, Lester Caine wrote:
> Another couple of hours wasted, but I understand where things are now,
> and basically the simple fact is that composer global mode is nothing of
> the sort. The PHP_CodeSniffer composer install does not work and I
> understand NOW why the Smarty one also failed. I was expecting the files
> to be available to the nginx server but they were hidden away in my home
> directory. I still have to work out just how to reset things to move the
> code to /usr/shared/phpx/composer to parallel the PEAR version.
PHP_CodeSniffer should not be run by the web server, it's a command-line
development tool, it should be run by the developer, or as part of a
build (e.g. Travis, Ant, etcetera)
Composer allows you to separate the dependencies, for example, in your
case; Smarty is a production and development dependency, and PHPCS is a
development dependency only, your
composer.json should have something
similar to the following:
```
{
"require": {
"smarty/smarty": "~3.1"
},
"require-dev": {
"squizlabs/php_codesniffer": "^2.7"
}
}
```
That way, anytime someone runs composer install from your project
directory (or wherever the composer.json dependency is contained), it
will create a vendor directory with your dependencies, if you haven't
used the --no-dev flag when running composer install, you will have
PHPCS ready and waiting in vendor/bin, others will have the same
toolset you're using, so discrepancies between environments will have
been reduced.
--
Daniel Morris
daniel@honestempire.com