mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 04:40:44 +02:00
new methods added to PDO class.
This commit is contained in:
@@ -369,7 +369,37 @@
|
|||||||
public function columnCount();
|
public function columnCount();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the current database language
|
||||||
|
* @param string $lang English, French etc.
|
||||||
|
* @return null
|
||||||
|
*/
|
||||||
|
public function setLanguage($lang);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current database language
|
||||||
|
* @return string $lang English, French etc.
|
||||||
|
*/
|
||||||
|
public function getLanguage();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Drop/delete table and all it's data
|
||||||
|
* @param string $table name without the prefix
|
||||||
|
* @return bool|int
|
||||||
|
*/
|
||||||
|
public function dropTable($table);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the last database query used.
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getLastQuery();
|
||||||
|
|
||||||
}
|
}
|
@@ -99,7 +99,7 @@
|
|||||||
|
|
||||||
function db_IsLang($table, $multiple=false)
|
function db_IsLang($table, $multiple=false)
|
||||||
{
|
{
|
||||||
$this->hasLanguage($table, $multiple);
|
return $this->hasLanguage($table, $multiple);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1563,7 +1563,7 @@ class e_db_pdo implements e_db
|
|||||||
* @access private
|
* @access private
|
||||||
* @return mixed the name of the language table (eg. lan_french_news) or an array of all matching language tables. (with mprefix)
|
* @return mixed the name of the language table (eg. lan_french_news) or an array of all matching language tables. (with mprefix)
|
||||||
*/
|
*/
|
||||||
function hasLanguage($table, $multiple=false)
|
public function hasLanguage($table, $multiple=false)
|
||||||
{
|
{
|
||||||
//When running a multi-language site with english included. English must be the main site language.
|
//When running a multi-language site with english included. English must be the main site language.
|
||||||
// WARNING!!! FALSE is critical important - if missed, expect dead loop (prefs are calling db handler as well when loading)
|
// WARNING!!! FALSE is critical important - if missed, expect dead loop (prefs are calling db handler as well when loading)
|
||||||
@@ -2344,7 +2344,16 @@ class e_db_pdo implements e_db
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Drop/delete table and all it's data
|
||||||
|
* @param string $table name without the prefix
|
||||||
|
* @return bool|int
|
||||||
|
*/
|
||||||
|
public function dropTable($table)
|
||||||
|
{
|
||||||
|
$name = $this->mySQLPrefix.strtolower($table);
|
||||||
|
return $this->gen("DROP TABLE IF EXISTS ".$name);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dump MySQL Table(s) to a file in the Backup folder.
|
* Dump MySQL Table(s) to a file in the Backup folder.
|
||||||
@@ -2530,16 +2539,20 @@ class e_db_pdo implements e_db
|
|||||||
$this->mySQLlastErrText = '';
|
$this->mySQLlastErrText = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLastQuery()
|
/**
|
||||||
|
* Returns the last database query used.
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getLastQuery()
|
||||||
{
|
{
|
||||||
return $this->mySQLlastQuery;
|
return $this->mySQLlastQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private function setSQLMode()
|
private function setSQLMode()
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->db_Query("SET SESSION sql_mode='NO_ENGINE_SUBSTITUTION';");
|
$this->db_Query("SET SESSION sql_mode='NO_ENGINE_SUBSTITUTION';");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2554,7 +2567,6 @@ class e_db_pdo implements e_db
|
|||||||
$this->db_Query("SET NAMES `$charset`");
|
$this->db_Query("SET NAMES `$charset`");
|
||||||
|
|
||||||
$this->mySQLcharset = $charset;
|
$this->mySQLcharset = $charset;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2563,6 +2575,25 @@ class e_db_pdo implements e_db
|
|||||||
return $this->mySQLcharset;
|
return $this->mySQLcharset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the database language
|
||||||
|
* @param string $lang French, German etc.
|
||||||
|
*/
|
||||||
|
public function setLanguage($lang)
|
||||||
|
{
|
||||||
|
$this->mySQLlanguage = $lang;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current database language. eg. English, French etc.
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getLanguage()
|
||||||
|
{
|
||||||
|
return $this->mySQLlanguage;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the _FIELD_DEFS and _NOTNULL definitions for a table
|
* Get the _FIELD_DEFS and _NOTNULL definitions for a table
|
||||||
*<code>
|
*<code>
|
||||||
|
Reference in New Issue
Block a user