shlink/bin/cli

18 lines
606 B
Plaintext
Raw Normal View History

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