The PHP Classes are now with backslash
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4490 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
12
renderer.php
12
renderer.php
@@ -28,9 +28,9 @@ class renderer
|
||||
public function run ()
|
||||
{
|
||||
if (!@require_once ("domframework/output$this->output.php"))
|
||||
throw new Exception ("Renderer '$this->output' not found", 500);
|
||||
throw new \Exception ("Renderer '$this->output' not found", 500);
|
||||
$class = "output$this->output";
|
||||
$reflection = new ReflectionMethod ($class, "out");
|
||||
$reflection = new \ReflectionMethod ($class, "out");
|
||||
$res = $reflection->invokeArgs (new $class,
|
||||
array ($this->result, $this->title,
|
||||
$this->viewClass, $this->viewMethod, $this->layout,
|
||||
@@ -67,13 +67,13 @@ class renderer
|
||||
echo "ERROR: $message\n";
|
||||
break;
|
||||
default:
|
||||
throw new Exception ("Unknown flash priority '$priority'", 500);
|
||||
throw new \Exception ("Unknown flash priority '$priority'", 500);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! isset ($_SESSION))
|
||||
throw new Exception ("No session available to store flash", 500);
|
||||
throw new \Exception ("No session available to store flash", 500);
|
||||
switch ($priority)
|
||||
{
|
||||
case 1:
|
||||
@@ -93,7 +93,7 @@ class renderer
|
||||
$_SESSION["renderer"]["flash"][] = array (4, $message);
|
||||
break;
|
||||
default:
|
||||
throw new Exception ("Unknown flash priority '$priority'", 500);
|
||||
throw new \Exception ("Unknown flash priority '$priority'", 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ class renderer
|
||||
$layoutfile = "views/layout.html", $route = null)
|
||||
{
|
||||
if ($layoutfile !== false && ! file_exists ($layoutfile))
|
||||
throw new Exception ("Layout file $layoutfile not found", 500);
|
||||
throw new \Exception ("Layout file $layoutfile not found", 500);
|
||||
require_once ("domframework/outputhtml.php");
|
||||
if ($route === null)
|
||||
$route = new route ();
|
||||
|
||||
@@ -536,7 +536,7 @@ class route
|
||||
$rcRegex = @preg_match ($regex, $url, $matches);
|
||||
if ($rcRegex === false)
|
||||
{
|
||||
if (count (error_get_last()))
|
||||
if (count (\error_get_last ()))
|
||||
$this->error (new \Exception ("Invalid regex provided: $regex : ".
|
||||
error_get_last()["message"], 500));
|
||||
}
|
||||
@@ -546,7 +546,7 @@ class route
|
||||
echo "==> FOUND REGEX !\n";
|
||||
$this->mapRoute = $route;
|
||||
$params = array ();
|
||||
$reflect = new ReflectionFunction ($function);
|
||||
$reflect = new \ReflectionFunction ($function);
|
||||
foreach ($reflect->getParameters() as $key=>$val)
|
||||
{
|
||||
if (isset ($matches[$val->name]))
|
||||
@@ -557,7 +557,7 @@ class route
|
||||
|
||||
try
|
||||
{
|
||||
$data = call_user_func_array ($function, $params);
|
||||
$data = \call_user_func_array ($function, $params);
|
||||
if ($this->method () === "GET" && isset ($_SESSION))
|
||||
$_SESSION["domframework"]["route"]["lastGet"] =
|
||||
"/".$this->requestURL ();
|
||||
|
||||
Reference in New Issue
Block a user