-
-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathcouscous
More file actions
executable file
·43 lines (35 loc) · 1.1 KB
/
couscous
File metadata and controls
executable file
·43 lines (35 loc) · 1.1 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
#!/usr/bin/env php
<?php
/**
* Runs Couscous.
*
* @author Matthieu Napoli <matthieu@mnapoli.fr>
*/
use Couscous\Application\ContainerFactory;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Output\ConsoleOutput;
if (version_compare(phpversion(), '5.4', '<')) {
die('You must use PHP >= 8.2 in order to use Couscous. Please upgrade your PHP version.');
}
if (!ini_get('date.timezone')) {
date_default_timezone_set('UTC');
}
// Phar
if (isset($include)) {
require_once $include . '/vendor/autoload.php';
} elseif (file_exists(__DIR__ . '/../vendor/autoload.php')) {
require_once __DIR__ . '/../vendor/autoload.php';
} else {
require_once __DIR__ . '/../../../autoload.php';
}
$output = new ConsoleOutput();
$factory = new ContainerFactory();
$container = $factory->createContainer();
// Set the logger
$logger = $container->make('Symfony\Component\Console\Logger\ConsoleLogger', [
'output' => $output,
]);
$container->set('Psr\Log\LoggerInterface', $logger);
/** @var Application $application */
$application = $container->get('application');
$application->run();