-
-
Notifications
You must be signed in to change notification settings - Fork 263
Expand file tree
/
Copy pathconsole
More file actions
executable file
·55 lines (49 loc) · 1.77 KB
/
console
File metadata and controls
executable file
·55 lines (49 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env php
<?php
/**
* phpMyFAQ Console Application
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/.
*
* @package phpMyFAQ
* @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @copyright 2025-2026 phpMyFAQ Team
* @license https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
* @link https://www.phpmyfaq.de
* @since 2025-06-25
*/
require __DIR__ . '/../phpmyfaq/src/Bootstrap.php';
require __DIR__ . '/../phpmyfaq/src/libs/autoload.php';
use phpMyFAQ\Command\CreateHashesCommand;use phpMyFAQ\Command\McpServerCommand;
use phpMyFAQ\Translation;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Console\Application;
use phpMyFAQ\Command\UpdateCommand;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
try {
Translation::create()
->setTranslationsDir(PMF_LANGUAGE_DIR)
->setDefaultLanguage('en')
->setCurrentLanguage('en')
->setMultiByteLanguage();
} catch (Exception $exception) {
echo $exception->getMessage();
}
//
// Service Containers
//
$container = new ContainerBuilder();
$loader = new PhpFileLoader($container, new FileLocator(__DIR__));
try {
$loader->load('../phpmyfaq/src/services.php');
} catch (Exception $e) {
echo $e->getMessage();
}
$application = new Application();
$application->addCommand(new CreateHashesCommand($container->get('phpmyfaq.system'), $container->get('filesystem')));
$application->addCommand(new McpServerCommand($container->get('phpmyfaq.service.mcp-server')));
$application->addCommand(new UpdateCommand());
$application->run();