shlink/bin/cli
2016-04-30 19:24:45 +02:00

18 lines
606 B
PHP
Executable File

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