use stream_resolve_include_path
[phorkie.git] / www / www-header.php
index c99f8c8ed774b54610ced1f97d7df067612b6d28..ef948e458782faa42996269236ab1c93618c71d5 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;
         }
     }