diff options
Diffstat (limited to 'Autoload.php.in')
-rw-r--r-- | Autoload.php.in | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/Autoload.php.in b/Autoload.php.in new file mode 100644 index 0000000..83fd1fb --- /dev/null +++ b/Autoload.php.in @@ -0,0 +1,74 @@ +<?php +/* Inspipred from Autoload from version 3.7 */ + +/* Required */ +require_once 'File/Iterator/Autoload.php'; +require_once 'PHP/CodeCoverage/Autoload.php'; +require_once 'PHP/Timer/Autoload.php'; +require_once 'PHPUnit/Framework/MockObject/Autoload.php'; +require_once 'Text/Template/Autoload.php'; +require_once 'PHP/Invoker/Autoload.php'; +require_once 'SebastianBergmann/Diff/autoload.php'; +require_once 'SebastianBergmann/Environment/autoload.php'; +require_once 'SebastianBergmann/Exporter/autoload.php'; +require_once 'SebastianBergmann/Version/autoload.php'; + +spl_autoload_register( + function ($class) + { + static $classes = NULL; + static $path = NULL; + + if ($classes === NULL) { + $classes = array( + ___CLASSLIST___ + ); + + $path = dirname(__FILE__); + } + + $cn = strtolower($class); + + if (isset($classes[$cn])) { + require $path . $classes[$cn]; + } + } +); + +// Symfony Yaml autoloader +spl_autoload_register( + function ($class) { + if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Yaml')) { + $file = sprintf( + 'Symfony/Component/Yaml%s.php', + + substr( + str_replace('\\', '/', $class), + strlen('Symfony\Component\Yaml') + ) + ); + + if (stream_resolve_include_path($file)) { + require_once $file; + } + } + } +); + +/* Optional */ + +if (stream_resolve_include_path('PHPUnit/Extensions/Database/Autoload.php')) { + require_once 'PHPUnit/Extensions/Database/Autoload.php'; +} + +if (stream_resolve_include_path('PHPUnit/Extensions/SeleniumCommon/Autoload.php')) { + require_once 'PHPUnit/Extensions/SeleniumCommon/Autoload.php'; +} + +else if (stream_resolve_include_path('PHPUnit/Extensions/SeleniumTestCase/Autoload.php')) { + require_once 'PHPUnit/Extensions/SeleniumTestCase/Autoload.php'; +} + +if (stream_resolve_include_path('PHPUnit/Extensions/Story/Autoload.php')) { + require_once 'PHPUnit/Extensions/Story/Autoload.php'; +} |