public function __construct($fileName, $settings) { $this->settings = array( 'SITE_ID' => $settings['SITE_ID'], 'PROTOCOL' => $settings['PROTOCOL'] == 'https' ? 'https' : 'http', 'DOMAIN' => $settings['DOMAIN'], ); $site = SiteTable::getRow(array("filter" => array("LID" => $this->settings['SITE_ID']))); $this->siteRoot = Path::combine( SiteTable::getDocumentRoot($this->settings['SITE_ID']), $site['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() && !$this->isSplitNeeded(); }
public function __construct($siteId) { $this->siteId = $siteId; $this->documentRoot = SiteTable::getDocumentRoot($this->siteId); parent::__construct(IO\Path::combine($this->documentRoot, self::ROBOTS_FILE_NAME)); }