From e0f69ba3ebc233b416eb83553bb9460075195d1a Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 14 May 2014 17:58:10 +0200 Subject: [PATCH] use stream_resolve_include_path --- scripts/index.php | 4 +--- scripts/search.php | 4 +--- www/www-header.php | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/scripts/index.php b/scripts/index.php index 5da912e..c1e67af 100644 --- a/scripts/index.php +++ b/scripts/index.php @@ -9,9 +9,7 @@ set_include_path( spl_autoload_register( function ($class) { $file = str_replace(array('\\', '_'), '/', $class) . '.php'; - $hdl = @fopen($file, 'r', true); - if ($hdl !== false) { - fclose($hdl); + if (stream_resolve_include_path($file)) { require $file; } } diff --git a/scripts/search.php b/scripts/search.php index 4de514f..d7d1b64 100644 --- a/scripts/search.php +++ b/scripts/search.php @@ -9,9 +9,7 @@ set_include_path( spl_autoload_register( function ($class) { $file = str_replace(array('\\', '_'), '/', $class) . '.php'; - $hdl = @fopen($file, 'r', true); - if ($hdl !== false) { - fclose($hdl); + if (stream_resolve_include_path($file)) { require $file; } } diff --git a/www/www-header.php b/www/www-header.php index c99f8c8..ef948e4 100644 --- a/www/www-header.php +++ b/www/www-header.php @@ -9,9 +9,7 @@ set_include_path( spl_autoload_register( function ($class) { $file = str_replace(array('\\', '_'), '/', $class) . '.php'; - $hdl = @fopen($file, 'r', true); - if ($hdl !== false) { - fclose($hdl); + if (stream_resolve_include_path($file)) { require $file; } } -- 2.30.2