class_WebOutput.php

Go to the documentation of this file.
00001 <?php
00025 class WebOutput extends BaseFrameworkSystem implements OutputStreamer, Registerable {
00029         private static $webInstance = null;
00030 
00036         protected function __construct () {
00037                 // Call parent constructor
00038                 parent::__construct(__CLASS__);
00039         }
00040 
00047         public final static function createWebOutput ($contentType) {
00048                 // Is there no instance?
00049                 if (is_null(self::$webInstance)) {
00050                         // Cast the content-type to string and trim it
00051                         $contentType = (string) $contentType;
00052                         $contentType = trim($contentType);
00053 
00054                         // Set the content type
00055                         if (!empty($contentType)) {
00056                                 @header(sprintf("Content-type: %s",
00057                                         $contentType
00058                                 ));
00059                         }
00060 
00061                         // Get a new instance and set it
00062                         self::$webInstance = new WebOutput();
00063                 }
00064 
00065                 // Return instance
00066                 return self::$webInstance;
00067         }
00068 
00076         public function assignVariable($var, $value) {
00077                 // Stub message because we don't have it here
00078                 trigger_error(__METHOD__.": Stub!");
00079         }
00080 
00086         public final function output ($outStream=false) {
00087                 print(stripslashes($outStream));
00088         }
00089 }
00090 
00091 // [EOF]
00092 ?>

Generated on Mon Dec 8 01:06:46 2008 for Ship-Simulator by  doxygen 1.5.6