use stream_resolve_include_path
[phorkie.git] / scripts / search.php
index 4de514f06ea6af2c5c273dd66f10b40815f525ca..d7d1b643ee1b537c608e8cef629d0cd6b54f4c54 100644 (file)
@@ -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;
         }
     }