mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-21 16:38:37 -06:00
Created CLI module
This commit is contained in:
parent
5eefaf3071
commit
95d0beea3c
@ -2,6 +2,7 @@
|
||||
"name": "shlinkio/shlink",
|
||||
"type": "project",
|
||||
"homepage": "http://shlink.io",
|
||||
"description": "A PHP-based URL shortener application with analytics and management",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
@ -36,12 +37,18 @@
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Acelaya\\UrlShortener\\": "src"
|
||||
"Acelaya\\UrlShortener\\": "src",
|
||||
"Shlinkio\\Shlink\\CLI\\": "module/CLI/src",
|
||||
"Shlinkio\\Shlink\\Rest\\": "module/Rest/src",
|
||||
"Shlinkio\\Shlink\\Core\\": "module/Core/src"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"AcelayaTest\\UrlShortener\\": "tests"
|
||||
"AcelayaTest\\UrlShortener\\": "tests",
|
||||
"ShlinkioTest\\Shlink\\CLI\\": "module/CLI/test",
|
||||
"ShlinkioTest\\Shlink\\Rest\\": "module/Rest/test",
|
||||
"ShlinkioTest\\Shlink\\Core\\": "module/Core/test"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
|
@ -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;
|
||||
|
@ -4,7 +4,7 @@ use Doctrine\ORM\Tools\Console\ConsoleRunner;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
/** @var ContainerInterface $container */
|
||||
$container = include __DIR__ . '/config/container.php';
|
||||
$container = include __DIR__ . '/container.php';
|
||||
/** @var EntityManager $em */
|
||||
$em = $container->get(EntityManager::class);
|
||||
|
@ -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');
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
use Acelaya\UrlShortener\CLI\Command;
|
||||
use Shlinkio\Shlink\CLI\Command;
|
||||
|
||||
return [
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Acelaya\UrlShortener\CLI\Command;
|
||||
namespace Shlinkio\Shlink\CLI\Command;
|
||||
|
||||
use Acelaya\UrlShortener\Exception\InvalidUrlException;
|
||||
use Acelaya\UrlShortener\Service\UrlShortener;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Acelaya\UrlShortener\CLI\Command;
|
||||
namespace Shlinkio\Shlink\CLI\Command;
|
||||
|
||||
use Acelaya\UrlShortener\Service\VisitsTracker;
|
||||
use Acelaya\UrlShortener\Service\VisitsTrackerInterface;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Acelaya\UrlShortener\CLI\Command;
|
||||
namespace Shlinkio\Shlink\CLI\Command;
|
||||
|
||||
use Acelaya\UrlShortener\Paginator\Adapter\PaginableRepositoryAdapter;
|
||||
use Acelaya\UrlShortener\Paginator\Util\PaginatorUtilsTrait;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Acelaya\UrlShortener\CLI\Command;
|
||||
namespace Shlinkio\Shlink\CLI\Command;
|
||||
|
||||
use Acelaya\UrlShortener\Exception\InvalidShortCodeException;
|
||||
use Acelaya\UrlShortener\Service\UrlShortener;
|
13
module/CLI/src/Config/ConfigProvider.php
Normal file
13
module/CLI/src/Config/ConfigProvider.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace Shlinkio\Shlink\CLI\Config;
|
||||
|
||||
use Zend\Config\Factory;
|
||||
use Zend\Stdlib\Glob;
|
||||
|
||||
class ConfigProvider
|
||||
{
|
||||
public function __invoke()
|
||||
{
|
||||
return Factory::fromFiles(Glob::glob(__DIR__ . '/../../config/{,*.}config.php', Glob::GLOB_BRACE));
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Acelaya\UrlShortener\CLI\Factory;
|
||||
namespace Shlinkio\Shlink\CLI\Factory;
|
||||
|
||||
use Interop\Container\ContainerInterface;
|
||||
use Interop\Container\Exception\ContainerException;
|
Loading…
Reference in New Issue
Block a user