Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
Dependencies moved to Factory classes
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorkmaz committed Jul 20, 2017
1 parent 260f643 commit 3b73046
Show file tree
Hide file tree
Showing 45 changed files with 233 additions and 273 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"require": {
"php": "^7.1",
"selami/stdlib": "^1.3",
"selami/foundation": "~0.9",
"selami/foundation": "~0.10",
"symfony/http-foundation": "~3.3",
"selami/console": "~0.2",
"symfony/process": "~3.3"
Expand All @@ -32,7 +32,7 @@
"SelamiApp\\Controller\\": "src/apps/www/controllers",
"SelamiApp\\Command\\": "src/commands",
"SelamiApp\\Extension\\": "src/extensions",
"SelamiApp\\": "src/base"
"SelamiApp\\Factories\\": "src/factories"

}
},
Expand Down
127 changes: 33 additions & 94 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions config/autoload/dependencies.global.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
<?php
declare(strict_types=1);

use Psr\Http\Message\ServerRequestInterface;
use Psr\Container\ContainerInterface;
use Symfony\Component\HttpFoundation\Session\Session;
use Selami\Router;
use Selami\View\ViewInterface as SelamiView;
use Twig_Environment as TwigEnvironment;
use Selami\Foundation\App as SelamiApplication;
use SelamiApp\Factories;
return [
'dependencies' => [
'factories' => [
ServerRequestInterface::class => Factories\ServerRequestFactory::class,
SelamiApplication::class => Factories\SelamiApplicationFactory::class,
Session::class => Factories\SymfonySessionFactory::class,
Router::class => Factories\RouterFactory::class,
TwigEnvironment::class => Factories\TwigFactory::class,
SelamiView::class => Factories\SelamiViewFactory::class
],
]
];
9 changes: 0 additions & 9 deletions config/autoload/languages.global.php

This file was deleted.

7 changes: 1 addition & 6 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
use Zend\Stdlib\Glob;

$siteBasedConfig = '';
if (defined('RUNTIME_PLATFORM')) {
$siteBasedConfig = RUNTIME_PLATFORM.'_';
}

if (defined('RUNTIME_LANG')) {
$siteBasedConfig .= RUNTIME_LANG.'_';
}
Expand All @@ -21,9 +19,6 @@
foreach (Glob::glob(__DIR__ . '/autoload/{{,*.}global,{,*.}local}.php', Glob::GLOB_BRACE) as $file) {
$config = ArrayUtils::merge($config, include $file);
}
if (defined('RUNTIME_PLATFORM')) {
$config = ArrayUtils::merge($config, include __DIR__ . '/sites/'.RUNTIME_PLATFORM.'.config.php');
}

if (defined('RUNTIME_LANG')) {
$config = ArrayUtils::merge($config, include __DIR__ . '/lang/' . RUNTIME_LANG . '.php');
Expand Down
Loading

0 comments on commit 3b73046

Please sign in to comment.