]> git.wh0rd.org - tt-rss.git/blobdiff - public.php
modify include path order (closes #514)
[tt-rss.git] / public.php
index 2cec82962b786a6f75b544d3b0da52520f9e5fcb..59e0ef2e3696082acbc9cb9ab2f017a60817747d 100644 (file)
@@ -1,5 +1,6 @@
 <?php
-       set_include_path(get_include_path() . PATH_SEPARATOR . "include");
+       set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
+               get_include_path());
 
        /* remove ill effects of magic quotes */
 
 
        if (!init_connection($link)) return;
 
-       if (ENABLE_GZIP_OUTPUT) {
+       if (ENABLE_GZIP_OUTPUT && function_exists("ob_gzhandler")) {
                ob_start("ob_gzhandler");
        }
 
-       function __autoload($class) {
-               $file = "classes/".strtolower(basename($class)).".php";
-               if (file_exists($file)) {
-                       require $file;
-               }
-       }
-
        $method = $_REQUEST["op"];
 
-       $handler = new Public_Handler($link, $_REQUEST);
+       $handler = new Handler_Public($link, $_REQUEST);
 
-       if ($handler) {
-               if ($handler->before()) {
-                       if ($method && method_exists($handler, $method)) {
-                               $handler->$method();
-                       } else if (method_exists($handler, 'index')) {
-                               $handler->index();
-                       }
-                       $handler->after();
-                       return;
+       if ($handler->before($method)) {
+               if ($method && method_exists($handler, $method)) {
+                       $handler->$method();
+               } else if (method_exists($handler, 'index')) {
+                       $handler->index();
                }
+               $handler->after();
+               return;
        }
 
        header("Content-Type: text/plain");