[limb-svn] r5937 - in 3.x/trunk/limb/web_app: src/controller template

svn at limb-project.com svn at limb-project.com
Tue Jun 5 11:13:47 MSD 2007


Author: pachanga
Date: 2007-06-05 11:13:46 +0400 (Tue, 05 Jun 2007)
New Revision: 5937
URL: http://fisheye.limb-project.com/changelog/limb/?cs=5937

Added:
   3.x/trunk/limb/web_app/src/controller/ServerErrorController.class.php
   3.x/trunk/limb/web_app/template/server_error.html
Modified:
   3.x/trunk/limb/web_app/src/controller/lmbController.class.php
   3.x/trunk/limb/web_app/template/not_found.html
Log:
-- lmbController :: forwardTo500() added, it forwards to ServerErrorController
-- ServerErrorController class and server_error.html template added 

Added: 3.x/trunk/limb/web_app/src/controller/ServerErrorController.class.php
===================================================================
--- 3.x/trunk/limb/web_app/src/controller/ServerErrorController.class.php	                        (rev 0)
+++ 3.x/trunk/limb/web_app/src/controller/ServerErrorController.class.php	2007-06-05 07:13:46 UTC (rev 5937)
@@ -0,0 +1,25 @@
+<?php
+/*
+ * Limb PHP Framework
+ *
+ * @link http://limb-project.com
+ *
+ * @copyright  Copyright &copy; 2004-2007 BIT
+ * @license    LGPL http://www.gnu.org/copyleft/lesser.html
+ * @version    $Id: NotFoundController.class.php 5933 2007-06-04 13:06:23Z pachanga $
+ * @package    $package$
+ */
+
+lmb_require('limb/web_app/src/controller/lmbController.class.php');
+
+class ServerErrorController extends lmbController
+{
+  function doDisplay()
+  {
+    $this->response->header('HTTP/1.x 500 Server Error');
+    $this->resetView();
+    $this->setTemplate('server_error.html');
+  }
+}
+
+?>

Modified: 3.x/trunk/limb/web_app/src/controller/lmbController.class.php
===================================================================
--- 3.x/trunk/limb/web_app/src/controller/lmbController.class.php	2007-06-05 06:30:30 UTC (rev 5936)
+++ 3.x/trunk/limb/web_app/src/controller/lmbController.class.php	2007-06-05 07:13:46 UTC (rev 5937)
@@ -1,13 +1,13 @@
 <?php
-/*
- * Limb PHP Framework
- *
- * @link http://limb-project.com
- *
- * @copyright  Copyright &copy; 2004-2007 BIT
- * @license    LGPL http://www.gnu.org/copyleft/lesser.html
- * @version    $Id$
- * @package    $package$
+/*
+ * Limb PHP Framework
+ *
+ * @link http://limb-project.com
+ *
+ * @copyright  Copyright &copy; 2004-2007 BIT
+ * @license    LGPL http://www.gnu.org/copyleft/lesser.html
+ * @version    $Id$
+ * @package    $package$
  */
 lmb_require('limb/web_app/src/controller/lmbAbstractController.class.php');
 lmb_require('limb/validation/src/lmbErrorList.class.php');
@@ -153,6 +153,11 @@
     return $this->forward('not_found', 'display');
   }
 
+  function forwardTo500()
+  {
+    return $this->forward('server_error', 'display');
+  }
+
   function flashError($message)
   {
     $this->toolkit->flashError($message);

Modified: 3.x/trunk/limb/web_app/template/not_found.html
===================================================================
--- 3.x/trunk/limb/web_app/template/not_found.html	2007-06-05 06:30:30 UTC (rev 5936)
+++ 3.x/trunk/limb/web_app/template/not_found.html	2007-06-05 07:13:46 UTC (rev 5937)
@@ -1,8 +1,8 @@
 <html>
-<head><title>404 Not Found Error. Could not dispatch the request!</title></head>
+<head><title>404 Page Not Found Error.</title></head>
 <body>
 
-<h3>404 Not Found Error. Could not dispatch the request!</h3>
+<h3>404 Page Not Found Error.</h3>
 <p>Check if such a controller and template exist, and action is valid.</p>
 
 </body>

Added: 3.x/trunk/limb/web_app/template/server_error.html
===================================================================
--- 3.x/trunk/limb/web_app/template/server_error.html	                        (rev 0)
+++ 3.x/trunk/limb/web_app/template/server_error.html	2007-06-05 07:13:46 UTC (rev 5937)
@@ -0,0 +1,9 @@
+<html>
+<head><title>500 Server Error.</title></head>
+<body>
+
+<h3>500 Server Error.</h3>
+<p>Ooops, something terrible happened. We're working on it...</p>
+
+</body>
+</html>



More information about the limb-svn mailing list