svn: /pear/packages/PHP_CodeSniffer/trunk/ CodeSniffer/CLI.php package.xml

From: Date: Tue, 07 Sep 2010 03:42:02 +0000
Subject: svn: /pear/packages/PHP_CodeSniffer/trunk/ CodeSniffer/CLI.php package.xml
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-60290@lists.php.net to get a copy of this message
squiz Tue, 07 Sep 2010 03:42:02 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=303125 Log: Added -d command line argument to set php.ini settings while running Changed paths: U pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/CLI.php U pear/packages/PHP_CodeSniffer/trunk/package.xml Modified: pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/CLI.php =================================================================== --- pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/CLI.php 2010-09-07 03:39:01 UTC (rev 303124) +++ pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/CLI.php 2010-09-07 03:42:02 UTC (rev 303125) @@ -174,6 +174,10 @@ for ($i = 1; $i < $_SERVER['argc']; $i++) { $arg = $_SERVER['argv'][$i]; + if ($arg === '') { + continue; + } + if ($arg{0} === '-') { if ($arg === '-' || $arg === '--') { // Empty argument, ignore it. @@ -205,7 +209,7 @@ /** - * Processes a sort (-e) command line argument. + * Processes a short (-e) command line argument. * * @param string $arg The command line argument. * @param int $pos The position of the argument on the command line. @@ -238,6 +242,16 @@ case 'a' : $values['interactive'] = true; break; + case 'd' : + $ini = explode('=', $_SERVER['argv'][($pos + 1)]); + $_SERVER['argv'][($pos + 1)] = ''; + if (isset($ini[1]) === true) { + ini_set($ini[0], $ini[1]); + } else { + ini_set($ini[0], true); + } + + break; case 'n' : $values['warningSeverity'] = 0; break; @@ -582,7 +596,7 @@ */ public function printUsage() { - echo 'Usage: phpcs [-nwlsavi] [--extensions=<extensions>] [--ignore=<patterns>]'.PHP_EOL; + echo 'Usage: phpcs [-nwlsavi] [-d key[=value]] [--extensions=<extensions>] [--ignore=<patterns>]'.PHP_EOL; echo ' [--report=<report>] [--report-width=<reportWidth>] [--report-file=<reportfile>]'.PHP_EOL; echo ' [--severity=<severity>] [--error-severity=<severity>] [--warning-severity=<severity>]'.PHP_EOL; echo ' [--config-set key value] [--config-delete key] [--config-show]'.PHP_EOL; @@ -595,25 +609,23 @@ echo ' -a Run interactively'.PHP_EOL; echo ' -v[v][v] Print verbose output'.PHP_EOL; echo ' -i Show a list of installed coding standards'.PHP_EOL; + echo ' -d Set the [key] php.ini value to [value] or [true] if value is omitted'.PHP_EOL; echo ' --help Print this help message'.PHP_EOL; echo ' --version Print version information'.PHP_EOL; echo ' <file> One or more files and/or directories to check'.PHP_EOL; echo ' <extensions> A comma separated list of file extensions to check'.PHP_EOL; echo ' (only valid if checking a directory)'.PHP_EOL; - echo ' <patterns> A comma separated list of patterns that are used'.PHP_EOL; - echo ' to ignore directories and files'.PHP_EOL; + echo ' <patterns> A comma separated list of patterns to ignore files and directories'.PHP_EOL; echo ' <encoding> The encoding of the files being checked (default is iso-8859-1)'.PHP_EOL; echo ' <sniffs> A comma separated list of sniff codes to limit the check to'.PHP_EOL; echo ' (all sniffs must be part of the specified standard)'.PHP_EOL; - echo ' <severity> The minimum severity that an error or warning must have'.PHP_EOL; - echo ' for it to be displayed.'.PHP_EOL; - echo ' <standard> The name of the coding standard to use'.PHP_EOL; + echo ' <severity> The minimum severity required to display an error or warning'.PHP_EOL; + echo ' <standard> The name or path of the coding standard to use'.PHP_EOL; echo ' <tabWidth> The number of spaces each tab represents'.PHP_EOL; echo ' <generator> The name of a doc generator to use'.PHP_EOL; echo ' (forces doc generation instead of checking)'.PHP_EOL; - echo ' <report> Print either the "full", "xml", "checkstyle",'.PHP_EOL; - echo ' "csv", "emacs", "source", "summary",'.PHP_EOL; - echo ' "svnblame" or "gitblame" report'.PHP_EOL; + echo ' <report> Print either the "full", "xml", "checkstyle", "csv", "emacs"'.PHP_EOL; + echo ' "source", "summary", "svnblame" or "gitblame" report'.PHP_EOL; echo ' (the "full" report is printed by default)'.PHP_EOL; echo ' <reportWidth> How many columns wide screen reports should be printed'.PHP_EOL; echo ' <reportfile> Write the report to the specified file path'.PHP_EOL; Modified: pear/packages/PHP_CodeSniffer/trunk/package.xml =================================================================== --- pear/packages/PHP_CodeSniffer/trunk/package.xml 2010-09-07 03:39:01 UTC (rev 303124) +++ pear/packages/PHP_CodeSniffer/trunk/package.xml 2010-09-07 03:42:02 UTC (rev 303125) @@ -26,6 +26,9 @@ </stability> <license uri="http://matrix.squiz.net/developer/tools/php_cs/licence">BSD License</license> <notes> + - Added -d command line argument to set php.ini settings while running + -- Usage is: phpcs -d memory_limit=32M -d ... + -- Thanks to Ben Selby for the patch - Added Generic ClosureLinterSniff to run Google's gjslint over your JS files - Fixed issue with Squiz FunctionCommentSniff reporting incorrect type hint when default value uses namespace -- Thanks to Anti Veeranna for the patch

« previous php.pear.cvs (#60290) next »