diff options
author | Taufan Aditya <toopay@taufanaditya.com> | 2012-05-24 22:15:19 +0200 |
---|---|---|
committer | Taufan Aditya <toopay@taufanaditya.com> | 2012-05-24 22:15:19 +0200 |
commit | eeca6d265c4e104e3a6b34b8581180d2926b3dba (patch) | |
tree | aadf8f5967a00229ef0c6946298929339fb31eb4 /tests | |
parent | 76e2f034f55b7e0f678f22043eb841b428377fa6 (diff) |
Backward compatibility, in case someone already has vfsStream in their PEAR or other include_path
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Bootstrap.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index 71394720a..1dbd178ca 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -13,11 +13,16 @@ define('APPPATH', PROJECT_BASE.'application/'); define('VIEWPATH', PROJECT_BASE.''); // Get vfsStream either via PEAR or composer -if (file_exists('vfsStream/vfsStream.php')) +foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) { - require_once 'vfsStream/vfsStream.php'; + if (file_exists($path.DIRECTORY_SEPARATOR.'vfsStream/vfsStream.phps')) + { + require_once 'vfsStream/vfsStream.php'; + break; + } } -else + +if ( ! class_exists('vfsStream') && file_exists(PROJECT_BASE.'vendor/autoload.php')) { include_once PROJECT_BASE.'vendor/autoload.php'; class_alias('org\bovigo\vfs\vfsStream', 'vfsStream'); |