Uri.php

浏览该文件的文档。
00001 <?php
00003 // FleaPHP Framework
00004 //
00005 // Copyright (c) 2005 - 2008 QeeYuan China Inc. (http://www.qeeyuan.com)
00006 //
00007 // 许可协议,请查看源代码中附带的 LICENSE.txt 文件,
00008 // 或者访问 http://www.fleaphp.org/ 获得详细信息。
00010 
00025 function ___uri_filter()
00026 {
00027     static $firstTime = true;
00028 
00029     if (!$firstTime || !isset($_SERVER['PATH_INFO'])) { return; }
00030     $firstTime = false;
00031 
00032     $parts = explode('/', substr($_SERVER['PATH_INFO'], 1));
00033     $_GET[FLEA::getAppInf('controllerAccessor')] = isset($parts[0]) ? $parts[0] : '';
00034     $_GET[FLEA::getAppInf('actionAccessor')] = isset($parts[1]) ? $parts[1] : '';
00035 
00036     $style = FLEA::getAppInf('urlParameterPairStyle');
00037     if ($style == '/') {
00038         for ($i = 2; $i < count($parts); $i += 2) {
00039             if (isset($parts[$i + 1])) {
00040                 $_GET[$parts[$i]] = $parts[$i + 1];
00041             }
00042         }
00043     } else {
00044         for ($i = 2; $i < count($parts); $i++) {
00045             $p = $parts[$i];
00046             $arr = explode($style, $p);
00047             if (isset($arr[1])) {
00048                 $_GET[$arr[0]] = $arr[1];
00049             }
00050         }
00051     }
00052 
00053     // 将 $_GET 合并到 $_REQUEST,
00054     // 有时需要使用 $_REQUEST 统一处理 url 中的 id=? 这样的参数
00055     $_REQUEST = array_merge($_REQUEST, $_GET);
00056 }
00057 
00061 if (defined('FLEA_VERSION')) {
00062     ___uri_filter();
00063 }

Generated at Sat Feb 2 15:18:51 2008 for FleaPHP by  doxygen 1.5.3