コード例 #1
0
ファイル: Session.php プロジェクト: EGreg/PHP-On-Pie
 static function init()
 {
     if (Pie_Config::get('pie', 'session', 'appendSuffix', false) or isset($_GET[self::name()])) {
         if (self::id()) {
             $s = '?' . self::name() . '=' . self::id();
             $suffix = Pie_Uri::suffix();
             $base_url = Pie_Request::baseUrl();
             $suffix[$base_url] = isset($suffix[$base_url]) ? $suffix[$base_url] . $s : $s;
             Pie_Uri::suffix($suffix);
         }
     }
     self::$inited = true;
 }
コード例 #2
0
ファイル: Uri.php プロジェクト: EGreg/PHP-On-Pie
 /**
  * Set a suffix for all URLs that will be generated with this class.
  * @param array $suffix
  *  Optional. If no arguments are passed, just returns the current suffix.
  *  Pass an array here. For each entry, the key is tested and if it
  *  begins the URL, then the value is appended.
  *  Suffixes are applied when URLs are generated.
  * @return array
  *  Returns the suffix at the time the function was called.
  */
 static function suffix($suffix = null)
 {
     if (is_string($suffix)) {
         $suffix = array('' => $suffix);
     }
     if (!isset($suffix)) {
         return isset(self::$suffix) ? self::$suffix : array();
     }
     $prev_suffix = self::$suffix;
     self::$suffix = $suffix;
     return $prev_suffix;
 }