/**
  * Looking up a domain record based on HTTP_HOST
  *
  * @param	boolean		If set, it looks "recursively" meaning that a domain like "123.456.typo3.com" would find a domain record like "typo3.com" if "123.456.typo3.com" or "456.typo3.com" did not exist.
  * @return	integer		Returns the page id of the page where the domain record was found.
  * @access private
  */
 function findDomainRecord($recursive = 0)
 {
     if ($recursive) {
         $host = explode('.', t3lib_div::getIndpEnv('HTTP_HOST'));
         while (count($host)) {
             $pageUid = $this->sys_page->getDomainStartPage(implode('.', $host), t3lib_div::getIndpEnv('SCRIPT_NAME'), t3lib_div::getIndpEnv('REQUEST_URI'));
             if ($pageUid) {
                 return $pageUid;
             } else {
                 array_shift($host);
             }
         }
         return $pageUid;
     } else {
         return $this->sys_page->getDomainStartPage(t3lib_div::getIndpEnv('HTTP_HOST'), t3lib_div::getIndpEnv('SCRIPT_NAME'), t3lib_div::getIndpEnv('REQUEST_URI'));
     }
 }