- 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 withphar list -f file.pharand I want to copy the new rules inside that directory so I createk/src/Standards/Securitylike 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