Location: PHPKode > projects > Artise > artise/environment/uri/parser.class.php
<?php
namespace Env\Uri { class Parser { static private $parts = array(), $clear = '', $lang_exists = false; static public function langExists() { return self::$lang_exists; } static public function parse(&$config, &$lang, $uri, $plugin_id = false) { $argv_str = $_SERVER['argc'] > 0 ? $_SERVER['argv'][0] : NULL; if($argv_str) { $_GET = array(); parse_str($argv_str, $_GET); } if($uri) { self::$clear = str_replace('?' . $argv_str, '', $uri); self::$parts = explode(DS, self::$clear); } try { if(self::$parts) { if(isset(self::$parts[1])) { $tmp_lang = strtolower(self::$parts[1]); if ($lang->set($tmp_lang)) { if ($tmp_lang == $config->get('site:lang')) { $target_location = '/' . implode('/', array_slice(self::$parts, 1)) . '/'; str_replace('//', '/', $target_location); header("HTTP/1.1 301 Moved Permanently"); header("Location: $target_location"); } self::$lang_exists = true; self::$parts = array_merge(array(''), array_slice(self::$parts, 2)); } } } if (!$lang->active()) { $lang->set($config->get('site:lang')); } } catch(\Exception $e) { } return implode(DS, self::$parts); } } } ?>
Return current item: Artise