# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. --- /Users/sclay/NetBeansProjects/Dev_Feedback/lib/limonade.php +++ /Users/sclay/NetBeansProjects/sandbox/gleam/lib/limonade.php @@ -377,7 +377,7 @@ params($route['params']); # 6.2 Load controllers dir - require_once_dir(option('controllers_dir')); + //require_once_dir(option('controllers_dir')); if(is_callable($route['function'])) { @@ -1272,6 +1272,38 @@ return $route; } } + + # if no route found, try checking a controller file foo.php + if(preg_match('@^/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$@', $path, $m)) { + $controllerFile = option('controllers_dir') . '/' . $m[1] . '.php'; + if(is_file($controllerFile)) + { + require_once $controllerFile; + } + # look for foo_bar_GET() + $func = "{$m[1]}_{$m[2]}_{$method}"; + if(function_exists($func)) + { + return array( + 'method' => $method, + 'function' => $func, + 'pattern' => '//', + 'names' => array(), + ); + } + # look for foo_bar() + $func = "{$m[1]}_{$m[2]}"; + if(function_exists($func)) + { + return array( + 'method' => $method, + 'function' => $func, + 'pattern' => '//', + 'names' => array(), + ); + } + } + \ No newline at end of file return false; }