1
0
Fork 0
mirror of https://github.com/shlinkio/shlink.git synced 2025-03-16 13:10:29 +03:00
shlink/bin/cli

18 lines
606 B
Text
Raw Normal View History

2016-04-16 12:57:11 +02:00
#!/usr/bin/env php
<?php
2016-04-17 20:27:24 +02:00
use Interop\Container\ContainerInterface;
2016-04-16 12:57:11 +02:00
use Zend\Diactoros\ServerRequestFactory;
use Zend\Diactoros\Uri;
use Zend\Expressive\Application;
2016-04-17 20:27:24 +02:00
/** @var ContainerInterface $container */
$container = include __DIR__ . '/../config/container.php';
2016-04-16 12:57:11 +02:00
/** @var Application $app */
2016-04-17 20:27:24 +02:00
$app = $container->get(Application::class);
2016-04-16 12:57:11 +02:00
$command = count($_SERVER['argv']) > 1 ? $_SERVER['argv'][1] : '';
$request = ServerRequestFactory::fromGlobals()
->withMethod('CLI')
->withUri(new Uri(sprintf('/%s', $command)));
$app->run($request);