Update uri.php

This commit is contained in:
Namhyeon Go 2018-01-01 01:16:24 +09:00 committed by GitHub
parent 52cf20a258
commit 9651c94d71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,10 +1,17 @@
<?php
$requests = array(
"_ALL" => $_REQUEST,
"_POST" => $_POST,
"_GET" => $_GET,
"_URI" => !array_key_empty("REQUEST_URI", $_SERVER) ? $_SERVER["REQUEST_URI"] : ''
);
if(!function_exists("base_url")) {
function base_url() {
global $config;
$base_url = '';
if(array_key_exists("base_url", $config)) {
if(!array_key_empty("base_url", $config)) {
$base_url = $config["base_url"];
}
@ -14,9 +21,11 @@ if(!function_exists("base_url")) {
if(!function_exists("get_uri")) {
function get_uri() {
global $requests;
$request_uri = '';
if(array_key_exists("REQUEST_URI", $_SERVER)) {
$request_uri = $_SERVER["REQUEST_URI"];
if(!array_key_empty("REQUEST_URI", $_SERVER)) {
$request_uri = $requests["_URI"];
}
return $request_uri;