From 3bd32ee1471e362af22682c72f562a1bfa761581 Mon Sep 17 00:00:00 2001 From: Konrad Rosenbaum Date: Thu, 10 Mar 2016 21:45:31 +0100 Subject: [PATCH] move some protected DB methods to public for better diagnostics, fix constants for older PHP 5 versions --- phpbase/db.php | 4 ++-- phpbase/db_mysql.php | 2 +- phpbase/db_pgsql.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpbase/db.php b/phpbase/db.php index c9e3afa..adc9bfa 100644 --- a/phpbase/db.php +++ b/phpbase/db.php @@ -88,7 +88,7 @@ abstract class DbEngine protected abstract function createTable($tablename,$table); /**transform an internally used table name to the actual table name in the DB; the default implementation returns exactly what it gets*/ - protected function tableName($tname){return $tname;} + public function tableName($tname){return $tname;} /**returns the correct type name for the required abstract data type; types that must be understood are: int32 (INTEGER), int64 (LONG INTEGER), seq32 (auto-incrementing int), seq64, bool (boolean), string:$length (text up to 255 chars, length is optional, default is 255; VARCHAR($length)), text (unlimited text)*/ @@ -174,7 +174,7 @@ abstract class DbEngine const COLUMN_CREATE_NULL = 2; const COLUMN_CREATE_PKEY = 4; const COLUMN_CREATE_FKEY = 8; - const COLUMN_CREATE_KEY = self::COLUMN_CREATE_PKEY | self::COLUMN_CREATE_FKEY; + const COLUMN_CREATE_KEY = 12; const COLUMN_CREATE_DEFAULT = 16; const COLUMN_CREATE_INDEX = 32; const COLUMN_CREATE_ALL = 0xffff; diff --git a/phpbase/db_mysql.php b/phpbase/db_mysql.php index 73da9e7..8390e3a 100644 --- a/phpbase/db_mysql.php +++ b/phpbase/db_mysql.php @@ -269,7 +269,7 @@ class MysqlEngine extends DbEngine return $schemanull==$dbnull; } - protected function tableName($tn) + public function tableName($tn) { return $this->prefix.$tn; } diff --git a/phpbase/db_pgsql.php b/phpbase/db_pgsql.php index f6cabaf..657164c 100644 --- a/phpbase/db_pgsql.php +++ b/phpbase/db_pgsql.php @@ -299,7 +299,7 @@ class PGsqlEngine extends DbEngine return $ret; } - protected function tableName($tn) + public function tableName($tn) { return $this->prefix.$tn; } -- 1.7.2.5