|
17 | 17 |
|
18 | 18 | /** |
19 | 19 | * An object designed to "hold" content - not visible itself. |
| 20 | + * |
| 21 | + * Class Document |
| 22 | + * |
| 23 | + * @property array $allItems Array of links to all embedded objects |
| 24 | + * @property object $lastItem A link to the last element added |
| 25 | + * @property bool $pageClosed Is page closed for adding new contents? |
| 26 | + * @property array $raiseItems Which objects to take over from the accepting object |
| 27 | + * @property \Ease\WebPage $webPage A link to the base object of the page |
20 | 28 | */ |
21 | 29 | class Document extends Container |
22 | 30 | { |
@@ -133,25 +141,31 @@ public function redirect($url): void |
133 | 141 | } else { |
134 | 142 | header('Location: '.$url); |
135 | 143 | } |
136 | | - /** |
137 | | - * Class Document |
138 | | - * |
139 | | - * @property \Ease\WebPage $webPage A link to the base object of the page |
140 | | - * @property array $raiseItems Which objects to take over from the accepting object |
141 | | - * @property object $lastItem A link to the last element added |
142 | | - * @property bool $pageClosed Is page closed for adding new contents? |
143 | | - * @property array $allItems Array of links to all embedded objects |
144 | | - * |
145 | | - * @method int addJavaScript(string $javaScript, ?string $position = '0', bool $inDocumentReady = true) Inserts JavaScript into the page |
146 | | - * @method string includeJavaScript(string $javaScriptFile, ?string $position = null) Includes Javascript into the page |
147 | | - * @method bool addCSS(string $css) Add another CSS definition to stack |
148 | | - * @method bool includeCss(string $cssFile, bool $fwPrefix = false, string $media = 'screen') Include an CSS file call into page |
149 | | - * @method void redirect(string $url) Perform http redirect |
150 | | - * @method string getUri() Returns the desired address |
151 | | - * @method string phpSelf(bool $dropqs = true) Returns the current URL |
152 | | - * @inheritdoc |
153 | | - */ |
154 | | - class Document extends \Ease\Container |
| 144 | + |
| 145 | + session_write_close(); |
| 146 | + WebPage::$pageClosed = true; |
| 147 | + } |
| 148 | + |
| 149 | + /** |
| 150 | + * Returns the desired address. |
| 151 | + * |
| 152 | + * @method bool addCSS(string $css) Add another CSS definition to stack |
| 153 | + * @method int addJavaScript(string $javaScript, ?string $position = '0', bool $inDocumentReady = true) Inserts JavaScript into the page |
| 154 | + * @method string getUri() Returns the desired address |
| 155 | + * @method bool includeCss(string $cssFile, bool $fwPrefix = false, string $media = 'screen') Include an CSS file call into page |
| 156 | + * @method string includeJavaScript(string $javaScriptFile, ?string $position = null) Includes Javascript into the page |
| 157 | + * @method string phpSelf(bool $dropqs = true) Returns the current URL |
| 158 | + * {@inheritDoc} |
| 159 | + * @method void redirect(string $url) Perform http redirect |
| 160 | + */ |
| 161 | + public static function getUri() |
| 162 | + { |
| 163 | + return $_SERVER['REQUEST_URI']; |
| 164 | + } |
| 165 | + |
| 166 | + /** |
| 167 | + * Returns the current URL. This is instead of PHP_SELF which is unsafe. |
| 168 | + * |
155 | 169 | * @param bool $dropqs whether to drop the querystring or not. Default true |
156 | 170 | * |
157 | 171 | * @return string the current URL or NULL for php-cli |
|
0 commit comments