@@ -20,7 +20,6 @@ |
||
20 | 20 | use vsc\application\sitemaps\ExceptionSitemap; |
21 | 21 | use vsc\application\sitemaps\MappingA; |
22 | 22 | use vsc\application\sitemaps\ModuleMap; |
23 | -use vsc\application\sitemaps\RootMap; |
|
24 | 23 | use vsc\infrastructure\vsc; |
25 | 24 | use vsc\presentation\requests\RwHttpRequest; |
26 | 25 | use vsc\presentation\responses\ExceptionResponseError; |
@@ -2,11 +2,24 @@ |
||
2 | 2 | namespace vsc\application\sitemaps; |
3 | 3 | |
4 | 4 | interface ContentTypeMappingInterface { |
5 | + |
|
6 | + /** |
|
7 | + * @return boolean|null |
|
8 | + */ |
|
5 | 9 | public function setMainTemplatePath($sPath); |
6 | 10 | |
11 | + /** |
|
12 | + * @return string |
|
13 | + */ |
|
7 | 14 | public function getMainTemplatePath(); |
8 | 15 | |
16 | + /** |
|
17 | + * @return void |
|
18 | + */ |
|
9 | 19 | public function setMainTemplate($sPath); |
10 | 20 | |
21 | + /** |
|
22 | + * @return string |
|
23 | + */ |
|
11 | 24 | public function getMainTemplate(); |
12 | 25 | } |
@@ -157,7 +157,7 @@ |
||
157 | 157 | |
158 | 158 | /** |
159 | 159 | * @param string $sPath |
160 | - * @return bool |
|
160 | + * @return boolean|null |
|
161 | 161 | * @throws ExceptionSitemap |
162 | 162 | */ |
163 | 163 | public function setTemplatePath($sPath) { |
@@ -9,7 +9,6 @@ |
||
9 | 9 | |
10 | 10 | use vsc\application\controllers\ExceptionController; |
11 | 11 | use vsc\infrastructure\urls\Url; |
12 | -use vsc\infrastructure\urls\UrlParserA; |
|
13 | 12 | use vsc\infrastructure\Base; |
14 | 13 | use vsc\infrastructure\Object; |
15 | 14 | use vsc\presentation\requests\HttpAuthenticationA; |
@@ -284,8 +284,7 @@ |
||
284 | 284 | * @param Object $mappedObject |
285 | 285 | * @return boolean |
286 | 286 | */ |
287 | - public function maps(Object $mappedObject) |
|
288 | - { |
|
287 | + public function maps(Object $mappedObject) { |
|
289 | 288 | return (bool)stristr(get_class($mappedObject), substr(basename($this->getPath()), 0, -4)); |
290 | 289 | } |
291 | 290 |
@@ -5,6 +5,9 @@ |
||
5 | 5 | |
6 | 6 | class RootMap extends ModuleMap |
7 | 7 | { |
8 | + /** |
|
9 | + * @param string $sPath |
|
10 | + */ |
|
8 | 11 | public function __construct($sPath, $sRegex = '') { |
9 | 12 | parent::__construct($sPath, $sRegex); |
10 | 13 | } |
@@ -3,8 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use vsc\application\controllers\Html5Controller; |
5 | 5 | |
6 | -class RootMap extends ModuleMap |
|
7 | -{ |
|
6 | +class RootMap extends ModuleMap { |
|
8 | 7 | public function __construct($sPath, $sRegex = '') { |
9 | 8 | parent::__construct($sPath, $sRegex); |
10 | 9 | } |
@@ -10,5 +10,9 @@ |
||
10 | 10 | use vsc\infrastructure\caching\CacheableInterface; |
11 | 11 | |
12 | 12 | abstract class CacheableModelA extends ModelA implements CacheableInterface { |
13 | + |
|
14 | + /** |
|
15 | + * @return string|null |
|
16 | + */ |
|
13 | 17 | abstract public function getLastModified(); |
14 | 18 | } |
@@ -11,6 +11,9 @@ discard block |
||
11 | 11 | protected $sPageTitle = null; |
12 | 12 | protected $sPageContent = null; |
13 | 13 | |
14 | + /** |
|
15 | + * @param string $sTitle |
|
16 | + */ |
|
14 | 17 | public function setPageTitle($sTitle) { |
15 | 18 | $this->sPageTitle = $sTitle; |
16 | 19 | } |
@@ -19,6 +22,9 @@ discard block |
||
19 | 22 | return $this->sPageTitle; |
20 | 23 | } |
21 | 24 | |
25 | + /** |
|
26 | + * @param string $sContent |
|
27 | + */ |
|
22 | 28 | public function setPageContent($sContent) { |
23 | 29 | $this->sPageContent = $sContent; |
24 | 30 | } |
@@ -19,10 +19,16 @@ discard block |
||
19 | 19 | $this->setLastModified(date('Y-m-d G:i:s', filemtime($this->getFilePath()))); |
20 | 20 | } |
21 | 21 | |
22 | + /** |
|
23 | + * @return string |
|
24 | + */ |
|
22 | 25 | public function getFilePath() { |
23 | 26 | return $this->sFilePath; |
24 | 27 | } |
25 | 28 | |
29 | + /** |
|
30 | + * @param string $sName |
|
31 | + */ |
|
26 | 32 | public function setFileName($sName) { |
27 | 33 | $this->sFileName = $sName; |
28 | 34 | } |
@@ -42,6 +48,9 @@ discard block |
||
42 | 48 | return $this->sFileContent; |
43 | 49 | } |
44 | 50 | |
51 | + /** |
|
52 | + * @param string $iMTime |
|
53 | + */ |
|
45 | 54 | public function setLastModified($iMTime) { |
46 | 55 | $this->iLastModified = $iMTime; |
47 | 56 | } |
@@ -24,6 +24,9 @@ |
||
24 | 24 | $this->sXmlString = $sString; |
25 | 25 | } |
26 | 26 | |
27 | + /** |
|
28 | + * @return string |
|
29 | + */ |
|
27 | 30 | public function getString() { |
28 | 31 | return $this->sXmlString; |
29 | 32 | } |
@@ -137,6 +137,9 @@ discard block |
||
137 | 137 | return self::getTldOf($sSubDomains); |
138 | 138 | } |
139 | 139 | |
140 | + /** |
|
141 | + * @param string $sHost |
|
142 | + */ |
|
140 | 143 | public static function getTldOf($sHost) { |
141 | 144 | if (ip2long($sHost) > 0 || empty($sHost)) { return false; } |
142 | 145 | |
@@ -191,7 +194,7 @@ discard block |
||
191 | 194 | } |
192 | 195 | |
193 | 196 | /** |
194 | - * @return Url |
|
197 | + * @return string |
|
195 | 198 | */ |
196 | 199 | static public function getSiteUri() { |
197 | 200 | return static::url(static::getRequestUri())->getHost(); |
@@ -263,22 +263,22 @@ |
||
263 | 263 | $iCnt = 0; |
264 | 264 | foreach ($aPath as $iKey => $sFolder) { |
265 | 265 | switch ($sFolder) { |
266 | - case '..': |
|
267 | - $iCnt++; |
|
268 | - |
|
269 | - unset ($aPath[$iKey]); |
|
270 | - if (array_key_exists($iKey - 1, $aPath)) { |
|
271 | - $iPrevKey = $iKey - 1; |
|
272 | - } else { |
|
273 | - $sPrev = prev($aPath); |
|
274 | - $iPrevKey = array_search($sPrev, $aPath); |
|
275 | - } |
|
276 | - unset ($aPath[$iPrevKey]); |
|
277 | - break; |
|
278 | - case '.': |
|
279 | - case '': |
|
280 | - unset ($aPath[$iKey]); |
|
281 | - break; |
|
266 | + case '..': |
|
267 | + $iCnt++; |
|
268 | + |
|
269 | + unset ($aPath[$iKey]); |
|
270 | + if (array_key_exists($iKey - 1, $aPath)) { |
|
271 | + $iPrevKey = $iKey - 1; |
|
272 | + } else { |
|
273 | + $sPrev = prev($aPath); |
|
274 | + $iPrevKey = array_search($sPrev, $aPath); |
|
275 | + } |
|
276 | + unset ($aPath[$iPrevKey]); |
|
277 | + break; |
|
278 | + case '.': |
|
279 | + case '': |
|
280 | + unset ($aPath[$iKey]); |
|
281 | + break; |
|
282 | 282 | } |
283 | 283 | } |
284 | 284 |