From: Konrad Rosenbaum Date: Thu, 10 Mar 2016 20:45:31 +0000 (+0100) Subject: move some protected DB methods to public for better diagnostics, X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=3bd32ee1471e362af22682c72f562a1bfa761581;p=konrad%2Fpack.git move some protected DB methods to public for better diagnostics, fix constants for older PHP 5 versions --- 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; }