~ballot/wordpress/openstack-objectstorage-bis

« back to all changes in this revision

Viewing changes to vendor/phpunit/phpunit/build/phar-autoload.php.in

  • Committer: Jacek Nykis
  • Date: 2015-02-11 15:35:31 UTC
  • Revision ID: jacek.nykis@canonical.com-20150211153531-hmy6zi0ov2qfkl0b
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env php
 
2
<?php
 
3
if (__FILE__ == realpath($GLOBALS['_SERVER']['SCRIPT_NAME'])) {
 
4
    $phar    = realpath($GLOBALS['_SERVER']['SCRIPT_NAME']);
 
5
    $execute = true;
 
6
} else {
 
7
    $files   = get_included_files();
 
8
    $phar    = $files[0];
 
9
    $execute = false;
 
10
}
 
11
 
 
12
define('__PHPUNIT_PHAR__', str_replace(DIRECTORY_SEPARATOR, '/', $phar));
 
13
define('__PHPUNIT_PHAR_ROOT__', 'phar://___PHAR___');
 
14
 
 
15
spl_autoload_register(
 
16
  function ($class)
 
17
  {
 
18
      static $classes = NULL;
 
19
 
 
20
      if ($classes === NULL) {
 
21
          $classes = array(
 
22
            ___CLASSLIST___
 
23
          );
 
24
      }
 
25
 
 
26
      $class = strtolower($class);
 
27
 
 
28
      if (isset($classes[$class])) {
 
29
          require __PHPUNIT_PHAR_ROOT__ . $classes[$class];
 
30
      }
 
31
  }
 
32
);
 
33
 
 
34
Phar::mapPhar('___PHAR___');
 
35
 
 
36
if ($execute) {
 
37
    if (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == '--manifest') {
 
38
        print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/manifest.txt');
 
39
        exit;
 
40
    }
 
41
 
 
42
    PHPUnit_TextUI_Command::main();
 
43
}
 
44
 
 
45
__HALT_COMPILER();