Permalink
Browse files

Merge pull request #862 from whatthejeff/yaml_version_juggling

  • Loading branch information...
2 parents 407fa09 + 280672f commit cfb96eb206c47d7c9752177c0c8a35460780fc95 @sebastianbergmann committed Mar 19, 2013
Showing with 43 additions and 4 deletions.
  1. +20 −1 PHPUnit/Autoload.php
  2. +20 −1 PHPUnit/Autoload.php.in
  3. +1 −1 composer.json
  4. +2 −1 package.xml
View
@@ -66,7 +66,6 @@
require_once 'PHP/Timer/Autoload.php';
require_once 'PHPUnit/Framework/MockObject/Autoload.php';
require_once 'Text/Template/Autoload.php';
-require_once 'Symfony/Component/Yaml/autoloader.php';
spl_autoload_register(
function ($class)
@@ -207,6 +206,26 @@ function ($class)
}
);
+// 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';
}
View
@@ -66,7 +66,6 @@ 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 'Symfony/Component/Yaml/autoloader.php';
spl_autoload_register(
function ($class)
@@ -90,6 +89,26 @@ spl_autoload_register(
}
);
+// 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';
}
View
@@ -27,7 +27,7 @@
"phpunit/php-code-coverage": ">=1.2.1,<1.3.0",
"phpunit/php-timer": ">=1.0.2,<1.1.0",
"phpunit/phpunit-mock-objects": ">=1.2.0,<1.3.0",
- "symfony/yaml": ">=2.2.0",
+ "symfony/yaml": ">=2.0.0,<2.3.0",
"ext-dom": "*",
"ext-pcre": "*",
"ext-reflection": "*",
View
@@ -245,7 +245,8 @@
<package>
<name>Yaml</name>
<channel>pear.symfony.com</channel>
- <min>2.2.0</min>
+ <min>2.0.0</min>
+ <max>2.2.99</max>
</package>
<extension>
<name>dom</name>

0 comments on commit cfb96eb

Please sign in to comment.