コード例 #1
0
ファイル: application.php プロジェクト: BackupTheBerlios/tip
 private function _startSession()
 {
     // Start the session
     TIP::startSession();
     $this->_session_started = true;
     // Set $_referer
     $request = HTTP_Session2::get('request');
     $referer = HTTP_Session2::get('referer');
     if (is_null($request)) {
         // Entry page or new session: the referer is the main page
         $this->_referer = null;
     } elseif ($this->_request['uri'] == $referer['uri']) {
         // Current URI equals to the old referer URI: probably a back action
         $this->_referer = null;
     } elseif ($this->_request['module'] != $request['module'] || $this->_request['action'] != $request['action']) {
         // New action: the referer is the previous request
         $this->_referer = $request;
     } else {
         // Same action: leave the old referer
         $this->_referer = $referer;
     }
     if (!is_array($this->_referer)) {
         $this->_referer = array('uri' => TIP::getHome(), 'module' => null, 'action' => null);
         $this->_referer['action'] = null;
     }
     $this->keys['REFERER'] = $this->_referer['uri'];
     // Store request and referer
     HTTP_Session2::set('referer', $this->_referer);
     HTTP_Session2::set('request', $this->_request);
     // Profiler initialization in "admin" mode
     if ($this->keys['IS_ADMIN']) {
         require_once 'Benchmark/Profiler.php';
         $GLOBALS['_tip_profiler'] = new Benchmark_Profiler();
         $GLOBALS['_tip_profiler']->start();
     }
 }