From 285094926c7d6013222dea89d467bef86a91df63 Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 14 Aug 2020 16:56:57 +0300 Subject: [PATCH] feat(core): Flextype Solid Core - next round #458 --- src/flextype/app/Foundation/Flextype.php | 47 ++++++++++++++++++++++++ src/flextype/bootstrap.php | 36 +----------------- 2 files changed, 48 insertions(+), 35 deletions(-) create mode 100644 src/flextype/app/Foundation/Flextype.php diff --git a/src/flextype/app/Foundation/Flextype.php b/src/flextype/app/Foundation/Flextype.php new file mode 100644 index 00000000..93b4b502 --- /dev/null +++ b/src/flextype/app/Foundation/Flextype.php @@ -0,0 +1,47 @@ +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; + } +} diff --git a/src/flextype/bootstrap.php b/src/flextype/bootstrap.php index af1212a8..481ef377 100755 --- a/src/flextype/bootstrap.php +++ b/src/flextype/bootstrap.php @@ -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 */