mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-27 13:34:30 -04:00
Refactoring.
This commit is contained in:
parent
b67c22f33b
commit
fc8a0589dd
6 changed files with 99 additions and 62 deletions
|
@ -1,5 +1,11 @@
|
|||
<?php
|
||||
|
||||
function normalize_path($path, $trailing_slash = false) {
|
||||
|
||||
$path = str_replace("\\", "/", $path);
|
||||
return preg_match("#^(\w:)?/$#", $path) ? $path : (rtrim($path, "/") . ($trailing_slash ? "/" : ""));
|
||||
}
|
||||
|
||||
function json_exit($obj = array()) {
|
||||
|
||||
$obj["code"] = 0;
|
||||
|
@ -15,6 +21,11 @@ function json_fail($code, $msg = "", $cond = true) {
|
|||
}
|
||||
}
|
||||
|
||||
function has_request_param($key) {
|
||||
|
||||
return array_key_exists($key, $_REQUEST);
|
||||
}
|
||||
|
||||
function use_request_params($keys) {
|
||||
|
||||
if (!is_array($keys)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue