From d269917682f76a551844f371220c667b78657266 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Thu, 6 Sep 2018 07:45:00 +0000 Subject: [PATCH] The PHP Classes are now with backslash git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4490 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- renderer.php | 12 ++++++------ route.php | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/renderer.php b/renderer.php index ce5996e..0468866 100644 --- a/renderer.php +++ b/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 (); diff --git a/route.php b/route.php index 3928b6a..3664058 100644 --- a/route.php +++ b/route.php @@ -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 ();