Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save apotashov/fbd07e16e665a3a6ded0b8e477f109fc to your computer and use it in GitHub Desktop.

Select an option

Save apotashov/fbd07e16e665a3a6ded0b8e477f109fc to your computer and use it in GitHub Desktop.

Revisions

  1. Anton Potashov revised this gist May 7, 2021. No changes.
  2. Anton Potashov renamed this gist May 7, 2021. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @ryanjbonnell ryanjbonnell revised this gist Jun 27, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -21,6 +21,7 @@ $ which phpcs
    $ /usr/bin/phpcs -i

    # PHP_CodeSniffer Example Usage: Single File
    $ phpcs --standard=/usr/lib/php/pear/PHP/CodeSniffer/Standard/Drupal ~/example.dev/garland/template.php
    $ phpcs --report=full --standard=Drupal ~/Sites/example.dev/themes/garland/template.php

    # PHP_CodeSniffer Example Usage: Entire Directory
  4. @ryanjbonnell ryanjbonnell revised this gist Jun 26, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,8 @@ $ sudo pear install --alldeps PHP_CodeSniffer

    # Add PEAR to `php.ini` Include Path
    $ nano /etc/php.ini
    include_path = ".:/usr/lib/php/pear"
    ;include_path = ".:/php/includes"
    include_path = ".:/php/includes:/usr/lib/php/pear"

    # Download Drupal Coder Module
    $ cd /usr/local/src
  5. @ryanjbonnell ryanjbonnell revised this gist Jun 26, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Install PEAR (PHP Extension and Application Repository)
    $ php /usr/lib/php/install-pear-nozlib.phar
    $ sudo php /usr/lib/php/install-pear-nozlib.phar
    $ sudo pear upgrade-all
    $ sudo pear install --alldeps PHP_CodeSniffer

  6. @ryanjbonnell ryanjbonnell revised this gist Jun 24, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # Install PEAR (PHP Extension and Application Repository)
    $ php /usr/lib/php/install-pear-nozlib.phar
    $ sudo pear upgrade-all
    $ sudo pear install PHP_CodeSniffer
    $ sudo pear install --alldeps PHP_CodeSniffer

    # Add PEAR to `php.ini` Include Path
    $ nano /etc/php.ini
  7. @ryanjbonnell ryanjbonnell revised this gist Jun 24, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -19,8 +19,8 @@ $ sudo cp -r /usr/local/src/coder/coder_sniffer/Drupal /usr/lib/php/pear/PHP/Cod
    $ which phpcs
    $ /usr/bin/phpcs -i

    # Example Usage: Single File
    # PHP_CodeSniffer Example Usage: Single File
    $ phpcs --report=full --standard=Drupal ~/Sites/example.dev/themes/garland/template.php

    # Example Usage: Entire Directory
    # PHP_CodeSniffer Example Usage: Entire Directory
    $ phpcs --report=full --standard=Drupal --extensions="php,module,inc,install,test,profile,theme" ~/Sites/example.dev/themes/garland
  8. @ryanjbonnell ryanjbonnell revised this gist Jun 24, 2014. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -19,5 +19,8 @@ $ sudo cp -r /usr/local/src/coder/coder_sniffer/Drupal /usr/lib/php/pear/PHP/Cod
    $ which phpcs
    $ /usr/bin/phpcs -i

    # Example Usage
    # Example Usage: Single File
    $ phpcs --report=full --standard=Drupal ~/Sites/example.dev/themes/garland/template.php

    # Example Usage: Entire Directory
    $ phpcs --report=full --standard=Drupal --extensions="php,module,inc,install,test,profile,theme" ~/Sites/example.dev/themes/garland
  9. @ryanjbonnell ryanjbonnell revised this gist Jun 24, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ $ sudo cp -r /usr/local/src/coder/coder_sniffer/Drupal /usr/lib/php/pear/PHP/Cod

    # Verify PHP_CodeSniffer's Installed Coding Standards
    $ which phpcs
    $ phpcs -i
    $ /usr/bin/phpcs -i

    # Example Usage
    $ phpcs --report=full --standard=Drupal ~/Sites/example.dev/themes/garland/template.php
  10. @ryanjbonnell ryanjbonnell revised this gist Jun 24, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,7 @@ $ tar zxf coder-7.x-2.x-dev.tar.gz
    $ sudo cp -r /usr/local/src/coder/coder_sniffer/Drupal /usr/lib/php/pear/PHP/CodeSniffer/Standard

    # Verify PHP_CodeSniffer's Installed Coding Standards
    $ which phpcs
    $ phpcs -i

    # Example Usage
  11. @ryanjbonnell ryanjbonnell revised this gist Jun 24, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Install PEAR
    # Install PEAR (PHP Extension and Application Repository)
    $ php /usr/lib/php/install-pear-nozlib.phar
    $ sudo pear upgrade-all
    $ sudo pear install PHP_CodeSniffer
  12. @ryanjbonnell ryanjbonnell revised this gist Jun 24, 2014. No changes.
  13. @ryanjbonnell ryanjbonnell revised this gist Jun 24, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ $ curl -OL http://ftp.drupal.org/files/projects/coder-7.x-2.x-dev.tar.gz
    $ tar zxf coder-7.x-2.x-dev.tar.gz

    # Add Drupal Coding Standards to PHP_CodeSniffer
    $ sudo cp -r coder/coder_sniffer/Drupal /usr/lib/php/pear/PHP/CodeSniffer/Standard
    $ sudo cp -r /usr/local/src/coder/coder_sniffer/Drupal /usr/lib/php/pear/PHP/CodeSniffer/Standard

    # Verify PHP_CodeSniffer's Installed Coding Standards
    $ phpcs -i
  14. @ryanjbonnell ryanjbonnell created this gist Jun 24, 2014.
    22 changes: 22 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    # Install PEAR
    $ php /usr/lib/php/install-pear-nozlib.phar
    $ sudo pear upgrade-all
    $ sudo pear install PHP_CodeSniffer

    # Add PEAR to `php.ini` Include Path
    $ nano /etc/php.ini
    include_path = ".:/usr/lib/php/pear"

    # Download Drupal Coder Module
    $ cd /usr/local/src
    $ curl -OL http://ftp.drupal.org/files/projects/coder-7.x-2.x-dev.tar.gz
    $ tar zxf coder-7.x-2.x-dev.tar.gz

    # Add Drupal Coding Standards to PHP_CodeSniffer
    $ sudo cp -r coder/coder_sniffer/Drupal /usr/lib/php/pear/PHP/CodeSniffer/Standard

    # Verify PHP_CodeSniffer's Installed Coding Standards
    $ phpcs -i

    # Example Usage
    $ phpcs --report=full --standard=Drupal ~/Sites/example.dev/themes/garland/template.php