public function __construct($fileName, $arSettings) { $this->settings = array('SITE_ID' => $arSettings['SITE_ID'], 'PROTOCOL' => $arSettings['PROTOCOL'] == 'https' ? 'https' : 'http', 'DOMAIN' => $arSettings['DOMAIN']); $arSite = SiteTable::getRow(array("filter" => array("LID" => $this->settings['SITE_ID']))); $this->siteRoot = Path::combine(SiteTable::getDocumentRoot($this->settings['SITE_ID']), $arSite['DIR']); if (substr($fileName, -strlen(self::FILE_EXT)) != self::FILE_EXT) { $fileName .= self::FILE_EXT; } if ($this->partFile == '') { $this->partFile = $fileName; } $this->pathPhysical = null; // hack for object reconstuct during file splitting parent::__construct($this->siteRoot . '/' . $fileName, $this->settings['SITE_ID']); $this->partChanged = $this->isExists(); }
public function __construct($siteId) { $this->siteId = $siteId; $this->documentRoot = SiteTable::getDocumentRoot($this->siteId); parent::__construct(IO\Path::combine($this->documentRoot, self::ROBOTS_FILE_NAME)); }