Skip to content

Instantly share code, notes, and snippets.

@joebordes
Last active September 1, 2019 23:23
Show Gist options
  • Select an option

  • Save joebordes/592de8398ba0576c5c7a4d8374bef239 to your computer and use it in GitHub Desktop.

Select an option

Save joebordes/592de8398ba0576c5c7a4d8374bef239 to your computer and use it in GitHub Desktop.
Add files to an executable phar: phpcs security rules
  • Create a temporary directory
  • Copy the phar file you want to add the files to cp /home/joe/bin/phpcs73.phar .
  • create another temporary directory mkdir k
  • copy inside the structure you want to have in the phar. For example, inside the phpcs73.phar file there is a structure like this: src/Standards/ (you can see the contents and structure of your phar with phar list -f file.phar and I want to copy the new rules inside that directory so I create k/src/Standards/Security like this
mkdir k/src
mkdir k/src/Standards
cp -a src/Standards/Security k/src/Standards

which contains all the new rules

  • now I add them to the phar file with phar add -f phpcs73.phar k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment