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,39 @@
<?php
namespace Leantime\Domain\Environment\Commands;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class SyncEnvironment extends Command
{
protected static $defaultName = 'env:sync';
protected static $defaultDescription = 'Synchronizes environment variables to .env file';
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('Starting environment variable sync...');
$envFile = base_path('.env');
// Create or clear the .env file
file_put_contents($envFile, '# Generated by env:sync command - '.date('Y-m-d H:i:s')."\n");
// Get all environment variables
foreach ($_ENV as $name => $value) {
if (str_starts_with($name, 'LEAN_')) {
$escapedValue = str_replace(['\\', '"', '$'], ['\\\\', '\\"', '\\$'], $value);
file_put_contents($envFile, "{$name}=\"{$escapedValue}\"\n", FILE_APPEND);
}
}
// Set proper permissions
chmod($envFile, 0640);
$output->writeln('Environment sync completed.');
return Command::SUCCESS;
}
}