Browse files

Don't use the Symfony Yaml 2.2.0 PEAR autoloader.

  • Loading branch information...
1 parent 50d64e4 commit 280672f0a09062973595db3fc1f5f4b42a4bfa62 @whatthejeff whatthejeff committed Mar 14, 2013
Showing with 32 additions and 42 deletions.
  1. +16 −21 PHPUnit/Autoload.php
  2. +16 −21 PHPUnit/Autoload.php.in
View
37 PHPUnit/Autoload.php
@@ -206,30 +206,25 @@ function ($class)
}
);
-if (stream_resolve_include_path('Symfony/Component/Yaml/autoloader.php')) {
- require_once 'Symfony/Component/Yaml/autoloader.php';
-}
+// 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')
+ )
+ );
-else {
- 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;
- }
+ if (stream_resolve_include_path($file)) {
+ require_once $file;
}
}
- );
-}
+ }
+);
if (stream_resolve_include_path('PHP/Invoker/Autoload.php')) {
require_once 'PHP/Invoker/Autoload.php';
View
37 PHPUnit/Autoload.php.in
@@ -89,30 +89,25 @@ spl_autoload_register(
}
);
-if (stream_resolve_include_path('Symfony/Component/Yaml/autoloader.php')) {
- require_once 'Symfony/Component/Yaml/autoloader.php';
-}
+// 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')
+ )
+ );
-else {
- 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;
- }
+ if (stream_resolve_include_path($file)) {
+ require_once $file;
}
}
- );
-}
+ }
+);
if (stream_resolve_include_path('PHP/Invoker/Autoload.php')) {
require_once 'PHP/Invoker/Autoload.php';

0 comments on commit 280672f

Please sign in to comment.