/** * Class constructor * * @param array $p_attributes */ private function __construct($p_attributes = array()) { $this->m_config = CampConfig::singleton(); if (isset($p_attributes['type'])) { $this->m_type = $p_attributes['type']; } else { $this->m_type = 'html'; } if (isset($p_attributes['charset'])) { $this->m_charset = $p_attributes['charset']; } else { $this->m_charset = 'utf-8'; } if (isset($p_attributes['language'])) { $this->m_language = $p_attributes['language']; } //set default document metadata $this->setMetaTag('Content-Type', $this->m_mime.'; charset='.$this->m_charset, true); $this->setMetaTag('robots', 'index, follow'); } // fn __construct
protected function getDefaultSiteName() { $defaultAlias = new Alias($this->m_dbObject->getDefaultAliasId()); if (!$defaultAlias->exists()) { return null; } $subdir = CampConfig::singleton()->getSetting('SUBDIR'); return $defaultAlias->getName() . $subdir; }
/** * Class constructor * * @param string $p_uri * The full URI string */ public function __construct($p_uri = 'SELF') { $this->m_config = CampConfig::singleton(); if (isset($p_uri) && $p_uri != 'SELF') { $uriString = $p_uri; } else { // ... otherwise we build the uri from the server itself. // // checks whether the site is being queried through SSL if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')) { $scheme = 'https://'; } else { $scheme = 'http://'; } // this works at least for apache, some research is needed // in order to support other web servers. if (!empty($_SERVER['PHP_SELF'])) { $uriString = $scheme . $_SERVER['HTTP_HOST']; } if (isset($_SERVER['REQUEST_URI'])) { $uriString .= $_SERVER['REQUEST_URI']; } // some cleaning directives $uriString = urldecode($uriString); $uriString = str_replace('"', '"', $uriString); $uriString = str_replace('<', '<', $uriString); $uriString = str_replace('>', '>', $uriString); $uriString = preg_replace('/eval\((.*)\)/', '', $uriString); $uriString = preg_replace('/[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']/', '""', $uriString); } $this->parse($uriString); $this->m_queryArray = array_merge($this->m_queryArray, CampRequest::GetInput('POST')); $this->readUser(); } // fn __construct
/** * Returns a CampConfig instance. * * @return object * A CampConfig instance */ public static function GetConfigInstance() { return CampConfig::singleton(); } // fn GetConfig
/** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * * @access protected */ protected function setUp() { $this->m_configObj = CampConfig::singleton(); }