5 * @author Roland Haeder <webmaster@shipsimu.org>
7 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
8 * @license GNU GPL 3.0 or any newer version
9 * @link http://www.shipsimu.org
11 * This program is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 class ???Output extends BaseOutput implements OutputStreamer, Registerable {
26 * The instance for the singleton design pattern
28 private static $!!!Instance = NULL;
31 * Protected constructor
35 protected function __construct () {
36 // Call parent constructor
37 parent::__construct(__CLASS__);
41 * Create a new !!! output system and set the content type
43 * @param $applicationInstance An instance of a ManageableApplication class
44 * @return $debugInstance An instance of this middleware class
46 public static final function createWebOutput (ManageableApplication $applicationInstance) {
47 // Is the self-instance already set?
48 if (is_null(self::$!!!Instance)) {
49 // Get a new instance and set it
50 self::$!!!Instance = new WebOutput();
52 // Get the content type
53 $contentType = self::$!!!Instance->getConfigInstance()->getConfigEntry('!!!_content_type');
55 // Set the content type
56 if (!empty($contentType)) {
58 $applicationInstance->getResponseInstance()->addHeader('Content-type', $contentType);
63 return self::$!!!Instance;
69 * @param $outStream Stream to output
70 * @param $stripTags Whether HTML tags shall be stripped out
74 public final function output ($outStream = FALSE, $stripTags = FALSE) {
75 $this->partialStub('Please implement this method. outStream()=' . strlen($outStream) . ',stripTags=' . intval($stripTags));
79 * Determines seek position
81 * @return $seekPosition Current seek position
82 * @throws UnsupportedOperationException If this method is called
84 public function determineSeekPosition () {
85 throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
89 * Seek to given offset (default) or other possibilities as fseek() gives.
91 * @param $offset Offset to seek to (or used as "base" for other seeks)
92 * @param $whence Added to offset (default: only use offset to seek to)
93 * @return $status Status of file seek: 0 = success, -1 = failed
94 * @throws UnsupportedOperationException If this method is called
96 public function seek ($offset, $whence = SEEK_SET) {
97 self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] offset=' . $offset . ',whence=' . $whence);
98 throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
104 * @return $size Size (in bytes) of file
105 * @throws UnsupportedOperationException If this method is called
107 public function size () {
108 throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);