From cf035a9efafde0f36f626fc4f5dcd5c8c5155de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksander=20Aker=C3=B8?= Date: Wed, 8 Jun 2016 21:58:43 +0200 Subject: [PATCH] minor read change. refactor to __construct for supporting php-7 --- README.md | 4 ++-- lib/app_basket.class.php | 2 +- lib/app_db.class.php | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a3a269e..5a8fdfb 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,8 @@ This should just be necessary if you are on a Unix based system. Windows users, Open your preferred Terminal app, go to your webserver root and run these commands: - chmod 777 core/lib/Smarty/templates_c -R - chmod 777 core/lib/Smarty/cache -R + chmod -R 777 core/lib/Smarty/templates_c + chmod -R 777 core/lib/Smarty/cache ## 6. Enjoy your site! Also, be sure to check out [the php-site project](https://github.com/Dalisra/php-site) and install lots of sites on the same webserver using the same core and **be awesome!** diff --git a/lib/app_basket.class.php b/lib/app_basket.class.php index c6f066d..260536e 100644 --- a/lib/app_basket.class.php +++ b/lib/app_basket.class.php @@ -7,7 +7,7 @@ class APP_Basket { - function APP_Basket(){ + function __construct(){ if(!isset($_SESSION['basket'])){ $this->createBasket(); } diff --git a/lib/app_db.class.php b/lib/app_db.class.php index 18801de..87903b6 100644 --- a/lib/app_db.class.php +++ b/lib/app_db.class.php @@ -27,20 +27,19 @@ class APP_DB extends mysqli { /** * @var mysqli_result */ - var $result; - function APP_DB($host, $user, $password, $dbname, $port = 3306) { - $this->log = Logger::getLogger("com.dalisra.DB"); + function __construct($host, $user, $password, $dbname, $port = 3306) + { + $this->log = Logger::getLogger("com.dalisra.DB"); mysqli_report(MYSQLI_REPORT_STRICT); // tell mysqli to throw exceptions. try{ - parent::mysqli($host, $user, $password, $dbname, $port); + parent::__construct($host, $user, $password, $dbname, $port); $this->connected = true; }catch (Exception $e){ $this->connected = false; $this->setError("Failed to connect to database." . $e); $this->log->error("Failed to connect to database: " . $e); } - } /**