[ci skip] DocBlocks for DB drivers' utility classes
Partially fixes issue #1295.
diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php
index a7b4efd..33d5021 100644
--- a/system/database/drivers/cubrid/cubrid_forge.php
+++ b/system/database/drivers/cubrid/cubrid_forge.php
@@ -35,13 +35,26 @@
*/
class CI_DB_cubrid_forge extends CI_DB_forge {
+ /**
+ * CREATE DATABASE statement
+ *
+ * @var string
+ */
protected $_create_database = FALSE;
+
+ // --------------------------------------------------------------------
+
+ /**
+ * DROP DATABASE statement
+ *
+ * @var string
+ */
protected $_drop_database = FALSE;
/**
* Process Fields
*
- * @param mixed the fields
+ * @param mixed $fields
* @return string
*/
protected function _process_fields($fields)
diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php
index 7f3693d..7c4d00a 100644
--- a/system/database/drivers/ibase/ibase_forge.php
+++ b/system/database/drivers/ibase/ibase_forge.php
@@ -35,12 +35,19 @@
*/
class CI_DB_ibase_forge extends CI_DB_forge {
+ /**
+ * DROP TABLE statement
+ *
+ * @var string
+ */
protected $_drop_table = 'DROP TABLE %s';
+ // --------------------------------------------------------------------
+
/**
* Create database
*
- * @param string the database name
+ * @param string $db_name
* @return string
*/
public function create_database($db_name)
diff --git a/system/database/drivers/ibase/ibase_utility.php b/system/database/drivers/ibase/ibase_utility.php
index 06de677..5eb209a 100644
--- a/system/database/drivers/ibase/ibase_utility.php
+++ b/system/database/drivers/ibase/ibase_utility.php
@@ -35,10 +35,8 @@
*/
class CI_DB_ibase_utility extends CI_DB_utility {
- protected $_list_databases = FALSE;
-
/**
- * Interbase/Firebird Export
+ * Export
*
* @param string $filename
* @return mixed
diff --git a/system/database/drivers/mssql/mssql_forge.php b/system/database/drivers/mssql/mssql_forge.php
index e0b26d8..1eef648 100644
--- a/system/database/drivers/mssql/mssql_forge.php
+++ b/system/database/drivers/mssql/mssql_forge.php
@@ -35,8 +35,15 @@
*/
class CI_DB_mssql_forge extends CI_DB_forge {
+ /**
+ * DROP TABLE statement
+ *
+ * @var string
+ */
protected $_drop_table = 'DROP TABLE %s';
+ // --------------------------------------------------------------------
+
/**
* Create Table
*
diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php
index 90cc23b..a011d59 100644
--- a/system/database/drivers/mssql/mssql_utility.php
+++ b/system/database/drivers/mssql/mssql_utility.php
@@ -35,13 +35,24 @@
*/
class CI_DB_mssql_utility extends CI_DB_utility {
+ /**
+ * List databases statement
+ *
+ * @var string
+ */
protected $_list_databases = 'EXEC sp_helpdb'; // Can also be: EXEC sp_databases
+
+ /**
+ * OPTIMIZE TABLE statement
+ *
+ * @var string
+ */
protected $_optimize_table = 'ALTER INDEX all ON %s REORGANIZE';
/**
- * MSSQL Export
+ * Export
*
- * @param array Preferences
+ * @param array $params Preferences
* @return bool
*/
protected function _backup($params = array())
diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php
index 05db862..7ce4e8b 100644
--- a/system/database/drivers/mysql/mysql_forge.php
+++ b/system/database/drivers/mysql/mysql_forge.php
@@ -35,12 +35,19 @@
*/
class CI_DB_mysql_forge extends CI_DB_forge {
+ /**
+ * CREATE DATABASE statement
+ *
+ * @var string
+ */
protected $_create_database = 'CREATE DATABASE %s CHARACTER SET %s COLLATE %s';
+ // --------------------------------------------------------------------
+
/**
* Process Fields
*
- * @param mixed the fields
+ * @param mixed $fields
* @return string
*/
protected function _process_fields($fields)
diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php
index bc20d25..8aa0517 100644
--- a/system/database/drivers/mysql/mysql_utility.php
+++ b/system/database/drivers/mysql/mysql_utility.php
@@ -35,14 +35,33 @@
*/
class CI_DB_mysql_utility extends CI_DB_utility {
+ /**
+ * List databases statement
+ *
+ * @var string
+ */
protected $_list_databases = 'SHOW DATABASES';
- protected $_optimize_table = 'OPTIMIZE TABLE %s';
- protected $_repair_table = 'REPAIR TABLE %s';
/**
- * MySQL Export
+ * OPTIMIZE TABLE statement
*
- * @param array Preferences
+ * @var string
+ */
+ protected $_optimize_table = 'OPTIMIZE TABLE %s';
+
+ /**
+ * REPAIR TABLE statement
+ *
+ * @var string
+ */
+ protected $_repair_table = 'REPAIR TABLE %s';
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Export
+ *
+ * @param array $params Preferences
* @return mixed
*/
protected function _backup($params = array())
diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php
index b3c9e8e..0732dfe 100644
--- a/system/database/drivers/mysqli/mysqli_forge.php
+++ b/system/database/drivers/mysqli/mysqli_forge.php
@@ -35,12 +35,19 @@
*/
class CI_DB_mysqli_forge extends CI_DB_forge {
+ /**
+ * CREATE DATABASE statement
+ *
+ * @var string
+ */
protected $_create_database = 'CREATE DATABASE %s CHARACTER SET %s COLLATE %s';
+ // --------------------------------------------------------------------
+
/**
* Process Fields
*
- * @param mixed the fields
+ * @param mixed $fields
* @return string
*/
protected function _process_fields($fields)
diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php
index 41a9186..345691e 100644
--- a/system/database/drivers/mysqli/mysqli_utility.php
+++ b/system/database/drivers/mysqli/mysqli_utility.php
@@ -35,14 +35,33 @@
*/
class CI_DB_mysqli_utility extends CI_DB_utility {
+ /**
+ * List databases statement
+ *
+ * @var string
+ */
protected $_list_databases = 'SHOW DATABASES';
- protected $_optimize_table = 'OPTIMIZE TABLE %s';
- protected $_repair_table = 'REPAIR TABLE %s';
/**
- * MySQLi Export
+ * OPTIMIZE TABLE statement
*
- * @param array Preferences
+ * @var string
+ */
+ protected $_optimize_table = 'OPTIMIZE TABLE %s';
+
+ /**
+ * REPAIR TABLE statement
+ *
+ * @var string
+ */
+ protected $_repair_table = 'REPAIR TABLE %s';
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Export
+ *
+ * @param array $params Preferences
* @return mixed
*/
protected function _backup($params = array())
diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php
index fed8141..ad578f8 100644
--- a/system/database/drivers/oci8/oci8_forge.php
+++ b/system/database/drivers/oci8/oci8_forge.php
@@ -35,10 +35,29 @@
*/
class CI_DB_oci8_forge extends CI_DB_forge {
+ /**
+ * CREATE DATABASE statement
+ *
+ * @var string
+ */
protected $_create_database = FALSE;
+
+ /**
+ * DROP DATABASE statement
+ *
+ * @var string
+ */
protected $_drop_database = FALSE;
+
+ /**
+ * DROP TABLE statement
+ *
+ * @var string
+ */
protected $_drop_table = 'DROP TABLE %s';
+ // --------------------------------------------------------------------
+
/**
* Create Table
*
diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php
index 0c6cfc6..e5aae81 100644
--- a/system/database/drivers/oci8/oci8_utility.php
+++ b/system/database/drivers/oci8/oci8_utility.php
@@ -35,12 +35,17 @@
*/
class CI_DB_oci8_utility extends CI_DB_utility {
+ /**
+ * List databases statement
+ *
+ * @var string
+ */
protected $_list_databases = 'SELECT username FROM dba_users'; // Schemas are actual usernames
/**
- * Oracle Export
+ * Export
*
- * @param array Preferences
+ * @param array $params Preferences
* @return mixed
*/
protected function _backup($params = array())
diff --git a/system/database/drivers/odbc/odbc_forge.php b/system/database/drivers/odbc/odbc_forge.php
index fb85c2a..699ce99 100644
--- a/system/database/drivers/odbc/odbc_forge.php
+++ b/system/database/drivers/odbc/odbc_forge.php
@@ -35,8 +35,15 @@
*/
class CI_DB_odbc_forge extends CI_DB_forge {
+ /**
+ * DROP TABLE statement
+ *
+ * @var string
+ */
protected $_drop_table = 'DROP TABLE %s';
+ // --------------------------------------------------------------------
+
/**
* Create Table
*
diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php
index 715bfc9..bfa94f4 100644
--- a/system/database/drivers/odbc/odbc_utility.php
+++ b/system/database/drivers/odbc/odbc_utility.php
@@ -35,12 +35,10 @@
*/
class CI_DB_odbc_utility extends CI_DB_utility {
- protected $_list_databases = FALSE;
-
/**
- * ODBC Export
+ * Export
*
- * @param array Preferences
+ * @param array $params Preferences
* @return mixed
*/
protected function _backup($params = array())
diff --git a/system/database/drivers/pdo/pdo_forge.php b/system/database/drivers/pdo/pdo_forge.php
index 8c22eb3..e77970c 100644
--- a/system/database/drivers/pdo/pdo_forge.php
+++ b/system/database/drivers/pdo/pdo_forge.php
@@ -35,8 +35,15 @@
*/
class CI_DB_pdo_forge extends CI_DB_forge {
+ /**
+ * DROP TABLE statement
+ *
+ * @var string
+ */
protected $_drop_table = 'DROP TABLE %s';
+ // --------------------------------------------------------------------
+
/**
* Create Table
*
diff --git a/system/database/drivers/pdo/pdo_utility.php b/system/database/drivers/pdo/pdo_utility.php
index ed4d685..03b3092 100644
--- a/system/database/drivers/pdo/pdo_utility.php
+++ b/system/database/drivers/pdo/pdo_utility.php
@@ -35,12 +35,10 @@
*/
class CI_DB_pdo_utility extends CI_DB_utility {
- protected $_list_databases = FALSE;
-
/**
- * PDO Export
+ * Export
*
- * @param array Preferences
+ * @param array $params Preferences
* @return mixed
*/
protected function _backup($params = array())
diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php
index aac82c1..b08fa51 100644
--- a/system/database/drivers/postgre/postgre_forge.php
+++ b/system/database/drivers/postgre/postgre_forge.php
@@ -35,13 +35,20 @@
*/
class CI_DB_postgre_forge extends CI_DB_forge {
+ /**
+ * DROP TABLE statement
+ *
+ * @var string
+ */
protected $_drop_table = 'DROP TABLE IF EXISTS %s CASCADE';
+ // --------------------------------------------------------------------
+
/**
* Process Fields
*
* @param mixed $fields
- * @param array $primary_keys = array()
+ * @param array $primary_keys
* @return string
*/
protected function _process_fields($fields, $primary_keys = array())
@@ -195,7 +202,7 @@
* @param string $alter_type the ALTER type (ADD, DROP, CHANGE)
* @param string $table the table name
* @param string $fields the column definition
- * @param string $after_field = ''
+ * @param string $after_field
* @return string
*/
protected function _alter_table($alter_type, $table, $fields, $after_field = '')
diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php
index 96cd90e..bae1c67 100644
--- a/system/database/drivers/postgre/postgre_utility.php
+++ b/system/database/drivers/postgre/postgre_utility.php
@@ -35,13 +35,26 @@
*/
class CI_DB_postgre_utility extends CI_DB_utility {
+ /**
+ * List databases statement
+ *
+ * @var string
+ */
protected $_list_databases = 'SELECT datname FROM pg_database';
- protected $_optimize_table = 'REINDEX TABLE %s';
/**
- * Postgre Export
+ * OPTIMIZE TABLE statement
*
- * @param array Preferences
+ * @var string
+ */
+ protected $_optimize_table = 'REINDEX TABLE %s';
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Export
+ *
+ * @param array $params Preferences
* @return mixed
*/
protected function _backup($params = array())
diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php
index 15ebc03..2fd5c85 100644
--- a/system/database/drivers/sqlite/sqlite_utility.php
+++ b/system/database/drivers/sqlite/sqlite_utility.php
@@ -35,12 +35,10 @@
*/
class CI_DB_sqlite_utility extends CI_DB_utility {
- protected $_list_databases = FALSE;
-
/**
- * SQLite Export
+ * Export
*
- * @param array Preferences
+ * @param array $params Preferences
* @return mixed
*/
protected function _backup($params = array())
diff --git a/system/database/drivers/sqlite3/sqlite3_utility.php b/system/database/drivers/sqlite3/sqlite3_utility.php
index 043c349..6f276eb 100644
--- a/system/database/drivers/sqlite3/sqlite3_utility.php
+++ b/system/database/drivers/sqlite3/sqlite3_utility.php
@@ -35,12 +35,10 @@
*/
class CI_DB_sqlite3_utility extends CI_DB_utility {
- protected $_list_databases = FALSE;
-
/**
- * SQLite Export
+ * Export
*
- * @param array Preferences
+ * @param array $params Preferences
* @return mixed
*/
protected function _backup($params = array())
diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php
index 1e5ef4b..8155565 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_forge.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php
@@ -35,8 +35,15 @@
*/
class CI_DB_sqlsrv_forge extends CI_DB_forge {
+ /**
+ * DROP TABLE statement
+ *
+ * @var string
+ */
protected $_drop_table = 'DROP TABLE %s';
+ // --------------------------------------------------------------------
+
/**
* Create Table
*
diff --git a/system/database/drivers/sqlsrv/sqlsrv_utility.php b/system/database/drivers/sqlsrv/sqlsrv_utility.php
index 5f7d0bd..3150900 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_utility.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_utility.php
@@ -35,13 +35,26 @@
*/
class CI_DB_sqlsrv_utility extends CI_DB_utility {
+ /**
+ * List databases statement
+ *
+ * @var string
+ */
protected $_list_databases = 'EXEC sp_helpdb'; // Can also be: EXEC sp_databases
- protected $_optimize_table = 'ALTER INDEX all ON %s REORGANIZE';
/**
- * SQLSRV Export
+ * OPTIMIZE TABLE statement
*
- * @param array Preferences
+ * @var string
+ */
+ protected $_optimize_table = 'ALTER INDEX all ON %s REORGANIZE';
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Export
+ *
+ * @param array $params Preferences
* @return bool
*/
protected function _backup($params = array())