3 namespace CoreFramework\Output\;
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
7 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
12 * @author Roland Haeder <webmaster@shipsimu.org>
14 <<<<<<< HEAD:framework/main/classes/output/class_
15 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
17 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team
18 >>>>>>> Some updates::inc/main/classes/output/class_
19 * @license GNU GPL 3.0 or any newer version
20 * @link http://www.shipsimu.org
22 * This program is free software: you can redistribute it and/or modify
23 * it under the terms of the GNU General Public License as published by
24 * the Free Software Foundation, either version 3 of the License, or
25 * (at your option) any later version.
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU General Public License for more details.
32 * You should have received a copy of the GNU General Public License
33 * along with this program. If not, see <http://www.gnu.org/licenses/>.
35 class ???Output extends BaseOutput implements OutputStreamer, Registerable {
37 * The instance for the singleton design pattern
39 private static $!!!Instance = NULL;
42 * Protected constructor
46 protected function __construct () {
47 // Call parent constructor
48 parent::__construct(__CLASS__);
52 * Create a new !!! output system and set the content type
54 * @param $applicationInstance An instance of a ManageableApplication class
55 * @return $debugInstance An instance of this middleware class
57 public static final function createWebOutput (ManageableApplication $applicationInstance) {
58 // Is the self-instance already set?
59 if (is_null(self::$!!!Instance)) {
60 // Get a new instance and set it
61 self::$!!!Instance = new WebOutput();
63 // Get the content type
64 $contentType = self::$!!!Instance->getConfigInstance()->getConfigEntry('!!!_content_type');
66 // Set the content type
67 if (!empty($contentType)) {
69 FrameworkBootstrap::getResponseInstance()->addHeader('Content-type', $contentType);
74 return self::$!!!Instance;
80 * @param $outStream Stream to output
81 * @param $stripTags Whether HTML tags shall be stripped out
85 public final function output ($outStream = false, $stripTags = false) {
86 $this->partialStub('Please implement this method. outStream()=' . strlen($outStream) . ',stripTags=' . intval($stripTags));
90 * Determines seek position
92 * @return $seekPosition Current seek position
93 * @throws UnsupportedOperationException If this method is called
95 public function determineSeekPosition () {
96 throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
100 * Seek to given offset (default) or other possibilities as fseek() gives.
102 * @param $offset Offset to seek to (or used as "base" for other seeks)
103 * @param $whence Added to offset (default: only use offset to seek to)
104 * @return $status Status of file seek: 0 = success, -1 = failed
105 * @throws UnsupportedOperationException If this method is called
107 public function seek ($offset, $whence = SEEK_SET) {
108 self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] offset=' . $offset . ',whence=' . $whence);
109 throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
115 * @return $size Size (in bytes) of file
116 * @throws UnsupportedOperationException If this method is called
118 public function size () {
119 throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);