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 ()
|
public function run ()
|
||||||
{
|
{
|
||||||
if (!@require_once ("domframework/output$this->output.php"))
|
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";
|
$class = "output$this->output";
|
||||||
$reflection = new ReflectionMethod ($class, "out");
|
$reflection = new \ReflectionMethod ($class, "out");
|
||||||
$res = $reflection->invokeArgs (new $class,
|
$res = $reflection->invokeArgs (new $class,
|
||||||
array ($this->result, $this->title,
|
array ($this->result, $this->title,
|
||||||
$this->viewClass, $this->viewMethod, $this->layout,
|
$this->viewClass, $this->viewMethod, $this->layout,
|
||||||
@@ -67,13 +67,13 @@ class renderer
|
|||||||
echo "ERROR: $message\n";
|
echo "ERROR: $message\n";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception ("Unknown flash priority '$priority'", 500);
|
throw new \Exception ("Unknown flash priority '$priority'", 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (! isset ($_SESSION))
|
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)
|
switch ($priority)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
@@ -93,7 +93,7 @@ class renderer
|
|||||||
$_SESSION["renderer"]["flash"][] = array (4, $message);
|
$_SESSION["renderer"]["flash"][] = array (4, $message);
|
||||||
break;
|
break;
|
||||||
default:
|
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)
|
$layoutfile = "views/layout.html", $route = null)
|
||||||
{
|
{
|
||||||
if ($layoutfile !== false && ! file_exists ($layoutfile))
|
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");
|
require_once ("domframework/outputhtml.php");
|
||||||
if ($route === null)
|
if ($route === null)
|
||||||
$route = new route ();
|
$route = new route ();
|
||||||
|
|||||||
@@ -536,7 +536,7 @@ class route
|
|||||||
$rcRegex = @preg_match ($regex, $url, $matches);
|
$rcRegex = @preg_match ($regex, $url, $matches);
|
||||||
if ($rcRegex === false)
|
if ($rcRegex === false)
|
||||||
{
|
{
|
||||||
if (count (error_get_last()))
|
if (count (\error_get_last ()))
|
||||||
$this->error (new \Exception ("Invalid regex provided: $regex : ".
|
$this->error (new \Exception ("Invalid regex provided: $regex : ".
|
||||||
error_get_last()["message"], 500));
|
error_get_last()["message"], 500));
|
||||||
}
|
}
|
||||||
@@ -546,7 +546,7 @@ class route
|
|||||||
echo "==> FOUND REGEX !\n";
|
echo "==> FOUND REGEX !\n";
|
||||||
$this->mapRoute = $route;
|
$this->mapRoute = $route;
|
||||||
$params = array ();
|
$params = array ();
|
||||||
$reflect = new ReflectionFunction ($function);
|
$reflect = new \ReflectionFunction ($function);
|
||||||
foreach ($reflect->getParameters() as $key=>$val)
|
foreach ($reflect->getParameters() as $key=>$val)
|
||||||
{
|
{
|
||||||
if (isset ($matches[$val->name]))
|
if (isset ($matches[$val->name]))
|
||||||
@@ -557,7 +557,7 @@ class route
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$data = call_user_func_array ($function, $params);
|
$data = \call_user_func_array ($function, $params);
|
||||||
if ($this->method () === "GET" && isset ($_SESSION))
|
if ($this->method () === "GET" && isset ($_SESSION))
|
||||||
$_SESSION["domframework"]["route"]["lastGet"] =
|
$_SESSION["domframework"]["route"]["lastGet"] =
|
||||||
"/".$this->requestURL ();
|
"/".$this->requestURL ();
|
||||||
|
|||||||
Reference in New Issue
Block a user