Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated init script to use autoloading

  • Loading branch information...
commit 37f328e25e3d9d1a8121d882d08675d5e3133adc 1 parent 06bcf5e
@everzet everzet authored
Showing with 7 additions and 9 deletions.
  1. +7 −9 init.php
View
16 init.php
@@ -1,7 +1,7 @@
<?php
/*
- * This file is part of the Behat\MinkExtension
+ * This file is part of the Behat
*
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
*
@@ -9,13 +9,11 @@
* 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;
Please sign in to comment.
Something went wrong with that request. Please try again.