예제 #1
0
 public static function getGetValues($query = null)
 {
     if (empty($query)) {
         if (isset($_SERVER['REDIRECT_QUERY_STRING'])) {
             $query = $_SERVER['REDIRECT_QUERY_STRING'];
         } elseif (PHPWS_Core::isRewritten()) {
             if (dirname($_SERVER['PHP_SELF']) == '/') {
                 $rewrite = substr($_SERVER['REQUEST_URI'], 1);
             } else {
                 $rewrite = str_ireplace(dirname($_SERVER['PHP_SELF']) . '/', '', $_SERVER['REQUEST_URI']);
             }
             if (!empty($rewrite)) {
                 $re_array = explode('/', $rewrite);
                 $output['module'] = array_shift($re_array);
                 $count = 1;
                 $continue = 1;
                 $i = 0;
                 while (isset($re_array[$i])) {
                     $key = $re_array[$i];
                     $i++;
                     if (isset($re_array[$i])) {
                         $value = $re_array[$i];
                         $output[$key] = $value;
                     }
                     $i++;
                 }
                 return $output;
             }
         } else {
             $address = $_SERVER['REQUEST_URI'];
             if ($url = @parse_url($address)) {
                 extract($url);
             } else {
                 $query = null;
             }
         }
     } else {
         $query = str_replace('index.php?', '', $query);
     }
     if (empty($query)) {
         return null;
     }
     parse_str($query, $output);
     return $output;
 }