سؤال

I have installed Pear and all the package I needed. (example like PHP_CodeSniffer, PhpDocumentor). I confirmed this package has installed using

C:\wamp\www>pear list

but when I try to use this comment on my windows comment prompt I am getting error like

'phpcs' is not recognized as an internal or external command 

Please give me any suggestion.

هل كانت مفيدة؟

المحلول 2

I have fixed this issue as per the below link.

Alternative way to install PHP_CodeSniffer is to clone repository from GitHub:

git clone git://github.com/squizlabs/PHP_CodeSniffer.git
cd PHP_CodeSniffer
php scripts/phpcs -h

http://blog.a2design.biz/blog/2012/08/19/automation-of-php-coding-style-check-using-git-hooks/

نصائح أخرى

You probably have some issue with path environnent variable (sometimes it's good to reboot to force environment refresh)

But in your case, you cvan specify the complete path to each exe :

C:\>path\to\php\bin\php.exe path\to\phpcs path\to\file.php

You need to have the pear bin directory in your PATH.

See http://pear.php.net/manual/en/installation.checking.php#13557

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top