__construct() публичный Метод

Class constructor
public __construct ( string $p_uri = 'SELF' )
$p_uri string The full URI string
Пример #1
0
 /**
  * Class constructor
  *
  * @param string $p_uri
  *                      The full URI string
  */
 public function __construct($p_uri = null)
 {
     parent::__construct($p_uri);
     try {
         $this->setURLType(URLTYPE_SHORT_NAMES);
         // HUGE TODO: rewrite this - remove globals controller usage!
         if (array_key_exists('controller', $GLOBALS)) {
             if (is_object($GLOBALS['controller'])) {
                 $this->setURL($GLOBALS['controller']->getRequest());
             } else {
                 $this->setURLFromSymfony(Zend_Registry::get('container')->getService('request'));
             }
         } else {
             $this->setURL(new Zend_Controller_Request_Http());
         }
         $this->m_validURI = true;
         $this->validateCache(false);
     } catch (Exception $e) {
         $this->m_validURI = false;
         $this->m_errorCode = $e->getCode();
         if (!is_null($this->m_publication)) {
             $tplId = CampSystem::GetInvalidURLTemplate($this->m_publication->identifier, null, null, !$this->m_preview);
             $themePath = $this->getThemePath();
             $tplId = substr($tplId, strlen($themePath));
             $template = new MetaTemplate($tplId, $themePath);
             if ($template->defined()) {
                 $this->m_template = $template;
             }
             CampTemplate::singleton()->config_dir = APPLICATION_PATH . '/../themes/' . $themePath . '_conf';
         }
         CampTemplate::singleton()->trigger_error($e->getMessage());
     }
 }
Пример #2
0
 /**
  * Class constructor
  *
  * @param string $p_uri
  *      The requested URI
  */
 public function __construct($p_uri = null)
 {
     parent::__construct($p_uri);
     $this->setURLType(URLTYPE_TEMPLATE_PATH);
     $subdir = $this->m_config->getSetting('SUBDIR');
     $this->m_templatesPrefix = empty($subdir) ? 'tpl' : substr($subdir, 1) . '/tpl';
     $res = $this->setURL();
     if (PEAR::isError($res)) {
         $this->m_validURI = false;
         $this->m_errorCode = $res->getCode();
         if ($this->m_errorCode == self::INVALID_TEMPLATE && !is_null($this->m_publication)) {
             $tplId = CampSystem::GetInvalidURLTemplate($this->m_publication->identifier, null, null, !$this->m_preview);
             $template = new MetaTemplate($tplId);
             if ($template->defined()) {
                 $this->m_template = $template;
             }
         }
         CampTemplate::singleton()->trigger_error($res->getMessage());
     } else {
         foreach (CampURITemplatePath::$m_restrictedParameters as $parameter) {
             $this->setQueryVar($parameter);
         }
         $this->m_validURI = true;
     }
     $this->validateCache(false);
 }
Пример #3
0
    /**
     * Class constructor
     *
     * @param string $p_uri
     *      The full URI string
     */
    public function __construct($p_uri = null)
    {
        parent::__construct($p_uri);

        $this->setURLType(URLTYPE_SHORT_NAMES);
        $res = $this->setURL();
        if (PEAR::isError($res)) {
            $this->m_validURI = false;
            $this->m_errorCode = $res->getCode();
            if (!is_null($this->m_publication)) {
            	$tplId = CampSystem::GetInvalidURLTemplate($this->m_publication->identifier);
            	$template = new MetaTemplate($tplId);
            	if ($template->defined()) {
            		$this->m_template = $template;
            	}
            }
            CampTemplate::singleton()->trigger_error($res->getMessage());
        } else {
            $this->m_validURI = true;
        }
        $this->validateCache(false);
    } // fn __construct
Пример #4
0
 /**
  * Class constructor
  *
  * @param string $p_uri
  *      The full URI string
  */
 public function __construct($p_uri = null)
 {
     parent::__construct($p_uri);
     try {
         $this->setURLType(URLTYPE_SHORT_NAMES);
         $this->setURL($GLOBALS['controller']->getRequest());
         $this->m_validURI = true;
         $this->validateCache(false);
     } catch (Exception $e) {
         $this->m_validURI = false;
         $this->m_errorCode = $e->getCode();
         if (!is_null($this->m_publication)) {
             $tplId = CampSystem::GetInvalidURLTemplate($this->m_publication->identifier, null, null, !$this->m_preview);
             $themePath = $this->getThemePath();
             $tplId = substr($tplId, strlen($themePath));
             $template = new MetaTemplate($tplId, $themePath);
             if ($template->defined()) {
                 $this->m_template = $template;
             }
         }
         CampTemplate::singleton()->trigger_error($e->getMessage());
     }
 }