Skip to content

Commit

Permalink
SQLite3: Fix PHP7 compatibility
Browse files Browse the repository at this point in the history
Includes fallback for PHP4.
  • Loading branch information
franzliedke committed Nov 5, 2015
1 parent d3a71fa commit 1a41347
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions include/dblayer/sqlite3.php
Expand Up @@ -32,7 +32,7 @@ class DBLayer
);


function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
function __construct($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
{
// Prepend $db_name with the path to the forum root directory
$db_name = PUN_ROOT.$db_name;
Expand All @@ -53,6 +53,12 @@ function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_
}


function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect)
{
$this->__construct($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect);
}


function start_transaction()
{
return $this->pdo->beginTransaction();
Expand Down Expand Up @@ -426,7 +432,7 @@ function add_field($table_name, $field_name, $field_type, $allow_null, $default_

if (!$allow_null)
$query .= ' NOT NULL';

if ($default_value === '')
$default_value = '\'\'';

Expand Down

0 comments on commit 1a41347

Please sign in to comment.