Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SIWECOS
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cUriBuilderMR
  • ModRewrite
  • ModRewrite_ContentController
  • ModRewrite_ContentExpertController
  • ModRewrite_ContentTestController
  • ModRewrite_ControllerAbstract
  • ModRewriteBase
  • ModRewriteController
  • ModRewriteDebugger
  • ModRewriteTest
  • ModRewriteUrlStack
  • ModRewriteUrlUtil

Functions

  • mr_arrayValue
  • mr_buildGeneratedCode
  • mr_buildNewUrl
  • mr_conCopyArtLang
  • mr_conMoveArticles
  • mr_conSaveArticle
  • mr_conSyncArticle
  • mr_debugOutput
  • mr_getConfiguration
  • mr_getConfigurationFilePath
  • mr_getRequest
  • mr_header
  • mr_i18n
  • mr_loadConfiguration
  • mr_queryAndNextRecord
  • mr_removeMultipleChars
  • mr_requestCleanup
  • mr_runFrontendController
  • mr_setClientLanguageId
  • mr_setConfiguration
  • mr_strCopyCategory
  • mr_strMovedownCategory
  • mr_strMoveSubtree
  • mr_strMoveUpCategory
  • mr_strNewCategory
  • mr_strNewTree
  • mr_strRenameCategory
  • mr_strSyncCategory
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * AMR controller class
  4:  *
  5:  * @package     Plugin
  6:  * @subpackage  ModRewrite
  7:  * @id          $Id$:
  8:  * @author      Murat Purc <murat@purc.de>
  9:  * @copyright   four for business AG <www.4fb.de>
 10:  * @license     http://www.contenido.org/license/LIZENZ.txt
 11:  * @link        http://www.4fb.de
 12:  * @link        http://www.contenido.org
 13:  */
 14: 
 15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 16: 
 17: /**
 18:  * Mod Rewrite controller class. Extracts url parts and sets some necessary globals like:
 19:  * - $idart
 20:  * - $idcat
 21:  * - $client
 22:  * - $changeclient
 23:  * - $lang
 24:  * - $changelang
 25:  *
 26:  * @author      Murat Purc <murat@purc.de>
 27:  * @package     Plugin
 28:  * @subpackage  ModRewrite
 29:  */
 30: class ModRewriteController extends ModRewriteBase {
 31:     // Error constants
 32: 
 33:     const ERROR_CLIENT = 1;
 34:     const ERROR_LANGUAGE = 2;
 35:     const ERROR_CATEGORY = 3;
 36:     const ERROR_ARTICLE = 4;
 37:     const ERROR_POST_VALIDATION = 5;
 38:     const FRONT_CONTENT = 'front_content.php';
 39: 
 40:     /**
 41:      * Extracted request uri path parts by path separator '/'
 42:      *
 43:      * @var array
 44:      */
 45:     private $_aParts;
 46: 
 47:     /**
 48:      * Extracted article name from request uri
 49:      *
 50:      * @var string
 51:      */
 52:     private $_sArtName;
 53: 
 54:     /**
 55:      * Remaining path for path resolver (see $GLOBALS['path'])
 56:      *
 57:      * @var string
 58:      */
 59:     private $_sPath;
 60: 
 61:     /**
 62:      * Incomming URL
 63:      *
 64:      * @var string
 65:      */
 66:     private $_sIncommingUrl;
 67: 
 68:     /**
 69:      * Resolved URL
 70:      *
 71:      * @var string
 72:      */
 73:     private $_sResolvedUrl;
 74: 
 75:     /**
 76:      * Client id used by this class
 77:      *
 78:      * @var int
 79:      */
 80:     private $_iClientMR;
 81: 
 82:     /**
 83:      * Language id used by this class
 84:      *
 85:      * @var int
 86:      */
 87:     private $_iLangMR;
 88: 
 89:     /**
 90:      * Flag about occured errors
 91:      *
 92:      * @var bool
 93:      */
 94:     private $_bError = false;
 95: 
 96:     /**
 97:      * One of ERROR_* constants or 0
 98:      *
 99:      * @var int
100:      */
101:     private $_iError = 0;
102: 
103:     /**
104:      * Flag about found routing definition
105:      *
106:      * @var bool
107:      */
108:     private $_bRoutingFound = false;
109: 
110:     /**
111:      * Constructor, sets several properties.
112:      *
113:      * @param  string  $incommingUrl  Incomming URL
114:      */
115:     public function __construct($incommingUrl) {
116: 
117:         // CON-1266 make incomming URL lowercase if option "URLS to
118:         // lowercase" is set
119:         if (1 == $this->getConfig('use_lowercase_uri')) {
120:             $incommingUrl = cString::toLowerCase($incommingUrl);
121:         }
122: 
123:         $this->_sIncommingUrl = $incommingUrl;
124:         $this->_aParts = array();
125:         $this->_sArtName = '';
126:     }
127: 
128:     /**
129:      * Getter for overwritten client id (see $GLOBALS['client'])
130:      *
131:      * @return  int  Client id
132:      */
133:     public function getClient() {
134:         return $GLOBALS['client'];
135:     }
136: 
137:     /**
138:      * Getter for overwritten change client id (see $GLOBALS['changeclient'])
139:      *
140:      * @return  int  Change client id
141:      */
142:     public function getChangeClient() {
143:         return $GLOBALS['changeclient'];
144:     }
145: 
146:     /**
147:      * Getter for article id (see $GLOBALS['idart'])
148:      *
149:      * @return  int  Article id
150:      */
151:     public function getIdArt() {
152:         return $GLOBALS['idart'];
153:     }
154: 
155:     /**
156:      * Getter for category id (see $GLOBALS['idcat'])
157:      *
158:      * @return  int  Category id
159:      */
160:     public function getIdCat() {
161:         return $GLOBALS['idcat'];
162:     }
163: 
164:     /**
165:      * Getter for language id (see $GLOBALS['lang'])
166:      *
167:      * @return  int  Language id
168:      */
169:     public function getLang() {
170:         return $GLOBALS['lang'];
171:     }
172: 
173:     /**
174:      * Getter for change language id (see $GLOBALS['changelang'])
175:      *
176:      * @return  int  Change language id
177:      */
178:     public function getChangeLang() {
179:         return $GLOBALS['changelang'];
180:     }
181: 
182:     /**
183:      * Getter for path (see $GLOBALS['path'])
184:      *
185:      * @return  string  Path, used by path resolver
186:      */
187:     public function getPath() {
188:         return $this->_sPath;
189:     }
190: 
191:     /**
192:      * Getter for resolved url
193:      *
194:      * @return  string  Resolved url
195:      */
196:     public function getResolvedUrl() {
197:         return $this->_sResolvedUrl;
198:     }
199: 
200:     /**
201:      * Returns a flag about found routing definition
202:      *
203:      * return  bool  Flag about found routing
204:      */
205:     public function getRoutingFoundState() {
206:         return $this->_bRoutingFound;
207:     }
208: 
209:     /**
210:      * Getter for occured error state
211:      *
212:      * @return  bool  Flag for occured error
213:      */
214:     public function errorOccured() {
215:         return $this->_bError;
216:     }
217: 
218:     /**
219:      * Getter for occured error state
220:      *
221:      * @return  int  Numeric error code
222:      */
223:     public function getError() {
224:         return $this->_iError;
225:     }
226: 
227:     /**
228:      * Main function to call for mod rewrite related preprocessing jobs.
229:      *
230:      * Executes some private functions to extract request URI and to set needed membervariables
231:      * (client, language, article id, category id, etc.)
232:      *
233:      * @throws cDbException
234:      * @throws cException
235:      * @throws cInvalidArgumentException
236:      */
237:     public function execute() {
238:         if (parent::isEnabled() == false) {
239:             return;
240:         }
241: 
242:         $this->_extractRequestUri();
243: 
244:         $this->_initializeClientId();
245: 
246:         $this->_setClientId();
247: 
248:         mr_loadConfiguration($this->_iClientMR);
249: 
250:         $this->_setLanguageId();
251: 
252:         // second call after setting client and language
253:         $this->_extractRequestUri(true);
254: 
255:         $this->_setPathresolverSetting();
256: 
257:         $this->_setIdart();
258: 
259:         ModRewriteDebugger::add($this->_aParts, 'ModRewriteController::execute() _setIdart');
260: 
261:         $this->_postValidation();
262:     }
263: 
264:     /**
265:      * Extracts request URI and sets member variables $this->_sArtName and $this->_aParts
266:      *
267:      * @param  bool $secondCall  Flag about second call of this function, is needed
268:      *                           to re extract url if a routing definition was found
269:      *
270:      * @throws cDbException
271:      * @throws cException
272:      * @throws cInvalidArgumentException
273:      */
274:     private function _extractRequestUri($secondCall = false) {
275:         global $client;
276: 
277:         // get REQUEST_URI
278:         $requestUri = $_SERVER['REQUEST_URI'];
279:         // CON-1266 make request URL lowercase if option "URLS to
280:         // lowercase" is set
281:         if (1 == $this->getConfig('use_lowercase_uri')) {
282:             $requestUri = cString::toLowerCase($requestUri);
283:         }
284: 
285:         // check for defined rootdir
286:         // allows for root dir being alternativly defined as path of setting client/%frontend_path%
287:         $rootdir = cUriBuilderMR::getMultiClientRootDir(parent::getConfig('rootdir'));
288:         if ('/' !==  $rootdir && 0 === cString::findFirstPos($requestUri, $this->_sIncommingUrl)) {
289:             $this->_sIncommingUrl = str_replace($rootdir, '/', $this->_sIncommingUrl);
290:         }
291: 
292:         $aUrlComponents = $this->_parseUrl($this->_sIncommingUrl);
293:         if (isset($aUrlComponents['path'])) {
294:             if (parent::getConfig('rootdir') !== '/' && cString::findFirstPos($aUrlComponents['path'], parent::getConfig('rootdir')) === 0) {
295:                 $aUrlComponents['path'] = str_replace(parent::getConfig('rootdir'), '/', $aUrlComponents['path']);
296:             }
297: 
298:             if ($secondCall == true) {
299: 
300:                 // @todo: implement real redirect of old front_content.php style urls
301:                 // check for routing definition
302:                 $routings = parent::getConfig('routing');
303:                 if (is_array($routings) && isset($routings[$aUrlComponents['path']])) {
304:                     $aUrlComponents['path'] = $routings[$aUrlComponents['path']];
305:                     if (cString::findFirstPos($aUrlComponents['path'], self::FRONT_CONTENT) !== false) {
306:                         // routing destination contains front_content.php
307: 
308:                         $this->_bRoutingFound = true;
309: 
310:                         // set client language, if not set before
311:                         mr_setClientLanguageId($client);
312: 
313:                         //rebuild URL
314:                         $url = mr_buildNewUrl($aUrlComponents['path']);
315: 
316:                         $aUrlComponents = $this->_parseUrl($url);
317: 
318:                         // add query parameter to superglobal _GET
319:                         if (isset($aUrlComponents['query'])) {
320:                             $vars = NULL;
321:                             parse_str($aUrlComponents['query'], $vars);
322:                             $_GET = array_merge($_GET, $vars);
323:                         }
324: 
325:                         $this->_aParts = array();
326:                     }
327:                 } else {
328:                     return;
329:                 }
330:             }
331: 
332:             $aPaths = explode('/', $aUrlComponents['path']);
333:             foreach ($aPaths as $p => $item) {
334:                 if (!empty($item)) {
335:                     // pathinfo would also work
336:                     $arr = explode('.', $item);
337:                     $count = count($arr);
338:                     if ($count > 0 && '.' . cString::toLowerCase($arr[$count - 1]) == parent::getConfig('file_extension')) {
339:                         array_pop($arr);
340:                         $this->_sArtName = trim(implode('.', $arr));
341:                     } else {
342:                         $this->_aParts[] = $item;
343:                     }
344:                 }
345:             }
346: 
347:             if ($secondCall == true) {
348:                 // reprocess extracting client and language
349:                 $this->_setClientId();
350:                 mr_loadConfiguration($this->_iClientMR);
351:                 $this->_setLanguageId();
352:             }
353:         }
354:         ModRewriteDebugger::add($this->_aParts, 'ModRewriteController::_extractRequestUri() $this->_aParts');
355: 
356:         // loop parts array and remove existing 'front_content.php'
357:         if ($this->_hasPartArrayItems()) {
358:             foreach ($this->_aParts as $p => $item) {
359:                 if ($item == self::FRONT_CONTENT) {
360:                     unset($this->_aParts[$p]);
361:                 }
362:             }
363:         }
364:     }
365: 
366:     /**
367:      * Tries to initialize the client id.
368:      * This is required to load the proper plugin configuration for current client.
369:      */
370:     private function _initializeClientId() {
371:         global $client, $changeclient, $load_client;
372: 
373:         $iClient = (isset($client) && (int) $client > 0) ? $client : 0;
374:         $iChangeClient = (isset($changeclient) && (int) $changeclient > 0) ? $changeclient : 0;
375:         $iLoadClient = (isset($load_client) && (int) $load_client > 0) ? $load_client : 0;
376: 
377:         $this->_iClientMR = 0;
378:         if ($iClient > 0 && $iChangeClient == 0) {
379:             $this->_iClientMR = $iClient;
380:         } elseif ($iChangeClient > 0) {
381:             $this->_iClientMR = $iChangeClient;
382:         } else {
383:             $this->_iClientMR = $iLoadClient;
384:         }
385: 
386:         if ((int) $this->_iClientMR > 0) {
387:             // set global client variable
388:             $client = (int) $this->_iClientMR;
389:         }
390:     }
391: 
392:     /**
393:      * Tries to initialize the language id.
394:      */
395:     private function _initializeLanguageId() {
396:         global $lang, $changelang, $load_lang;
397: 
398:         $iLang = (isset($lang) && (int) $lang > 0) ? $lang : 0;
399:         $iChangeLang = (isset($changelang) && (int) $changelang > 0) ? $changelang : 0;
400:         $iLoadLang = (isset($load_lang) && (int) $load_lang > 0) ? $load_lang : 0;
401: 
402:         $this->_iLangMR = 0;
403:         if ($iLang > 0 && $iChangeLang == 0) {
404:             $this->_iLangMR = $iLang;
405:         } elseif ($iChangeLang > 0) {
406:             $this->_iLangMR = $iChangeLang;
407:         } else {
408:             $this->_iLangMR = $iLoadLang;
409:         }
410: 
411:         if ((int) $this->_iLangMR > 0) {
412:             // set global lang variable
413:             $lang = (int) $this->_iLangMR;
414:         }
415:     }
416: 
417:     /**
418:      * Detects client id from given url
419:      *
420:      * @throws cDbException
421:      */
422:     private function _setClientId() {
423:         global $client;
424: 
425:         if ($this->_bError) {
426:             return;
427:         } elseif ($this->_isRootRequest()) {
428:             // request to root
429:             return;
430:         } elseif (parent::getConfig('use_client') !== 1) {
431:             return;
432:         }
433: 
434:         if (parent::getConfig('use_client_name') == 1) {
435:             $detectedClientId = (int) ModRewrite::getClientId(array_shift($this->_aParts));
436:         } else {
437:             $detectedClientId = (int) array_shift($this->_aParts);
438:             if ($detectedClientId > 0 && !ModRewrite::languageIdExists($detectedClientId)) {
439:                 $detectedClientId = 0;
440:             }
441:         }
442: 
443:         if ($detectedClientId > 0) {
444:             // overwrite existing client variables
445:             $this->_iClientMR = $detectedClientId;
446:             $client = $detectedClientId;
447:         } else {
448:             $this->_setError(self::ERROR_CLIENT);
449:         }
450:     }
451: 
452:     /**
453:      * Sets language id
454:      *
455:      * @throws cDbException
456:      */
457:     private function _setLanguageId() {
458:         global $lang;
459: 
460:         if ($this->_bError) {
461:             return;
462:         } elseif ($this->_isRootRequest()) {
463:             // request to root
464:             return;
465:         } elseif (parent::getConfig('use_language') !== 1) {
466:             return;
467:         }
468: 
469:         if (parent::getConfig('use_language_name') == 1) {
470:             // thanks to Nicolas Dickinson for multi Client/Language BugFix
471:             $languageName = array_shift($this->_aParts);
472:             $detectedLanguageId = (int) ModRewrite::getLanguageId($languageName, $this->_iClientMR);
473:         } else {
474:             $detectedLanguageId = (int) array_shift($this->_aParts);
475:             if ($detectedLanguageId > 0 && !ModRewrite::clientIdExists($detectedLanguageId)) {
476:                 $detectedLanguageId = 0;
477:             }
478:         }
479: 
480:         if ($detectedLanguageId > 0) {
481:             // overwrite existing language variables
482:             $this->_iLangMR = $detectedLanguageId;
483:             $lang = $detectedLanguageId;
484:         } else {
485:             $this->_setError(self::ERROR_LANGUAGE);
486:         }
487:     }
488: 
489:     /**
490:      * Sets path resolver and category id
491:      *
492:      * @throws cException
493:      */
494:     private function _setPathresolverSetting() {
495:         global $client, $lang, $load_lang, $idcat;
496: 
497:         if ($this->_bError) {
498:             return;
499:         } elseif (!$this->_hasPartArrayItems()) {
500:             return;
501:         }
502: 
503:         $this->_sPath = '/' . implode('/', $this->_aParts) . '/';
504: 
505:         if (!isset($lang) || (int) $lang <= 0) {
506:             if ((int) $load_lang > 0) {
507:                 // load_client is set in __FRONTEND_PATH__/data/config/config.php
508:                 $lang = (int) $load_lang;
509:             } else {
510:                 // get client id from table
511:                 $clCol = new cApiClientLanguageCollection();
512:                 $clCol->setWhere('idclient', $client);
513:                 $clCol->query();
514:                 if (false !== $clItem = $clCol->next()) {
515:                     $lang = $clItem->get('idlang');
516:                 }
517:             }
518:         }
519: 
520:         $idcat = (int) ModRewrite::getCatIdByUrlPath($this->_sPath);
521: 
522:         if ($idcat == 0) {
523:             // category couldn't resolved
524:             $this->_setError(self::ERROR_CATEGORY);
525:             $idcat = NULL;
526:         } else {
527:             // unset $this->_sPath if $idcat could set, otherwise it would be resolved again.
528:             unset($this->_sPath);
529:         }
530: 
531:         ModRewriteDebugger::add($idcat, 'ModRewriteController->_setPathresolverSetting $idcat');
532:         ModRewriteDebugger::add($this->_sPath, 'ModRewriteController->_setPathresolverSetting $this->_sPath');
533:     }
534: 
535:     /**
536:      * Sets article id
537:      *
538:      * @throws cDbException
539:      * @throws cInvalidArgumentException
540:      */
541:     private function _setIdart() {
542:         global $idcat, $idart, $lang;
543: 
544:         if ($this->_bError) {
545:             return;
546:         } elseif ($this->_isRootRequest()) {
547:             return;
548:         }
549: 
550:         $iIdCat = (isset($idcat) && (int) $idcat > 0) ? $idcat : 0;
551:         $iIdArt = (isset($idart) && (int) $idart > 0) ? $idart : 0;
552:         $detectedIdart = 0;
553:         $defaultStartArtName = parent::getConfig('default_startart_name');
554:         $currArtName = $this->_sArtName;
555: 
556:         // startarticle name in url
557:         if (parent::getConfig('add_startart_name_to_url') && !empty($currArtName)) {
558:             if ($currArtName == $defaultStartArtName) {
559:                 // stored articlename is the default one, remove it ModRewrite::getArtIdByWebsafeName()
560:                 // will find the real article name
561:                 $currArtName = '';
562:             }
563:         }
564: 
565:         // Last check, before detecting article id
566:         if ($iIdCat == 0 && $iIdArt == 0 && empty($currArtName)) {
567:             // no idcat, idart and article name
568:             // must be a request to root or with language name and/or client name part!
569:             return;
570:         }
571: 
572:         if ($iIdCat > 0 && $iIdArt == 0 && !empty($currArtName)) {
573:             // existing idcat with no idart and with article name
574:             $detectedIdart = (int) ModRewrite::getArtIdByWebsafeName($currArtName, $iIdCat, $lang);
575:         } elseif ($iIdCat > 0 && $iIdArt == 0 && empty($currArtName)) {
576:             if (parent::getConfig('add_startart_name_to_url') && ($currArtName == '' || $defaultStartArtName == '' || $defaultStartArtName == $this->_sArtName)) {
577:                 // existing idcat without idart and without article name or with default start article name
578:                 $catLangColl = new cApiCategoryLanguageCollection();
579:                 $detectedIdart = (int) $catLangColl->getStartIdartByIdcatAndIdlang($iIdCat, $lang);
580:             }
581:         } elseif ($iIdCat == 0 && $iIdArt == 0 && !empty($currArtName)) {
582:             // no idcat and idart but article name
583:             $detectedIdart = (int) ModRewrite::getArtIdByWebsafeName($currArtName, $iIdCat, $lang);
584:         }
585: 
586:         if ($detectedIdart > 0) {
587:             $idart = $detectedIdart;
588:         } elseif (!empty($currArtName)) {
589:             $this->_setError(self::ERROR_ARTICLE);
590:         }
591: 
592:         ModRewriteDebugger::add($detectedIdart, 'ModRewriteController->_setIdart $detectedIdart');
593:     }
594: 
595:     /**
596:      * Does post validation of the extracted data.
597:      *
598:      * One main goal of this function is to prevent duplicated content, which could happen, if
599:      * the configuration 'startfromroot' is activated.
600:      *
601:      * @throws cDbException
602:      * @throws cInvalidArgumentException
603:      */
604:     private function _postValidation() {
605:         global $idcat, $idart, $client;
606: 
607:         if ($this->_bError || $this->_bRoutingFound || !$this->_hasPartArrayItems()) {
608:             return;
609:         }
610: 
611:         if (parent::getConfig('startfromroot') == 1 && parent::getConfig('prevent_duplicated_content') == 1) {
612: 
613:             // prevention of duplicated content if '/firstcat/' is directly requested!
614: 
615:             $idcat = (isset($idcat) && (int) $idcat > 0) ? $idcat : NULL;
616:             $idart = (isset($idart) && (int) $idart > 0) ? $idart : NULL;
617: 
618:             // compose new parameter
619:             $param = '';
620:             if ($idcat) {
621:                 $param .= 'idcat=' . (int) $idcat;
622:             }
623:             if ($idart) {
624:                 $param .= ($param !== '') ? '&idart=' . (int) $idart : 'idart=' . (int) $idart;
625:             }
626: 
627:             if ($param == '') {
628:                 return;
629:             }
630: 
631:             // set client language, if not set before
632:             mr_setClientLanguageId($client);
633: 
634:             //rebuild url
635:             $url = mr_buildNewUrl(self::FRONT_CONTENT . '?' . $param);
636: 
637:             $aUrlComponents = @parse_url($this->_sIncommingUrl);
638:             $incommingUrl = (isset($aUrlComponents['path'])) ? $aUrlComponents['path'] : '';
639: 
640:             ModRewriteDebugger::add($url, 'ModRewriteController->_postValidation validate url');
641:             ModRewriteDebugger::add($incommingUrl, 'ModRewriteController->_postValidation incommingUrl');
642: 
643:             // now the new generated uri should be identical with the request uri
644:             if ($incommingUrl !== $url) {
645:                 $this->_setError(self::ERROR_POST_VALIDATION);
646:                 $idcat = NULL;
647:             }
648:         }
649:     }
650: 
651:     /**
652:      * Parses the url using defined separators
653:      *
654:      * @param   string  $url  Incoming url
655:      * @return  array|bool  Parsed url
656:      */
657:     private function _parseUrl($url) {
658:         $this->_sResolvedUrl = $url;
659: 
660:         $oMrUrlUtil = ModRewriteUrlUtil::getInstance();
661:         $url = $oMrUrlUtil->toContenidoUrl($url);
662: 
663:         return @parse_url($url);
664:     }
665: 
666:     /**
667:      * Returns state of parts property.
668:      *
669:      * @return  bool  True if $this->_aParts propery contains items
670:      */
671:     private function _hasPartArrayItems() {
672:         return (!empty($this->_aParts));
673:     }
674: 
675:     /**
676:      * Checks if current request was a root request.
677:      *
678:      * @return  bool
679:      */
680:     private function _isRootRequest() {
681:         return ($this->_sIncommingUrl == '/' || $this->_sIncommingUrl == '');
682:     }
683: 
684:     /**
685:      * Sets error code and error flag (everything greater than 0 is an error)
686:      * @param  int  $errCode
687:      */
688:     private function _setError($errCode) {
689:         $this->_iError = (int) $errCode;
690:         $this->_bError = ((int) $errCode > 0);
691:     }
692: 
693: }
CMS CONTENIDO 4.10.1 API documentation generated by ApiGen 2.8.0