Permalink
Browse files

updated init script to use autoloading

  • Loading branch information...
1 parent 06bcf5e commit 37f328e25e3d9d1a8121d882d08675d5e3133adc @everzet everzet committed May 20, 2012
Showing with 7 additions and 9 deletions.
  1. +7 −9 init.php
View
@@ -1,21 +1,19 @@
<?php
/*
- * This file is part of the Behat\MinkExtension
+ * This file is part of the Behat
*
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
-require_once __DIR__.'/src/Behat/MinkExtension/Compiler/SelectorsPass.php';
-require_once __DIR__.'/src/Behat/MinkExtension/Compiler/SessionsPass.php';
-require_once __DIR__.'/src/Behat/MinkExtension/Context/MinkAwareContextInterface.php';
-require_once __DIR__.'/src/Behat/MinkExtension/Context/MinkAwareContextInitializer.php';
-require_once __DIR__.'/src/Behat/MinkExtension/Context/RawMinkContext.php';
-require_once __DIR__.'/src/Behat/MinkExtension/Context/MinkContext.php';
-require_once __DIR__.'/src/Behat/MinkExtension/Configuration.php';
-require_once __DIR__.'/src/Behat/MinkExtension/Extension.php';
+spl_autoload_register(function($class) {
+ if (false !== strpos($class, 'Behat\\MinkExtension')) {
+ require_once(__DIR__.'/src/'.str_replace('\\', '/', $class).'.php');
+ return true;
+ }
+}, true, false);
return new Behat\MinkExtension\Extension;

0 comments on commit 37f328e

Please sign in to comment.