Skip to content

Commit

Permalink
Revert "Use Use Symfony YAML PEAR autoloader when available"
Browse files Browse the repository at this point in the history
This reverts commit f35bf18.
  • Loading branch information
sebastianbergmann committed Mar 19, 2013
1 parent f35bf18 commit a09a260
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 40 deletions.
37 changes: 17 additions & 20 deletions PHPUnit/Autoload.php
Expand Up @@ -206,28 +206,25 @@ function ($class)
}
);

if (stream_resolve_include_path('Symfony/Component/Yaml/autoloader.php')) {
require_once 'Symfony/Component/Yaml/autoloader.php';
} 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;
}
// 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;
}
}
);
}
}
);

if (stream_resolve_include_path('PHP/Invoker/Autoload.php')) {
require_once 'PHP/Invoker/Autoload.php';
Expand Down
37 changes: 17 additions & 20 deletions PHPUnit/Autoload.php.in
Expand Up @@ -89,28 +89,25 @@ spl_autoload_register(
}
);

if (stream_resolve_include_path('Symfony/Component/Yaml/autoloader.php')) {
require_once 'Symfony/Component/Yaml/autoloader.php';
} 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;
}
// 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;
}
}
);
}
}
);

if (stream_resolve_include_path('PHP/Invoker/Autoload.php')) {
require_once 'PHP/Invoker/Autoload.php';
Expand Down

0 comments on commit a09a260

Please sign in to comment.