Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[ci skip] DocBlocks for DB drivers' utility classes

Partially fixes issue #1295.
  • Loading branch information...
commit c98e93aab3997bfea4fbb9d07f7b2550a84f8f7a 1 parent ae85eb4
@narfbg narfbg authored
Showing with 205 additions and 40 deletions.
  1. +10 −3 system/database/DB_utility.php
  2. +14 −1 system/database/drivers/cubrid/cubrid_forge.php
  3. +8 −1 system/database/drivers/ibase/ibase_forge.php
  4. +1 −3 system/database/drivers/ibase/ibase_utility.php
  5. +7 −0 system/database/drivers/mssql/mssql_forge.php
  6. +13 −2 system/database/drivers/mssql/mssql_utility.php
  7. +8 −1 system/database/drivers/mysql/mysql_forge.php
  8. +21 −2 system/database/drivers/mysql/mysql_utility.php
  9. +8 −1 system/database/drivers/mysqli/mysqli_forge.php
  10. +21 −2 system/database/drivers/mysqli/mysqli_utility.php
  11. +19 −0 system/database/drivers/oci8/oci8_forge.php
  12. +7 −2 system/database/drivers/oci8/oci8_utility.php
  13. +7 −0 system/database/drivers/odbc/odbc_forge.php
  14. +2 −4 system/database/drivers/odbc/odbc_utility.php
  15. +7 −0 system/database/drivers/pdo/pdo_forge.php
  16. +2 −4 system/database/drivers/pdo/pdo_utility.php
  17. +9 −2 system/database/drivers/postgre/postgre_forge.php
  18. +15 −2 system/database/drivers/postgre/postgre_utility.php
  19. +2 −4 system/database/drivers/sqlite/sqlite_utility.php
  20. +2 −4 system/database/drivers/sqlite3/sqlite3_utility.php
  21. +7 −0 system/database/drivers/sqlsrv/sqlsrv_forge.php
  22. +15 −2 system/database/drivers/sqlsrv/sqlsrv_utility.php
View
13 system/database/DB_utility.php
@@ -45,23 +45,30 @@
// --------------------------------------------------------------------
/**
+ * List databases statement
+ *
+ * @var string
+ */
+ $_list_databases = FALSE;
+
+ /**
* OPTIMIZE TABLE statement
*
- * @var string|bool
+ * @var string
*/
protected $_optimize_table = FALSE;
/**
* REPAIR TABLE statement
*
- * @var string|bool
+ * @var string
*/
protected $_repair_table = FALSE;
// --------------------------------------------------------------------
/**
- * Constructor
+ * Class constructor
*
* @return void
*/
View
15 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)
View
9 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)
View
4 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
View
7 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
*
View
15 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())
View
9 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)
View
23 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';
+
+ /**
+ * OPTIMIZE TABLE statement
+ *
+ * @var string
+ */
protected $_optimize_table = 'OPTIMIZE TABLE %s';
+
+ /**
+ * REPAIR TABLE statement
+ *
+ * @var string
+ */
protected $_repair_table = 'REPAIR TABLE %s';
+ // --------------------------------------------------------------------
+
/**
- * MySQL Export
+ * Export
*
- * @param array Preferences
+ * @param array $params Preferences
* @return mixed
*/
protected function _backup($params = array())
View
9 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)
View
23 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';
+
+ /**
+ * OPTIMIZE TABLE statement
+ *
+ * @var string
+ */
protected $_optimize_table = 'OPTIMIZE TABLE %s';
+
+ /**
+ * REPAIR TABLE statement
+ *
+ * @var string
+ */
protected $_repair_table = 'REPAIR TABLE %s';
+ // --------------------------------------------------------------------
+
/**
- * MySQLi Export
+ * Export
*
- * @param array Preferences
+ * @param array $params Preferences
* @return mixed
*/
protected function _backup($params = array())
View
19 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
*
View
9 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())
View
7 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
*
View
6 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())
View
7 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
*
View
6 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())
View
11 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 @@ protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_
* @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 = '')
View
17 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';
+
+ /**
+ * OPTIMIZE TABLE statement
+ *
+ * @var string
+ */
protected $_optimize_table = 'REINDEX TABLE %s';
+ // --------------------------------------------------------------------
+
/**
- * Postgre Export
+ * Export
*
- * @param array Preferences
+ * @param array $params Preferences
* @return mixed
*/
protected function _backup($params = array())
View
6 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())
View
6 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())
View
7 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
*
View
17 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
+
+ /**
+ * OPTIMIZE TABLE statement
+ *
+ * @var string
+ */
protected $_optimize_table = 'ALTER INDEX all ON %s REORGANIZE';
+ // --------------------------------------------------------------------
+
/**
- * SQLSRV Export
+ * Export
*
- * @param array Preferences
+ * @param array $params Preferences
* @return bool
*/
protected function _backup($params = array())
Please sign in to comment.
Something went wrong with that request. Please try again.