Changeset 7016
- Timestamp:
- 11/18/08 18:04:00 (7 weeks ago)
- Location:
- trunk/library
- Files:
-
- 3 modified
-
context.php (modified) (4 diffs)
-
loader.php (modified) (1 diff)
-
suri.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/library/context.php
r7011 r7016 31 31 $_SERVER['REQUEST_URI'] = urldecode($_SERVER['HTTP_X_REWRITE_URL']); 32 32 } 33 /* Retrieve Access Parameter Information. */ 33 34 $accessInfo = array( 34 35 'host' => $_SERVER['HTTP_HOST'], 35 36 'fullpath' => str_replace('index.php', '', $_SERVER["REQUEST_URI"]), // SUGGEST: change the name 'fullpath' to 'fullQuery' 36 37 'position' => $_SERVER["SCRIPT_NAME"], 37 'root' => rtrim(str_replace(' rewrite.php', '', $_SERVER["SCRIPT_NAME"]), 'index.php')38 'root' => rtrim(str_replace('dispatcher.php', '', $_SERVER["SCRIPT_NAME"]), 'index.php') 38 39 ); 40 if (strpos($accessInfo['fullpath'],$accessInfo['root']) !== 0) 41 $accessInfo['fullpath'] = $accessInfo['root'].substr($accessInfo['fullpath'], strlen($accessInfo['root']) - 1); 39 42 // Workaround for compartibility with fastCGI / Other environment 40 43 $accessInfo['input'] = ltrim(substr($accessInfo['fullpath'], 41 44 strlen($accessInfo['root']) + (defined('__TEXTCUBE_NO_FANCY_URL__') ? 1 : 0)),'/'); 42 45 // DEPRECATE?: Support for Tattertools 0.9x legacy address 43 44 $accessInfo['URLfragment'] = explode('/',strtok($accessInfo['input'],'?')); 45 if (defined('__TEXTCUBE_NO_FANCY_URL__')) 46 $part = strtok($accessInfo['input'], '/'); 47 if (in_array($part, array('resources','plugins','cache','skin','attach','thumbnail'))) { 48 $part = ltrim(rtrim($part == 'thumbnail' ? 49 preg_replace('/thumbnail/', 'cache/thumbnail', $accessInfo['input'], 1) : 50 $accessInfo['input']), '/'); 51 $part = (($qpos = strpos($part, '?')) !== false) ? substr($part, 0, $qpos) : $part; 52 if(file_exists($part)) { 53 require_once ROOT.'/library/function/file.php'; 54 dumpWithEtag($part); 55 exit; 56 } else { 57 header("HTTP/1.0 404 Not Found");exit; 58 } 59 } 60 if (strtok($part, '?') == 'setup.php') {require 'setup.php'; exit;} 61 $accessInfo['URLfragment'] = explode('/',strtok($accessInfo['input'],'?')); 62 unset($part); 63 64 /* Determine that which interface should be loaded. */ 65 if (defined('__TEXTCUBE_NO_FANCY_URL__')) 46 66 $config->service['type'] = 'single'; 47 67 switch ($config->service['type']) { … … 62 82 } 63 83 $pathPart = strtok($pathPart,'&'); 84 /* Load interface. */ 64 85 $interfacePath = null; 65 86 if (in_array($pathPart, array('favicon.ico','index.gif'))) { … … 88 109 $accessInfo['interfacePath'] = $interfacePath; 89 110 } 90 91 111 // TODO: Add these to debug-mode output 92 112 //echo "<b>\$accessInfo : </b>"; … … 97 117 98 118 // TODO: Parse $_GET, $_POST, and etc./ 99 if(isset($accessInfo['URLfragment'][0]) && $accessInfo['URLfragment'][0] == 'owner') $this->mode = 'owner';100 else $this->mode = 'blog';101 119 $this->accessInfo = $accessInfo; 102 120 } -
trunk/library/loader.php
r7015 r7016 61 61 if (in_array($name,array('DBQuery'))) { 62 62 require_once(ROOT . "/library/data/".$config->backend_name."/Adapter.php"); 63 require_once(ROOT . "/library/data/Database.php"); 63 64 } else if(self::$relation[$name] == 'session' && isset($service['memcached']) && $service['memcached'] == true) { 64 65 require_once(ROOT . "/library/session/Session_Memcached.php"); -
trunk/library/suri.php
r7013 r7016 3 3 /// All rights reserved. Licensed under the GPL. 4 4 /// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) 5 6 5 if(isset($context)) {$url = $context->accessInfo['fullpath'];} 7 6 else { $url = isset($_SERVER['REDIRECT_URL']) ? $_SERVER['REDIRECT_URL'] : $_SERVER['SCRIPT_NAME'];}
