Skip to content

Commit

Permalink
Merge pull request #85 from philippebeck/dev
Browse files Browse the repository at this point in the history
Release 4.5.0
  • Loading branch information
philippebeck authored Jul 8, 2020
2 parents 02cc6ea + 2a1ebce commit eaff5b1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "philippebeck/pam",
"version": "4.4.0",
"version": "4.5.0",
"type": "library",
"description": "Php Adaptive Microframework",
"keywords": [
Expand Down
11 changes: 2 additions & 9 deletions core/Controller/MainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,14 @@
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Error\SyntaxError;
use Twig\Extension\DebugExtension;
use Twig\Loader\FilesystemLoader;

/**
* Class MainController
* @package Pam\Controller
*/
abstract class MainController extends GlobalsController
abstract class MainController extends ServiceController
{
/**
* @var ServiceController|null
*/
protected $service = null;

/**
* @var Environment|null
*/
Expand All @@ -35,8 +29,7 @@ public function __construct()
{
parent::__construct();

$this->service = new ServiceController();
$this->twig = new Environment(new FilesystemLoader(VIEW_PATH), array("cache" => VIEW_CACHE));
$this->twig = new Environment(new FilesystemLoader(VIEW_PATH), array("cache" => VIEW_CACHE));

$this->twig->addExtension(new MainExtension());
$this->twig->addExtension(new GlobalsExtension());
Expand Down
4 changes: 3 additions & 1 deletion core/Controller/ServiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Class ServiceController
* @package Pam\Controller
*/
class ServiceController
abstract class ServiceController extends GlobalsController
{
/**
* @var ArrayManager
Expand Down Expand Up @@ -50,6 +50,8 @@ class ServiceController
*/
public function __construct()
{
parent::__construct();

$this->array = new ArrayManager();
$this->curl = new CurlManager();
$this->image = new ImageManager();
Expand Down
7 changes: 6 additions & 1 deletion core/Model/Factory/PdoFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ class PdoFactory
public static function getPDO()
{
if (self::$pdo === null) {
self::$pdo = new PDO(DB_DSN, DB_USER, DB_PASS, DB_OPTIONS);
self::$pdo = new PDO(
"mysql:host=" . DB_HOST . ";dbname=" . DB_NAME,
DB_USER,
DB_PASS,
DB_OPTIONS
);
self::$pdo->exec("SET NAMES UTF8");
}

Expand Down

0 comments on commit eaff5b1

Please sign in to comment.