public function siteid() { if (!is_null($this->_page->siteid())) { return $this->_page->siteid(); } else { if (!defined('TYPEF_HOST')) { return 0; } if ($_SERVER['HTTP_HOST'] == TYPEF_HOST) { return 0; } $sites = new Model_Site(); $sites->where('domain = ?', $_SERVER['HTTP_HOST']); foreach ($sites->select() as $site) { if ($site['directory'] == '' || strpos($this->uri(), $site['directory']) === 0) { return $site['id']; } } } }
private function _executeApplicationCode() { static $executed = false; if (!$executed) { $executed = true; // Execute triggers $currentPath = $this->path(); $this->_executeTriggers('before'); if (Typeframe::CurrentPage()->stopped()) { return; } Typeframe_Page::_IncludeController(Typeframe::CurrentPage()->controller()); if (Typeframe::CurrentPage()->stopped()) { return; } $this->_executeTriggers('after'); } else { trigger_error('Applications can only be executed once'); } }