mirror of
https://github.com/flextype/flextype.git
synced 2025-08-10 15:14:20 +02:00
feat(core): Flextype Solid Core - next round #458
This commit is contained in:
47
src/flextype/app/Foundation/Flextype.php
Normal file
47
src/flextype/app/Foundation/Flextype.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Flextype (https://flextype.org)
|
||||
* Founded by Sergey Romanenko and maintained by Flextype Community.
|
||||
*/
|
||||
|
||||
namespace Flextype\App\Foundation;
|
||||
|
||||
use Slim\App;
|
||||
|
||||
class Flextype extends App
|
||||
{
|
||||
/**
|
||||
* Flextype version
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const FLEXTYPE_VERSION = '0.9.0';
|
||||
|
||||
private $instance;
|
||||
|
||||
private $flextype;
|
||||
|
||||
public function __construct($flextype = [])
|
||||
{
|
||||
parent::__construct($flextype);
|
||||
$this->instance = $this;
|
||||
$this->container = $this->instance->getContainer();
|
||||
}
|
||||
|
||||
public function container($key = null)
|
||||
{
|
||||
if ($key != null) {
|
||||
return $this->container[$key];
|
||||
}
|
||||
|
||||
return $this->container;
|
||||
}
|
||||
|
||||
public function getInstance()
|
||||
{
|
||||
return $this->instance;
|
||||
}
|
||||
}
|
@@ -11,7 +11,7 @@ namespace Flextype;
|
||||
|
||||
use Flextype\Component\Registry\Registry;
|
||||
use Flextype\Component\Session\Session;
|
||||
use Slim\App;
|
||||
use Flextype\App\Foundation\Flextype;
|
||||
use Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware;
|
||||
use function date_default_timezone_set;
|
||||
use function error_reporting;
|
||||
@@ -36,40 +36,6 @@ $registry = new Registry();
|
||||
*/
|
||||
include_once ROOT_DIR . '/src/flextype/preflight.php';
|
||||
|
||||
class Flextype extends App
|
||||
{
|
||||
/**
|
||||
* Flextype version
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const FLEXTYPE_VERSION = '0.9.0';
|
||||
|
||||
public $instance;
|
||||
public $flextype;
|
||||
|
||||
public function __construct($flextype = [])
|
||||
{
|
||||
parent::__construct($flextype);
|
||||
$this->instance = $this;
|
||||
$this->container = $this->instance->getContainer();
|
||||
}
|
||||
|
||||
public function container($key = null)
|
||||
{
|
||||
if ($key != null) {
|
||||
return $this->container[$key];
|
||||
}
|
||||
|
||||
return $this->container;
|
||||
}
|
||||
|
||||
public function getInstance()
|
||||
{
|
||||
return $this->instance;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create new application
|
||||
*/
|
||||
|
Reference in New Issue
Block a user