mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-23 05:13:13 +03:00
Improved configuration
This commit is contained in:
parent
c6997bda64
commit
998a926c35
4 changed files with 15 additions and 23 deletions
12
config/app.php
Normal file
12
config/app.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
use Zend\Expressive\Application;
|
||||
use Zend\ServiceManager\ServiceManager;
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
// Build container
|
||||
$config = require __DIR__ . '/config.php';
|
||||
$container = new ServiceManager($config['services']);
|
||||
$container->setService('config', $config);
|
||||
|
||||
return $container->get(Application::class);
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
use Zend\Stdlib\ArrayUtils;
|
||||
use Zend\Stdlib\Glob;
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Zend\ServiceManager\Config;
|
||||
use Zend\ServiceManager\ServiceManager;
|
||||
|
||||
// Load configuration
|
||||
$config = require __DIR__ . '/config.php';
|
||||
|
||||
// Build container
|
||||
$container = new ServiceManager();
|
||||
(new Config($config['services']))->configureServiceManager($container);
|
||||
|
||||
// Inject config
|
||||
$container->setService('config', $config);
|
||||
|
||||
return $container;
|
|
@ -1,11 +1,8 @@
|
|||
<?php
|
||||
use Zend\Expressive\Application;
|
||||
|
||||
chdir(dirname(__DIR__));
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
/** @var \Interop\Container\ContainerInterface $container */
|
||||
$container = require 'config/container.php';
|
||||
|
||||
/** @var \Zend\Expressive\Application $app */
|
||||
$app = $container->get(\Zend\Expressive\Application::class);
|
||||
/** @var Application $app */
|
||||
$app = include 'config/app.php';
|
||||
$app->run();
|
||||
|
|
Loading…
Reference in a new issue