Added get_dir_file_info(), get_file_info(), and get_mime_by_extension() to the File Helper.
Changed ( ! condition) into (! condition) within the code
diff --git a/system/database/DB.php b/system/database/DB.php
index 16ca1c8..8efe055 100644
--- a/system/database/DB.php
+++ b/system/database/DB.php
@@ -29,7 +29,7 @@
{
include(APPPATH.'config/database'.EXT);
- if ( ! isset($db) OR count($db) == 0)
+ if (! isset($db) OR count($db) == 0)
{
show_error('No database connection settings were found in the database config file.');
}
@@ -39,7 +39,7 @@
$active_group = $params;
}
- if ( ! isset($active_group) OR ! isset($db[$active_group]))
+ if (! isset($active_group) OR ! isset($db[$active_group]))
{
show_error('You have specified an invalid database connection group.');
}
@@ -71,7 +71,7 @@
}
// No DB specified yet? Beat them senseless...
- if ( ! isset($params['dbdriver']) OR $params['dbdriver'] == '')
+ if (! isset($params['dbdriver']) OR $params['dbdriver'] == '')
{
show_error('You have not selected a database type to connect to.');
}
@@ -92,14 +92,14 @@
{
require_once(BASEPATH.'database/DB_active_rec'.EXT);
- if ( ! class_exists('CI_DB'))
+ if (! class_exists('CI_DB'))
{
eval('class CI_DB extends CI_DB_active_record { }');
}
}
else
{
- if ( ! class_exists('CI_DB'))
+ if (! class_exists('CI_DB'))
{
eval('class CI_DB extends CI_DB_driver { }');
}
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index 6f50c11..1820bd2 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -315,7 +315,7 @@
{
$type = strtoupper(trim($type));
- if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))
+ if (! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))
{
$type = '';
}
@@ -411,7 +411,7 @@
*/
function _where($key, $value = NULL, $type = 'AND ', $escape = TRUE)
{
- if ( ! is_array($key))
+ if (! is_array($key))
{
$key = array($key => $value);
}
@@ -420,13 +420,13 @@
{
$prefix = (count($this->ar_where) == 0) ? '' : $type;
- if ( ! $this->_has_operator($k) && is_null($key[$k]))
+ if (! $this->_has_operator($k) && is_null($key[$k]))
{
// value appears not to have been set, assign the test to IS NULL
$k .= ' IS NULL';
}
- if ( ! is_null($v))
+ if (! is_null($v))
{
if ($escape === TRUE)
@@ -442,7 +442,7 @@
}
}
- if ( ! $this->_has_operator($k))
+ if (! $this->_has_operator($k))
{
$k .= ' =';
}
@@ -690,7 +690,7 @@
*/
function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '')
{
- if ( ! is_array($field))
+ if (! is_array($field))
{
$field = array($field => $match);
}
@@ -832,7 +832,7 @@
*/
function _having($key, $value = '', $type = 'AND ', $escape = TRUE)
{
- if ( ! is_array($key))
+ if (! is_array($key))
{
$key = array($key => $value);
}
@@ -972,7 +972,7 @@
{
$key = $this->_object_to_array($key);
- if ( ! is_array($key))
+ if (! is_array($key))
{
$key = array($key => $value);
}
@@ -1022,7 +1022,7 @@
$this->from($table);
}
- if ( ! is_null($limit))
+ if (! is_null($limit))
{
$this->limit($limit, $offset);
}
@@ -1087,12 +1087,12 @@
$this->from($table);
}
- if ( ! is_null($where))
+ if (! is_null($where))
{
$this->where($where);
}
- if ( ! is_null($limit))
+ if (! is_null($limit))
{
$this->limit($limit, $offset);
}
@@ -1130,7 +1130,7 @@
*/
function insert($table = '', $set = NULL)
{
- if ( ! is_null($set))
+ if (! is_null($set))
{
$this->set($set);
}
@@ -1146,7 +1146,7 @@
if ($table == '')
{
- if ( ! isset($this->ar_from[0]))
+ if (! isset($this->ar_from[0]))
{
if ($this->db_debug)
{
@@ -1179,7 +1179,7 @@
*/
function update($table = '', $set = NULL, $where = NULL, $limit = NULL)
{
- if ( ! is_null($set))
+ if (! is_null($set))
{
$this->set($set);
}
@@ -1195,7 +1195,7 @@
if ($table == '')
{
- if ( ! isset($this->ar_from[0]))
+ if (! isset($this->ar_from[0]))
{
if ($this->db_debug)
{
@@ -1238,7 +1238,7 @@
{
if ($table == '')
{
- if ( ! isset($this->ar_from[0]))
+ if (! isset($this->ar_from[0]))
{
if ($this->db_debug)
{
@@ -1279,7 +1279,7 @@
{
if ($table == '')
{
- if ( ! isset($this->ar_from[0]))
+ if (! isset($this->ar_from[0]))
{
if ($this->db_debug)
{
@@ -1321,7 +1321,7 @@
{
if ($table == '')
{
- if ( ! isset($this->ar_from[0]))
+ if (! isset($this->ar_from[0]))
{
if ($this->db_debug)
{
@@ -1401,7 +1401,7 @@
function _has_operator($str)
{
$str = trim($str);
- if ( ! preg_match("/(\s|<|>|!|=|is null|is not null)/i", $str))
+ if (! preg_match("/(\s|<|>|!|=|is null|is not null)/i", $str))
{
return FALSE;
}
@@ -1474,7 +1474,7 @@
{
$this->_merge_cache();
- $sql = ( ! $this->ar_distinct) ? 'SELECT ' : 'SELECT DISTINCT ';
+ $sql = (! $this->ar_distinct) ? 'SELECT ' : 'SELECT DISTINCT ';
$sql .= (count($this->ar_select) == 0) ? '*' : implode(', ', $this->_filter_table_aliases($this->ar_select));
@@ -1577,7 +1577,7 @@
*/
function _object_to_array($object)
{
- if ( ! is_object($object))
+ if (! is_object($object))
{
return $object;
}
@@ -1586,7 +1586,7 @@
foreach (get_object_vars($object) as $key => $val)
{
// There are some built in keys we need to ignore for this conversion
- if ( ! is_object($val) && ! is_array($val) && $key != '_parent_name' && $key != '_ci_scaffolding' && $key != '_ci_scaff_table')
+ if (! is_object($val) && ! is_array($val) && $key != '_parent_name' && $key != '_ci_scaffolding' && $key != '_ci_scaff_table')
{
$array[$key] = $val;
diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php
index 08394da..982725a 100644
--- a/system/database/DB_cache.php
+++ b/system/database/DB_cache.php
@@ -64,7 +64,7 @@
// Add a trailing slash to the path if needed
$path = preg_replace("/(.+?)\/*$/", "\\1/", $path);
- if ( ! is_dir($path) OR ! is_really_writable($path))
+ if (! is_dir($path) OR ! is_really_writable($path))
{
// If the path is wrong we'll turn off caching
return $this->CI->db->cache_off();
@@ -87,7 +87,7 @@
*/
function read($sql)
{
- if ( ! $this->check_path())
+ if (! $this->check_path())
{
return $this->CI->db->cache_off();
}
@@ -115,7 +115,7 @@
*/
function write($sql, $object)
{
- if ( ! $this->check_path())
+ if (! $this->check_path())
{
return $this->CI->db->cache_off();
}
@@ -127,9 +127,9 @@
$filename = md5($sql);
- if ( ! @is_dir($dir_path))
+ if (! @is_dir($dir_path))
{
- if ( ! @mkdir($dir_path, DIR_WRITE_MODE))
+ if (! @mkdir($dir_path, DIR_WRITE_MODE))
{
return FALSE;
}
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index b101317..0f3a1ea 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -107,7 +107,7 @@
$this->conn_id = ($this->pconnect == FALSE) ? $this->db_connect() : $this->db_pconnect();
// No connection? Throw an error
- if ( ! $this->conn_id)
+ if (! $this->conn_id)
{
log_message('error', 'Unable to connect to the database');
@@ -121,7 +121,7 @@
// Select the database
if ($this->database != '')
{
- if ( ! $this->db_select())
+ if (! $this->db_select())
{
// Should we attempt to create the database?
if ($create_db == TRUE)
@@ -131,7 +131,7 @@
$CI->load->dbutil();
// Create the DB
- if ( ! $CI->dbutil->create_database($this->database))
+ if (! $CI->dbutil->create_database($this->database))
{
log_message('error', 'Unable to create database: '.$this->database);
@@ -401,7 +401,7 @@
{
$driver = 'CI_DB_'.$this->dbdriver.'_result';
- if ( ! class_exists($driver))
+ if (! class_exists($driver))
{
include_once(BASEPATH.'database/DB_result'.EXT);
include_once(BASEPATH.'database/drivers/'.$this->dbdriver.'/'.$this->dbdriver.'_result'.EXT);
@@ -424,7 +424,7 @@
*/
function simple_query($sql)
{
- if ( ! $this->conn_id)
+ if (! $this->conn_id)
{
$this->initialize();
}
@@ -456,7 +456,7 @@
*/
function trans_start($test_mode = FALSE)
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return FALSE;
}
@@ -481,7 +481,7 @@
*/
function trans_complete()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return FALSE;
}
@@ -539,7 +539,7 @@
return $sql;
}
- if ( ! is_array($binds))
+ if (! is_array($binds))
{
$binds = array($binds);
}
@@ -576,7 +576,7 @@
*/
function is_write_type($sql)
{
- if ( ! preg_match('/^\s*"?(INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql))
+ if (! preg_match('/^\s*"?(INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql))
{
return FALSE;
}
@@ -683,7 +683,7 @@
{
$fields = $this->list_fields($table);
- if ( ! is_array($fields))
+ if (! is_array($fields))
{
return FALSE;
}
@@ -747,7 +747,7 @@
*/
function table_exists($table_name)
{
- return ( ! in_array($this->prep_tablename($table_name), $this->list_tables())) ? FALSE : TRUE;
+ return (! in_array($this->prep_tablename($table_name), $this->list_tables())) ? FALSE : TRUE;
}
// --------------------------------------------------------------------
@@ -815,7 +815,7 @@
*/
function field_exists($field_name, $table_name)
{
- return ( ! in_array($field_name, $this->list_fields($table_name))) ? FALSE : TRUE;
+ return (! in_array($field_name, $this->list_fields($table_name))) ? FALSE : TRUE;
}
// --------------------------------------------------------------------
@@ -899,7 +899,7 @@
$fields[$key] = $this->escape($val);
}
- if ( ! is_array($where))
+ if (! is_array($where))
{
$dest = array($where);
}
@@ -912,7 +912,7 @@
if ($val !== '')
{
- if ( ! $this->_has_operator($key))
+ if (! $this->_has_operator($key))
{
$key .= ' =';
}
@@ -969,7 +969,7 @@
$function = $driver.$function;
}
- if ( ! function_exists($function))
+ if (! function_exists($function))
{
if ($this->db_debug)
{
@@ -1038,7 +1038,7 @@
*/
function cache_delete($segment_one = '', $segment_two = '')
{
- if ( ! $this->_cache_init())
+ if (! $this->_cache_init())
{
return FALSE;
}
@@ -1055,7 +1055,7 @@
*/
function cache_delete_all()
{
- if ( ! $this->_cache_init())
+ if (! $this->_cache_init())
{
return FALSE;
}
@@ -1078,7 +1078,7 @@
return TRUE;
}
- if ( ! @include(BASEPATH.'database/DB_cache'.EXT))
+ if (! @include(BASEPATH.'database/DB_cache'.EXT))
{
return $this->cache_off();
}
@@ -1129,10 +1129,10 @@
}
else
{
- $message = ( ! is_array($error)) ? array(str_replace('%s', $swap, $LANG->line($error))) : $error;
+ $message = (! is_array($error)) ? array(str_replace('%s', $swap, $LANG->line($error))) : $error;
}
- if ( ! class_exists('CI_Exceptions'))
+ if (! class_exists('CI_Exceptions'))
{
// include(BASEPATH.'core/Exceptions'.EXT);
include(BASEPATH.'libraries/Exceptions'.EXT);
diff --git a/system/database/DB_result.php b/system/database/DB_result.php
index c2eeefb..cfe9d2a 100644
--- a/system/database/DB_result.php
+++ b/system/database/DB_result.php
@@ -125,10 +125,10 @@
*/
function row($n = 0, $type = 'object')
{
- if ( ! is_numeric($n))
+ if (! is_numeric($n))
{
// We cache the row data for subsequent uses
- if ( ! is_array($this->row_data))
+ if (! is_array($this->row_data))
{
$this->row_data = $this->row_array(0);
}
@@ -156,7 +156,7 @@
function set_row($key, $value = NULL)
{
// We cache the row data for subsequent uses
- if ( ! is_array($this->row_data))
+ if (! is_array($this->row_data))
{
$this->row_data = $this->row_array(0);
}
diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php
index d9b8fed..11f1fb4 100644
--- a/system/database/DB_utility.php
+++ b/system/database/DB_utility.php
@@ -175,7 +175,7 @@
*/
function csv_from_result($query, $delim = ",", $newline = "\n", $enclosure = '"')
{
- if ( ! is_object($query) OR ! method_exists($query, 'field_names'))
+ if (! is_object($query) OR ! method_exists($query, 'field_names'))
{
show_error('You must submit a valid result object');
}
@@ -217,7 +217,7 @@
*/
function xml_from_result($query, $params = array())
{
- if ( ! is_object($query) OR ! method_exists($query, 'field_names'))
+ if (! is_object($query) OR ! method_exists($query, 'field_names'))
{
show_error('You must submit a valid result object');
}
@@ -225,7 +225,7 @@
// Set our default values
foreach (array('root' => 'root', 'element' => 'element', 'newline' => "\n", 'tab' => "\t") as $key => $val)
{
- if ( ! isset($params[$key]))
+ if (! isset($params[$key]))
{
$params[$key] = $val;
}
@@ -310,7 +310,7 @@
// ------------------------------------------------------
// Validate the format
- if ( ! in_array($prefs['format'], array('gzip', 'zip', 'txt'), TRUE))
+ if (! in_array($prefs['format'], array('gzip', 'zip', 'txt'), TRUE))
{
$prefs['format'] = 'txt';
}
@@ -367,7 +367,7 @@
}
// Tack on the ".sql" file extension if needed
- if ( ! preg_match("|.+?\.sql$|", $prefs['filename']))
+ if (! preg_match("|.+?\.sql$|", $prefs['filename']))
{
$prefs['filename'] .= '.sql';
}
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index 1ed333d..6e67c57 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -132,7 +132,7 @@
*/
function trans_begin($test_mode = FALSE)
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
@@ -162,7 +162,7 @@
*/
function trans_commit()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
@@ -187,7 +187,7 @@
*/
function trans_rollback()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index f435c0b..f15983d 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -161,7 +161,7 @@
*/
function trans_begin($test_mode = FALSE)
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
@@ -192,7 +192,7 @@
*/
function trans_commit()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
@@ -218,7 +218,7 @@
*/
function trans_rollback()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 6ff37f7..a196f75 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -164,7 +164,7 @@
*/
function trans_begin($test_mode = FALSE)
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
@@ -195,7 +195,7 @@
*/
function trans_commit()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
@@ -221,7 +221,7 @@
*/
function trans_rollback()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index 364268b..8fc2044 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -155,7 +155,7 @@
*/
function _set_stmt_id($sql)
{
- if ( ! is_resource($this->stmt_id))
+ if (! is_resource($this->stmt_id))
{
$this->stmt_id = ociparse($this->conn_id, $this->_prep_query($sql));
}
@@ -254,7 +254,7 @@
*/
function _bind_params($params)
{
- if ( ! is_array($params) OR ! is_resource($this->stmt_id))
+ if (! is_array($params) OR ! is_resource($this->stmt_id))
{
return;
}
@@ -263,7 +263,7 @@
{
foreach (array('name', 'value', 'type', 'length') as $val)
{
- if ( ! isset($param[$val]))
+ if (! isset($param[$val]))
{
$param[$val] = '';
}
@@ -283,7 +283,7 @@
*/
function trans_begin($test_mode = FALSE)
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
@@ -313,7 +313,7 @@
*/
function trans_commit()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
@@ -339,7 +339,7 @@
*/
function trans_rollback()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php
index 82fe36b..20e34ec 100644
--- a/system/database/drivers/odbc/odbc_driver.php
+++ b/system/database/drivers/odbc/odbc_driver.php
@@ -152,7 +152,7 @@
*/
function trans_begin($test_mode = FALSE)
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
@@ -181,7 +181,7 @@
*/
function trans_commit()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
@@ -207,7 +207,7 @@
*/
function trans_rollback()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index 4eff97f..46ba1d0 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -150,7 +150,7 @@
*/
function trans_begin($test_mode = FALSE)
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
@@ -179,7 +179,7 @@
*/
function trans_commit()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
@@ -203,7 +203,7 @@
*/
function trans_rollback()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index 2ad5d61..70148f3 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -48,7 +48,7 @@
*/
function db_connect()
{
- if ( ! $conn_id = @sqlite_open($this->database, FILE_WRITE_MODE, $error))
+ if (! $conn_id = @sqlite_open($this->database, FILE_WRITE_MODE, $error))
{
log_message('error', $error);
@@ -73,7 +73,7 @@
*/
function db_pconnect()
{
- if ( ! $conn_id = @sqlite_popen($this->database, FILE_WRITE_MODE, $error))
+ if (! $conn_id = @sqlite_popen($this->database, FILE_WRITE_MODE, $error))
{
log_message('error', $error);
@@ -171,7 +171,7 @@
*/
function trans_begin($test_mode = FALSE)
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
@@ -201,7 +201,7 @@
*/
function trans_commit()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
@@ -226,7 +226,7 @@
*/
function trans_rollback()
{
- if ( ! $this->trans_enabled)
+ if (! $this->trans_enabled)
{
return TRUE;
}
diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php
index 1fd2a2b..44950bf 100644
--- a/system/database/drivers/sqlite/sqlite_forge.php
+++ b/system/database/drivers/sqlite/sqlite_forge.php
@@ -49,7 +49,7 @@
*/
function _drop_database($name)
{
- if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database))
+ if (! @file_exists($this->db->database) OR ! @unlink($this->db->database))
{
if ($this->db->db_debug)
{
diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php
index d1e1fe0..ab58f8f 100644
--- a/system/database/drivers/sqlite/sqlite_utility.php
+++ b/system/database/drivers/sqlite/sqlite_utility.php
@@ -124,7 +124,7 @@
*/
function _drop_database($name)
{
- if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database))
+ if (! @file_exists($this->db->database) OR ! @unlink($this->db->database))
{
if ($this->db->db_debug)
{