View Issue Details

IDProjectCategoryView StatusLast Update
0000195Adventure PHP FrameworkNeues Feature // New Featurepublic2015-10-12 12:20
ReporterChristianAchatzAssigned ToChristianAchatz 
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version2.0 
Target Version2.1Fixed in Version2.1 
Summary0000195: Add convenience methods to HeaderManager to send e.g. 404 or 500
DescriptionATM, 500 errors have to be sent via

HeaderManager::send($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);

With this issue, please add some convenience methods to easily send standard headers.
TagsNo tags attached.
Codereferenz: ([Datei]:[Zeile])
Namespacetools

Activities

ChristianAchatz

2014-05-26 09:43

administrator   ~0000361

Patch suggestion:
~~~~~~~~~~~~~~~~~

   /**
    * @public
    * @static
    *
    * Sends a 404 answer back to the client.
    *
    * @param bool $exitAfterForward True in case code execution is stopped after this action, false otherwise.
    *
    * @author Christian Achatz
    * @version
    * Version 0.1, 26.05.2014

    */
   public static function sendNotFound($exitAfterForward = true) {
      self::send($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true, 404);

      if (self::$EXIT_AFTER_FORWARD === true && $exitAfterForward === true) {
         exit(0);
      }
   }

   /**
    * @public
    * @static
    *
    * Sends a 500 answer back to the client.
    *
    * @param bool $exitAfterForward True in case code execution is stopped after this action, false otherwise.
    *
    * @author Christian Achatz
    * @version
    * Version 0.1, 26.05.2014

    */
   public static function sendServerError($exitAfterForward = true) {
      self::send($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);

      if (self::$EXIT_AFTER_FORWARD === true && $exitAfterForward === true) {
         exit(0);
      }
   }

Issue History

Date Modified Username Field Change
2014-05-26 09:38 ChristianAchatz New Issue
2014-05-26 09:38 ChristianAchatz Status new => assigned
2014-05-26 09:38 ChristianAchatz Assigned To => ChristianAchatz
2014-05-26 09:43 ChristianAchatz Note Added: 0000361
2014-05-27 20:29 ChristianAchatz Status assigned => resolved
2014-05-27 20:29 ChristianAchatz Fixed in Version => 2.1
2014-05-27 20:29 ChristianAchatz Resolution open => fixed
2014-06-08 11:57 ChristianAchatz Summary Add convenience methods to HaderManager to send e.g. 404 or 500 => Add convenience methods to HeaderManager to send e.g. 404 or 500
2015-10-12 12:20 ChristianAchatz Status resolved => closed