This commit is contained in:
2022-01-09 03:50:38 +08:00
parent 08dc3e262b
commit 5e02a79bf0
113 changed files with 12713 additions and 12703 deletions
+31 -31
View File
@@ -1,31 +1,31 @@
<?php
define('SUCCESS', 0);
define('NO_AUTH', 401);
define('ERROR_MESSAGES', [
SUCCESS => 'ok',
NO_AUTH => ''
]);
if (!function_exists('message')) {
/**
* @param $code
* @param $replace
* @param string $default
* @return mixed|string
*/
function message($code, $replace, $default = '')
{
if (!isset(ERROR_MESSAGES[$code])) {
if (!empty($default)) {
return $default;
}
return 'unknown error';
}
return sprintf(ERROR_MESSAGES[$code], $replace);
}
}
<?php
define('SUCCESS', 0);
define('NO_AUTH', 401);
define('ERROR_MESSAGES', [
SUCCESS => 'ok',
NO_AUTH => ''
]);
if (!function_exists('message')) {
/**
* @param $code
* @param $replace
* @param string $default
* @return mixed|string
*/
function message($code, $replace, $default = '')
{
if (!isset(ERROR_MESSAGES[$code])) {
if (!empty($default)) {
return $default;
}
return 'unknown error';
}
return sprintf(ERROR_MESSAGES[$code], $replace);
}
}