data
6 years ago
lib
6 years ago
.editorconfig
6 years ago
.gitignore
6 years ago
CHANGELOG.md
6 years ago
LICENSE
6 years ago
README.md
6 years ago
VERSION
6 years ago
build.php
6 years ago
composer.json
6 years ago
init.php
6 years ago
update_certs.php
6 years ago
build.php
37 lines
| 1 | #!/usr/bin/env php |
| 2 | <?php |
| 3 | chdir(dirname(__FILE__)); |
| 4 | |
| 5 | $autoload = (int)$argv[1]; |
| 6 | $returnStatus = null; |
| 7 | |
| 8 | if (!$autoload) { |
| 9 | // Modify composer to not autoload Stripe |
| 10 | $composer = json_decode(file_get_contents('composer.json'), true); |
| 11 | unset($composer['autoload']); |
| 12 | unset($composer['require-dev']['squizlabs/php_codesniffer']); |
| 13 | file_put_contents('composer.json', json_encode($composer, JSON_PRETTY_PRINT)); |
| 14 | } |
| 15 | |
| 16 | passthru('composer update', $returnStatus); |
| 17 | if ($returnStatus !== 0) { |
| 18 | exit(1); |
| 19 | } |
| 20 | |
| 21 | if ($autoload) { |
| 22 | // Only run CS on 1 of the 2 environments |
| 23 | passthru( |
| 24 | './vendor/bin/phpcs --standard=PSR2 -n lib tests *.php', |
| 25 | $returnStatus |
| 26 | ); |
| 27 | if ($returnStatus !== 0) { |
| 28 | exit(1); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | $config = $autoload ? 'phpunit.xml' : 'phpunit.no_autoload.xml'; |
| 33 | passthru("./vendor/bin/phpunit -c $config", $returnStatus); |
| 34 | if ($returnStatus !== 0) { |
| 35 | exit(1); |
| 36 | } |
| 37 |