OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)

This commit is contained in:
wangruiguo
2026-09-03 18:49:20 +08:00
commit d647428529
3501 changed files with 1988906 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace Leantime\Core\Bootstrap;
use Illuminate\Contracts\Foundation\Application;
use Leantime\Core\Console\CliRequest;
class SetRequestForConsole
{
/**
* Bootstrap the given application.
*
* @return void
*/
public function bootstrap(Application $app)
{
$uri = $app->make('config')->get('app.url', 'http://localhost');
$uri = empty($uri) ? 'http://localhost' : $uri;
$components = parse_url($uri);
$server = $_SERVER;
if (isset($components['path'])) {
$server = array_merge([
'SCRIPT_FILENAME' => $components['path'],
'SCRIPT_NAME' => $components['path'],
], $server);
}
if (! defined('BASE_URL')) {
define('BASE_URL', $uri);
}
// IMPORTANT: We can't use the native laravel bootstrapper for this because they inject Illuminate\Http\Request
// And we need CliRequest
$app->instance('request', CliRequest::create(
$uri, 'GET', [], [], [], $server
));
}
}