[ Index ] |
PHP Cross Reference of DokuWiki |
[Summary view] [Print] [Text view]
1 #!/usr/bin/env php 2 <?php 3 /** 4 * Simple command line script to fetch the correct PHPUnit release 5 */ 6 7 $phpVersion = PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION; 8 print "Running PHP $phpVersion\n"; 9 10 switch ($phpVersion) { 11 case '5.6': 12 $phpunit = 'phpunit-5.phar'; 13 break; 14 case '7.0': 15 $phpunit = 'phpunit-6.phar'; 16 break; 17 case '7.1': 18 case '7.2': 19 case '7.3': 20 $phpunit = 'phpunit-7.phar'; 21 break; 22 case '7.4': 23 $phpunit = 'phpunit-7.phar'; 24 // PHP 5 backward compatibility lock to PHPUnit 7 (type hinting) 25 break; 26 default: 27 $phpunit = 'phpunit-7.phar'; 28 29 } 30 31 $url = "https://phar.phpunit.de/$phpunit"; 32 $out = __DIR__ . '/phpunit.phar'; 33 34 $return = 0; 35 try { 36 file_put_contents($out, file_get_contents($url)); 37 } catch (Throwable $e) { 38 fwrite(STDERR, $e->getMessage()); 39 exit(1); 40 } 41 42 chmod($out, 0755); 43 print "Downloaded $phpunit\n"; 44 exit(0);
title
Description
Body
title
Description
Body
title
Description
Body
title
Body