mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-29 21:12:36 +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
|
<?php
|
||||||
|
|
||||||
use Zend\Stdlib\ArrayUtils;
|
use Zend\Stdlib\ArrayUtils;
|
||||||
use Zend\Stdlib\Glob;
|
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
|
<?php
|
||||||
|
use Zend\Expressive\Application;
|
||||||
|
|
||||||
chdir(dirname(__DIR__));
|
chdir(dirname(__DIR__));
|
||||||
require 'vendor/autoload.php';
|
|
||||||
|
|
||||||
/** @var \Interop\Container\ContainerInterface $container */
|
/** @var Application $app */
|
||||||
$container = require 'config/container.php';
|
$app = include 'config/app.php';
|
||||||
|
|
||||||
/** @var \Zend\Expressive\Application $app */
|
|
||||||
$app = $container->get(\Zend\Expressive\Application::class);
|
|
||||||
$app->run();
|
$app->run();
|
||||||
|
|
Loading…
Add table
Reference in a new issue