Exemple #1
0
 /**
  * Configures the runtime.
  */
 public function configure()
 {
     $this->context->setProxyPath($this->proxyPath);
     if (!Stagehand_HTTP_ServerEnv::usingProxy()) {
         return;
     }
     if (!is_null($this->proxyPath)) {
         $this->context->setBasePath($this->proxyPath . $this->context->getBasePath());
         $this->context->setScriptName($this->proxyPath . $this->context->getScriptName());
         $this->context->setAppRootPath($this->proxyPath . $this->context->getAppRootPath());
         if ($this->adjustSessionCookiePath) {
             ini_set('session.cookie_path', $this->proxyPath . str_replace('//', '/', ini_get('session.cookie_path')));
         }
     }
 }
Exemple #2
0
 /**
  * Creates a Net_URL object with the given path, and replaces some pieces of
  * a URI when the URI is not external.
  *
  * @throws Piece_Unity_URI_PathNotSpecifiedException
  */
 private function initialize()
 {
     if (is_null($this->path)) {
         throw new Piece_Unity_URI_PathNotSpecifiedException('The path must be specified');
     }
     $path = $this->path;
     if (!$this->_isExternal && !preg_match('/^https?/', $this->path) && !Stagehand_HTTP_ServerEnv::usingProxy()) {
         $path = $this->context->getAppRootPath() . $path;
     }
     $this->_url = new Net_URL2($path);
 }