Created CLI module

This commit is contained in:
Alejandro Celaya
2016-07-19 16:50:02 +02:00
parent 5eefaf3071
commit 95d0beea3c
12 changed files with 33 additions and 12 deletions

View File

@@ -1,15 +0,0 @@
<?php
use Acelaya\UrlShortener\CLI\Command;
return [
'cli' => [
'commands' => [
Command\GenerateShortcodeCommand::class,
Command\ResolveUrlCommand::class,
Command\ListShortcodesCommand::class,
Command\GetVisitsCommand::class,
]
],
];

View File

@@ -1,5 +1,5 @@
<?php
use Acelaya\UrlShortener\CLI;
use Shlinkio\Shlink\CLI;
use Acelaya\UrlShortener\Factory\CacheFactory;
use Acelaya\UrlShortener\Factory\EntityManagerFactory;
use Acelaya\UrlShortener\Middleware;

11
config/cli-config.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Interop\Container\ContainerInterface;
/** @var ContainerInterface $container */
$container = include __DIR__ . '/container.php';
/** @var EntityManager $em */
$em = $container->get(EntityManager::class);
return ConsoleRunner::createHelperSet($em);

View File

@@ -1,4 +1,5 @@
<?php
use Shlinkio\Shlink\CLI;
use Zend\Expressive\ConfigManager\ConfigManager;
use Zend\Expressive\ConfigManager\ZendConfigProvider;
@@ -13,6 +14,7 @@ use Zend\Expressive\ConfigManager\ZendConfigProvider;
return call_user_func(function () {
$configManager = new ConfigManager([
CLI\Config\ConfigProvider::class,
new ZendConfigProvider('config/autoload/{{,*.}global,{,*.}local}.php')
], 'data/cache/app_config.php');