forked from TYPO3/Surf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsurf
executable file
·36 lines (31 loc) · 1.1 KB
/
surf
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
#!/usr/bin/env php
<?php
requireAutoloader();
$kernel = new \TYPO3\Surf\Cli\Symfony\ConsoleKernel('prod', false);
$kernel->boot();
/* @var \Symfony\Component\DependencyInjection\Container $container */
$container = $kernel->getContainer();
$application = $container->get(\TYPO3\Surf\Cli\Symfony\ConsoleApplication::class);
$application->run();
function requireAutoloader()
{
$autoloadPaths = [
// Package was included as a library
__DIR__ . '/../../../autoload.php',
// Local package usage
__DIR__ . '/../vendor/autoload.php',
// Local package in packages folder
__DIR__ . '/../../../vendor/autoload.php',
];
foreach ($autoloadPaths as $path) {
if (file_exists($path)) {
/** @noinspection PhpIncludeInspection */
return file_exists($path) && include $path;
}
}
$msg = 'You must set up the project dependencies, run the following commands:' . PHP_EOL .
'curl -sS https://getcomposer.org/installer | php' . PHP_EOL .
'php composer.phar install' . PHP_EOL;
fwrite(STDERR, $msg);
exit(1);
}