mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
upload preivew + es command
This commit is contained in:
@@ -275,11 +275,11 @@ class NexusDB
|
||||
global $Cache;
|
||||
$result = $Cache->get_value($key);
|
||||
if ($result === false) {
|
||||
do_log("cache miss, get from database.");
|
||||
do_log("cache miss [$key], get from database.");
|
||||
$result = $callback();
|
||||
$Cache->cache_value($key, $result, $ttl);
|
||||
} else {
|
||||
do_log("cache hit.");
|
||||
do_log("cache hit [$key].");
|
||||
}
|
||||
return $result;
|
||||
} else {
|
||||
|
||||
@@ -428,6 +428,9 @@ class Install
|
||||
if ($key == 'CACHE_DRIVER') {
|
||||
$newData[$key] = 'redis';
|
||||
}
|
||||
if ($key == 'QUEUE_CONNECTION') {
|
||||
$newData[$key] = 'redis';
|
||||
}
|
||||
if ($scene == 'install' || !file_exists($envFile)) {
|
||||
if ($key == 'APP_ENV') {
|
||||
$newData[$key] = 'production';
|
||||
|
||||
@@ -11,6 +11,8 @@ require ROOT_PATH . 'include/constants.php';
|
||||
$withLaravel = false;
|
||||
if (file_exists(ROOT_PATH . '.env')) {
|
||||
require ROOT_PATH . 'include/eloquent.php';
|
||||
require ROOT_PATH . 'classes/class_cache_redis.php';
|
||||
$Cache = new class_cache_redis();
|
||||
$withLaravel = true;
|
||||
}
|
||||
define('WITH_LARAVEL', $withLaravel);
|
||||
|
||||
+12
-5
@@ -129,14 +129,21 @@ final class Nexus
|
||||
private function setRequestId()
|
||||
{
|
||||
$requestId = '';
|
||||
$names = ['HTTP_X_REQUEST_ID', 'REQUEST_ID', 'Request-Id', 'request-id'];
|
||||
if ($this->runningInOctane()) {
|
||||
$request = request();
|
||||
$requestId = $request->server('request_id', $request->header('request_id', ''));
|
||||
foreach ($names as $name) {
|
||||
$requestId = $request->server($name, $request->header($name));
|
||||
if (!empty($requestId)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!empty($_SERVER['HTTP_X_REQUEST_ID'])) {
|
||||
$requestId = $_SERVER['HTTP_X_REQUEST_ID'];
|
||||
} elseif (!empty($_SERVER['REQUEST_ID'])) {
|
||||
$requestId = $_SERVER['REQUEST_ID'];
|
||||
foreach ($names as $name) {
|
||||
$requestId = $_SERVER[$name] ?? '';
|
||||
if (!empty($requestId)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($requestId)) {
|
||||
|
||||
Reference in New Issue
Block a user