From ec32a70ec2cd1214403dcbee9f9015d3c2b487da Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 27 Dec 2010 14:16:49 +0100 Subject: [PATCH] added fallback view simplifications --- backend/lib/Model/Entity.php | 2 +- backend/lib/Router.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/lib/Model/Entity.php b/backend/lib/Model/Entity.php index e3a8e97..e7c6a02 100644 --- a/backend/lib/Model/Entity.php +++ b/backend/lib/Model/Entity.php @@ -99,7 +99,7 @@ abstract class Entity { $invalidProperties = array_diff(array_keys($this->getProperties()), $this->getDefinition()->getValidProperties()); if (count($missingProperties) > 0) { - throw new \Exception('Entity "' . $this->getType() . '" requires propert' . ((count($missingProperties) == 1) ? 'y' : 'ies') . ': "' . implode(', ', $missingProperties) . '"'); + throw new \Exception('Entity \'' . $this->getType() . '\' requires propert' . ((count($missingProperties) == 1) ? 'y' : 'ies') . ": '" . implode(', ', $missingProperties) . "'"); } if (count($invalidProperties) > 0) { diff --git a/backend/lib/Router.php b/backend/lib/Router.php index dba9bd5..28f8407 100644 --- a/backend/lib/Router.php +++ b/backend/lib/Router.php @@ -118,6 +118,8 @@ class Router { $this->operation = self::getOperation($request); if (empty(self::$viewMapping[$this->format])) { + $this->view = new View\JSON($request, $response); // fallback view + if (empty($this->format)) { throw new \Exception('Missing format'); } @@ -128,10 +130,6 @@ class Router { $class = self::$viewMapping[$this->format]; $this->view = new $class($request, $response, $this->format); - - // some general debugging information - //Util\Debug::log('_SERVER', $_SERVER); - //Util\Debug::log('PATH_INFO', $this->pathInfo); } /**