mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
[api] reward + thanks
This commit is contained in:
@@ -6,6 +6,7 @@ use Illuminate\Database\Capsule\Manager as Capsule;
|
||||
use Illuminate\Database\Query\Expression;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Redis;
|
||||
|
||||
class NexusDB
|
||||
{
|
||||
@@ -286,6 +287,50 @@ class NexusDB
|
||||
}
|
||||
}
|
||||
|
||||
public static function cache_put($key, $value, $ttl = 3600)
|
||||
{
|
||||
if (IN_NEXUS) {
|
||||
global $Cache;
|
||||
return $Cache->cache_value($key, $value, $ttl);
|
||||
} else {
|
||||
return Cache::put($key, $value, $ttl);
|
||||
}
|
||||
}
|
||||
|
||||
public static function cache_get($key)
|
||||
{
|
||||
if (IN_NEXUS) {
|
||||
global $Cache;
|
||||
return $Cache->get_value($key);
|
||||
} else {
|
||||
return Cache::get($key);
|
||||
}
|
||||
}
|
||||
|
||||
public static function cache_del($key)
|
||||
{
|
||||
if (IN_NEXUS) {
|
||||
global $Cache;
|
||||
$Cache->delete_value($key, true);
|
||||
} else {
|
||||
Cache::forget($key);
|
||||
$langList = get_langfolder_list();
|
||||
foreach ($langList as $lf) {
|
||||
Cache::forget($lf . '_' . $key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function redis()
|
||||
{
|
||||
if (IN_NEXUS) {
|
||||
global $Cache;
|
||||
$Cache->getRedis();
|
||||
} else {
|
||||
Redis::connection()->client();
|
||||
}
|
||||
}
|
||||
|
||||
public static function getMysqlColumnInfo($table, $column)
|
||||
{
|
||||
static $driver;
|
||||
|
||||
Reference in New Issue
Block a user