Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/Horde/Test/Autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public static function init()
spl_autoload_register(
function($class) {
$filename = Horde_Test_Autoload::resolve($class);
$err_mask = error_reporting() & ~E_WARNING;
$old_err = error_reporting($err_mask);
include "$filename.php";
error_reporting($old_err);
$path = stream_resolve_include_path($filename);
if ($path) {
include $path;
}
},
true,
true
Expand Down
14 changes: 9 additions & 5 deletions lib/Horde/Test/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public static function bootstrap($dir, $no_autoload = false)
* We can safely move this before the runonce check
* as it will not load the same autoload file twice
*/

if (!$no_autoload) {
// Find composer autoloader if possible
$path = __DIR__;
Expand All @@ -64,12 +65,15 @@ public static function bootstrap($dir, $no_autoload = false)
while ($base != '/' && basename($base) != 'Horde') {
$base = dirname($base);
}
$base = dirname($base);
if ($base) {
set_include_path(
$base . PATH_SEPARATOR . $base . '/../lib' . PATH_SEPARATOR . get_include_path()
);
if ($base && $base != '/') {
$include = dirname($base);
$include2 = dirname($include) . '/lib';
if ($include != $include2) {
$include .= PATH_SEPARATOR . $include2;
}
set_include_path($include . PATH_SEPARATOR . get_include_path());
}

if (!class_exists(\Horde_Test_Autoload::class)) {
require_once 'Horde/Test/Autoload.php';
}
Expand Down