예제 #1
0
 function Url($page = APPLICATION_DEFAULT_PAGE, $params = array(), $fullpath = true, $secure = false)
 {
     unset($params[APPLICATION_PAGE_VAR_NAME]);
     if (!FORCE_SESSION_COOKIE && SID && SASession::id()) {
         $params[SASession::name()] = SASession::id();
     }
     $filename = basename($page);
     $dir = dirname($page);
     $dir = $dir == '.' ? '' : $dir . '/';
     $url = ($fullpath ? SAURL::baseHref($secure) : '') . $dir . SAUrl::build($filename, $params);
     return $url;
 }
예제 #2
0
 function &factory($name)
 {
     $name = empty($name) ? APPLICATION_DEFAULT_PAGE : $name;
     include_once $file = PAGE_FACTORY_SEARCH_DIR . $name . '.php';
     if (!class_exists($classname = 'Page_' . basename($file, '.php'))) {
         if ($name == APPLICATION_404_PAGE) {
             return PEAR::raiseError(null, PAGE_FACTORY_ERROR_NOT_FOUND, null, null, null, 'PageFactory_Error', true);
         } else {
             HTTP_Header::redirect(SAURL::url(APPLICATION_404_PAGE));
             exit;
         }
     }
     $obj =& new $classname();
     return $obj;
 }
예제 #3
0
 function SApplication()
 {
     $this->_updateMeStatic();
     if (ENABLE_PROFILING) {
         include_once 'Benchmark/Timer.php';
         $this->_timer =& new Benchmark_Timer();
         $this->_timer->start();
     }
     parent::PEAR();
     $u = SAURL::restore();
     if (PEAR::isError($u)) {
         if ($u->getCode() == URL_MANIPULATION) {
             HTTP_Header::redirect(SAUrl::Url(APPLICATION_401_PAGE));
             exit;
         }
     }
 }