summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Anbar <aanbar@gmail.com>2015-01-12 11:36:45 +0100
committerAhmad Anbar <aanbar@gmail.com>2015-01-12 11:36:45 +0100
commit6db62ab0ad0e223806a1367e12b1884b48dc65d7 (patch)
treefe3257e417dab12f1f4053308a5a281d0640b721
parentc8e1de74b139dc7f3e776f7ebf98495ec5b780a6 (diff)
parent5350f056698168061ffde1ba62e8db1715101446 (diff)
Merge remote-tracking branch 'upstream/develop' into develop
-rw-r--r--.travis.yml7
-rw-r--r--system/database/drivers/cubrid/cubrid_driver.php7
-rw-r--r--system/database/drivers/ibase/ibase_driver.php7
-rw-r--r--system/database/drivers/mssql/mssql_driver.php7
-rw-r--r--system/database/drivers/mysql/mysql_driver.php7
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php7
-rw-r--r--system/database/drivers/oci8/oci8_driver.php8
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php7
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php7
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php7
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php2
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_informix_driver.php2
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php7
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_oci_driver.php8
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php7
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php7
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php7
-rw-r--r--system/database/drivers/postgre/postgre_driver.php7
-rw-r--r--system/database/drivers/sqlite/sqlite_driver.php7
-rw-r--r--system/database/drivers/sqlite3/sqlite3_driver.php7
-rw-r--r--system/database/drivers/sqlsrv/sqlsrv_driver.php7
-rw-r--r--system/language/english/form_validation_lang.php1
-rw-r--r--system/libraries/Form_validation.php2
-rw-r--r--tests/codeigniter/core/Output_test.php23
-rw-r--r--tests/mocks/database/schema/skeleton.php34
25 files changed, 59 insertions, 140 deletions
diff --git a/.travis.yml b/.travis.yml
index 49c092d4b..3a823f7b0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,7 @@
language: php
php:
+ - 5.2
- 5.3.3
- 5.4
- 5.5
@@ -19,7 +20,7 @@ env:
sudo: false
before_script:
- - composer install --dev --no-progress
+ - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear channel-discover pear.bovigo.org && pear install bovigo/vfsStream-beta; else composer install --dev --no-progress; fi"
- sh -c "if [ '$DB' = 'pgsql' ] || [ '$DB' = 'pdo/pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS ci_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ] || [ '$DB' = 'pdo/pgsql' ]; then psql -c 'create database ci_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ] || [ '$DB' = 'mysqli' ] || [ '$DB' = 'pdo/mysql' ]; then mysql -e 'create database IF NOT EXISTS ci_test;'; fi"
@@ -34,6 +35,10 @@ matrix:
env: DB=pgsql
- php: hhvm
env: DB=pdo/pgsql
+ - php: 5.2
+ env: DB=sqlite
+ - php: 5.2
+ env: DB=pdo/sqlite
branches:
only:
diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php
index 3e36ecc92..438b48a5c 100644
--- a/system/database/drivers/cubrid/cubrid_driver.php
+++ b/system/database/drivers/cubrid/cubrid_driver.php
@@ -347,13 +347,8 @@ class CI_DB_cubrid_driver extends CI_DB {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
if (($query = $this->query('SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE))) === FALSE)
{
return FALSE;
diff --git a/system/database/drivers/ibase/ibase_driver.php b/system/database/drivers/ibase/ibase_driver.php
index aac606886..20c5d9c57 100644
--- a/system/database/drivers/ibase/ibase_driver.php
+++ b/system/database/drivers/ibase/ibase_driver.php
@@ -264,13 +264,8 @@ class CI_DB_ibase_driver extends CI_DB {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
$sql = 'SELECT "rfields"."RDB$FIELD_NAME" AS "name",
CASE "fields"."RDB$FIELD_TYPE"
WHEN 7 THEN \'SMALLINT\'
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index 2fd21dbf3..1aeff1d5a 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -344,13 +344,8 @@ class CI_DB_mssql_driver extends CI_DB {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
$sql = 'SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, COLUMN_DEFAULT
FROM INFORMATION_SCHEMA.Columns
WHERE UPPER(TABLE_NAME) = '.$this->escape(strtoupper($table));
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index 819d5e54b..41cb14ba4 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -419,13 +419,8 @@ class CI_DB_mysql_driver extends CI_DB {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
if (($query = $this->query('SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE))) === FALSE)
{
return FALSE;
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 4f58e836d..4370986bf 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -402,13 +402,8 @@ class CI_DB_mysqli_driver extends CI_DB {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
if (($query = $this->query('SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE))) === FALSE)
{
return FALSE;
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index 162a87b01..f57e042c5 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -535,13 +535,9 @@ class CI_DB_oci8_driver extends CI_DB {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
- elseif (strpos($table, '.') !== FALSE)
+ if (strpos($table, '.') !== FALSE)
{
sscanf($table, '%[^.].%s', $owner, $table);
}
diff --git a/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php b/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
index f8e60f97e..9ed66314b 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php
@@ -142,13 +142,8 @@ class CI_DB_pdo_cubrid_driver extends CI_DB_pdo_driver {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
if (($query = $this->query('SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE))) === FALSE)
{
return FALSE;
diff --git a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
index 111623865..d1d42875a 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php
@@ -192,13 +192,8 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
$sql = 'SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, COLUMN_DEFAULT
FROM INFORMATION_SCHEMA.Columns
WHERE UPPER(TABLE_NAME) = '.$this->escape(strtoupper($table));
diff --git a/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php b/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
index 2ada47811..5fffd5a44 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php
@@ -150,13 +150,8 @@ class CI_DB_pdo_firebird_driver extends CI_DB_pdo_driver {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
$sql = 'SELECT "rfields"."RDB$FIELD_NAME" AS "name",
CASE "fields"."RDB$FIELD_TYPE"
WHEN 7 THEN \'SMALLINT\'
diff --git a/system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php b/system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
index b639df1da..17a7732fc 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php
@@ -174,7 +174,7 @@ class CI_DB_pdo_ibm_driver extends CI_DB_pdo_driver {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
$sql = 'SELECT "colname" AS "name", "typename" AS "type", "default" AS "default", "length" AS "max_length",
CASE "keyseq" WHEN NULL THEN 0 ELSE 1 END AS "primary_key"
diff --git a/system/database/drivers/pdo/subdrivers/pdo_informix_driver.php b/system/database/drivers/pdo/subdrivers/pdo_informix_driver.php
index a293e3d26..01e32f5f4 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_informix_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_informix_driver.php
@@ -187,7 +187,7 @@ class CI_DB_pdo_informix_driver extends CI_DB_pdo_driver {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
$sql = 'SELECT "syscolumns"."colname" AS "name",
CASE "syscolumns"."coltype"
diff --git a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
index fe75af7a0..e4e4fa069 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
@@ -199,13 +199,8 @@ class CI_DB_pdo_mysql_driver extends CI_DB_pdo_driver {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
if (($query = $this->query('SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE))) === FALSE)
{
return FALSE;
diff --git a/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php b/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
index 33c7c2ac0..b80da33c2 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php
@@ -184,13 +184,9 @@ class CI_DB_pdo_oci_driver extends CI_DB_pdo_driver {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
- elseif (strpos($table, '.') !== FALSE)
+ if (strpos($table, '.') !== FALSE)
{
sscanf($table, '%[^.].%s', $owner, $table);
}
diff --git a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
index 1707e1d11..158c5d2eb 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
@@ -261,13 +261,8 @@ class CI_DB_pdo_pgsql_driver extends CI_DB_pdo_driver {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
$sql = 'SELECT "column_name", "data_type", "character_maximum_length", "numeric_precision", "column_default"
FROM "information_schema"."columns"
WHERE LOWER("table_name") = '.$this->escape(strtolower($table));
diff --git a/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php b/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php
index e37db4769..e1c8670a9 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php
@@ -142,13 +142,8 @@ class CI_DB_pdo_sqlite_driver extends CI_DB_pdo_driver {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
if (($query = $this->query('PRAGMA TABLE_INFO('.$this->protect_identifiers($table, TRUE, NULL, FALSE).')')) === FALSE)
{
return FALSE;
diff --git a/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php b/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
index f507837bf..ac3513560 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php
@@ -221,13 +221,8 @@ class CI_DB_pdo_sqlsrv_driver extends CI_DB_pdo_driver {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
$sql = 'SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, COLUMN_DEFAULT
FROM INFORMATION_SCHEMA.Columns
WHERE UPPER(TABLE_NAME) = '.$this->escape(strtoupper($table));
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index c98c14eb1..fa5934972 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -463,13 +463,8 @@ class CI_DB_postgre_driver extends CI_DB {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
$sql = 'SELECT "column_name", "data_type", "character_maximum_length", "numeric_precision", "column_default"
FROM "information_schema"."columns"
WHERE LOWER("table_name") = '.$this->escape(strtolower($table));
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index fe48e9b7a..2137bade0 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -263,13 +263,8 @@ class CI_DB_sqlite_driver extends CI_DB {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
if (($query = $this->query('PRAGMA TABLE_INFO('.$this->protect_identifiers($table, TRUE, NULL, FALSE).')')) === FALSE)
{
return FALSE;
diff --git a/system/database/drivers/sqlite3/sqlite3_driver.php b/system/database/drivers/sqlite3/sqlite3_driver.php
index a68157402..27d2bbfff 100644
--- a/system/database/drivers/sqlite3/sqlite3_driver.php
+++ b/system/database/drivers/sqlite3/sqlite3_driver.php
@@ -268,13 +268,8 @@ class CI_DB_sqlite3_driver extends CI_DB {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
if (($query = $this->query('PRAGMA TABLE_INFO('.$this->protect_identifiers($table, TRUE, NULL, FALSE).')')) === FALSE)
{
return FALSE;
diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php
index d774f6ba8..078aaec3d 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_driver.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php
@@ -355,13 +355,8 @@ class CI_DB_sqlsrv_driver extends CI_DB {
* @param string $table
* @return array
*/
- public function field_data($table = '')
+ public function field_data($table)
{
- if ($table === '')
- {
- return ($this->db_debug) ? $this->display_error('db_field_param_missing') : FALSE;
- }
-
$sql = 'SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, COLUMN_DEFAULT
FROM INFORMATION_SCHEMA.Columns
WHERE UPPER(TABLE_NAME) = '.$this->escape(strtoupper($table));
diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php
index d4de218b8..558949bf6 100644
--- a/system/language/english/form_validation_lang.php
+++ b/system/language/english/form_validation_lang.php
@@ -64,6 +64,7 @@ $lang['form_validation_less_than'] = 'The {field} field must contain a number l
$lang['form_validation_less_than_equal_to'] = 'The {field} field must contain a number less than or equal to {param}.';
$lang['form_validation_greater_than'] = 'The {field} field must contain a number greater than {param}.';
$lang['form_validation_greater_than_equal_to'] = 'The {field} field must contain a number greater than or equal to {param}.';
+$lang['form_validation_error_message_not_set'] = 'Unable to access an error message corresponding to your field name {field}.';
/* End of file form_validation_lang.php */
/* Location: ./system/language/english/form_validation_lang.php */ \ No newline at end of file
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index d9d92f0ad..f731544b1 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -831,7 +831,7 @@ class CI_Form_validation {
// DEPRECATED support for non-prefixed keys
&& FALSE === ($line = $this->CI->lang->line($rule, FALSE)))
{
- $line = 'Unable to access an error message corresponding to your field name.';
+ $line = $this->CI->lang->line('form_validation_error_message_not_set');
}
}
else
diff --git a/tests/codeigniter/core/Output_test.php b/tests/codeigniter/core/Output_test.php
index a06c17045..887c077d7 100644
--- a/tests/codeigniter/core/Output_test.php
+++ b/tests/codeigniter/core/Output_test.php
@@ -3,19 +3,20 @@
class Output_test extends CI_TestCase {
public $output;
- protected $_output_data = <<<HTML
-<html>
- <head>
- <title>Basic HTML</title>
- </head>
- <body>
- Test
- </body>
-</html>
-HTML;
+ protected $_output_data = '';
public function set_up()
{
+ $this->_output_data =<<<HTML
+ <html>
+ <head>
+ <title>Basic HTML</title>
+ </head>
+ <body>
+ Test
+ </body>
+ </html>
+HTML;
$this->ci_set_config('charset', 'UTF-8');
$output = $this->ci_core_class('output');
$this->output = new $output();
@@ -59,4 +60,4 @@ HTML;
);
}
-} \ No newline at end of file
+}
diff --git a/tests/mocks/database/schema/skeleton.php b/tests/mocks/database/schema/skeleton.php
index e5c536090..b6d4b7893 100644
--- a/tests/mocks/database/schema/skeleton.php
+++ b/tests/mocks/database/schema/skeleton.php
@@ -22,7 +22,7 @@ class Mock_Database_Schema_Skeleton {
*/
public static function init($driver)
{
- if (empty(static::$db) && empty(static::$forge))
+ if (empty(self::$db) && empty(self::$forge))
{
$config = Mock_Database_DB::config($driver);
$connection = new Mock_Database_DB($config);
@@ -34,12 +34,12 @@ class Mock_Database_Schema_Skeleton {
$loader->dbforge();
$forge = CI_TestCase::instance()->ci_instance_var('dbforge');
- static::$db = $db;
- static::$forge = $forge;
- static::$driver = $driver;
+ self::$db = $db;
+ self::$forge = $forge;
+ self::$driver = $driver;
}
- return static::$db;
+ return self::$db;
}
/**
@@ -50,7 +50,7 @@ class Mock_Database_Schema_Skeleton {
public static function create_tables()
{
// User Table
- static::$forge->add_field(array(
+ self::$forge->add_field(array(
'id' => array(
'type' => 'INTEGER',
'constraint' => 3
@@ -68,11 +68,11 @@ class Mock_Database_Schema_Skeleton {
'constraint' => 40
)
));
- static::$forge->add_key('id', TRUE);
- static::$forge->create_table('user', TRUE);
+ self::$forge->add_key('id', TRUE);
+ self::$forge->create_table('user', TRUE);
// Job Table
- static::$forge->add_field(array(
+ self::$forge->add_field(array(
'id' => array(
'type' => 'INTEGER',
'constraint' => 3
@@ -85,11 +85,11 @@ class Mock_Database_Schema_Skeleton {
'type' => 'TEXT'
)
));
- static::$forge->add_key('id', TRUE);
- static::$forge->create_table('job', TRUE);
+ self::$forge->add_key('id', TRUE);
+ self::$forge->create_table('job', TRUE);
// Misc Table
- static::$forge->add_field(array(
+ self::$forge->add_field(array(
'id' => array(
'type' => 'INTEGER',
'constraint' => 3
@@ -102,8 +102,8 @@ class Mock_Database_Schema_Skeleton {
'type' => 'TEXT'
)
));
- static::$forge->add_key('id', TRUE);
- static::$forge->create_table('misc', TRUE);
+ self::$forge->add_key('id', TRUE);
+ self::$forge->create_table('misc', TRUE);
}
/**
@@ -136,13 +136,13 @@ class Mock_Database_Schema_Skeleton {
foreach ($data as $table => $dummy_data)
{
- static::$db->truncate($table);
+ self::$db->truncate($table);
foreach ($dummy_data as $single_dummy_data)
{
- static::$db->insert($table, $single_dummy_data);
+ self::$db->insert($table, $single_dummy_data);
}
}
}
-} \ No newline at end of file
+}