Skip to content

Commit

Permalink
minor read change. refactor to __construct for supporting php-7
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksanderakero committed Jun 8, 2016
1 parent a362e22 commit cf035a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!**
Expand Down
2 changes: 1 addition & 1 deletion lib/app_basket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class APP_Basket {

function APP_Basket(){
function __construct(){
if(!isset($_SESSION['basket'])){
$this->createBasket();
}
Expand Down
9 changes: 4 additions & 5 deletions lib/app_db.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}

/**
Expand Down

0 comments on commit cf035a9

Please sign in to comment.