Move factory classes to a subfolder
This commit is contained in:
parent
123a6c5ad9
commit
0a220d4d8e
9 changed files with 21 additions and 17 deletions
|
@ -1,7 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Alltube;
|
||||
namespace Alltube\Factory;
|
||||
|
||||
use Alltube\Config;
|
||||
use Alltube\Exception\ConfigException;
|
||||
use Alltube\UglyRouter;
|
||||
use Slim\Container;
|
||||
use Symfony\Component\ErrorHandler\Debug;
|
||||
|
||||
|
@ -13,12 +16,13 @@ class ConfigFactory
|
|||
{
|
||||
|
||||
/**
|
||||
* @param Container $container
|
||||
* @return Config
|
||||
* @throws Exception\ConfigException
|
||||
* @throws ConfigException
|
||||
*/
|
||||
public static function create(Container $container)
|
||||
{
|
||||
$configPath = __DIR__ . '/../config/config.yml';
|
||||
$configPath = __DIR__ . '/../../config/config.yml';
|
||||
if (is_file($configPath)) {
|
||||
$config = Config::fromFile($configPath);
|
||||
} else {
|
|
@ -1,8 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Alltube;
|
||||
namespace Alltube\Factory;
|
||||
|
||||
use Alltube\Exception\DependencyException;
|
||||
use Alltube\LocaleManager;
|
||||
|
||||
/**
|
||||
* Class LocaleManagerFactory
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Alltube;
|
||||
namespace Alltube\Factory;
|
||||
|
||||
use Consolidation\Log\Logger;
|
||||
use Consolidation\Log\LogOutputStyler;
|
|
@ -4,8 +4,9 @@
|
|||
* ViewFactory class.
|
||||
*/
|
||||
|
||||
namespace Alltube;
|
||||
namespace Alltube\Factory;
|
||||
|
||||
use Alltube\LocaleManager;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Slim\Http\Request;
|
||||
use Slim\Http\Uri;
|
||||
|
@ -33,7 +34,7 @@ class ViewFactory
|
|||
$request = $container->get('request');
|
||||
}
|
||||
|
||||
$view = new Smarty(__DIR__ . '/../templates/');
|
||||
$view = new Smarty(__DIR__ . '/../../templates/');
|
||||
|
||||
/** @var Uri $uri */
|
||||
$uri = $request->getUri();
|
Loading…
Add table
Add a link
Reference in a new issue