Skip to content

Instantly share code, notes, and snippets.

@everzet
Created July 24, 2012 14:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save everzet/3170223 to your computer and use it in GitHub Desktop.
Save everzet/3170223 to your computer and use it in GitHub Desktop.
app/autoload.php for Behat 2.4+ & Symfony2.1+
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
if (!class_exists('Composer\\Autoload\\ClassLoader', false)) {
$loader = require __DIR__.'/../vendor/autoload.php';
} else {
$loader = new Composer\Autoload\ClassLoader();
$loader->register();
}
// intl
if (!function_exists('intl_get_error_code')) {
require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
$loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
}
AnnotationRegistry::registerLoader('class_exists');
return $loader;
@stof
Copy link

stof commented Sep 24, 2012

This is not needed anymore with the latest composer. The standard app/autoload.php should work fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment