summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-05-05 18:39:18 +0200
committerDerek Allard <derek.allard@ellislab.com>2008-05-05 18:39:18 +0200
commit7327499064ae165468c7440f8571c3e570b58a0b (patch)
tree4f0d0053e7d25f7064c63070edcbc3af114abed9 /system/libraries
parent7539f67a23c8536f892263d8d7ab9448655d8e22 (diff)
Added get_dir_file_info(), get_file_info(), and get_mime_by_extension() to the File Helper.
Changed ( ! condition) into (! condition) within the code
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Benchmark.php4
-rw-r--r--system/libraries/Calendar.php4
-rw-r--r--system/libraries/Config.php12
-rw-r--r--system/libraries/Controller.php2
-rw-r--r--system/libraries/Email.php52
-rw-r--r--system/libraries/Encrypt.php6
-rw-r--r--system/libraries/Exceptions.php6
-rw-r--r--system/libraries/Ftp.php34
-rw-r--r--system/libraries/Hooks.php14
-rw-r--r--system/libraries/Image_lib.php58
-rw-r--r--system/libraries/Input.php22
-rw-r--r--system/libraries/Language.php2
-rw-r--r--system/libraries/Loader.php36
-rw-r--r--system/libraries/Log.php8
-rw-r--r--system/libraries/Model.php2
-rw-r--r--system/libraries/Output.php18
-rw-r--r--system/libraries/Pagination.php2
-rw-r--r--system/libraries/Parser.php4
-rw-r--r--system/libraries/Profiler.php6
-rw-r--r--system/libraries/Router.php8
-rw-r--r--system/libraries/Session.php8
-rw-r--r--system/libraries/Table.php18
-rw-r--r--system/libraries/Trackback.php24
-rw-r--r--system/libraries/URI.php12
-rw-r--r--system/libraries/Unit_test.php8
-rw-r--r--system/libraries/Upload.php42
-rw-r--r--system/libraries/User_agent.php8
-rw-r--r--system/libraries/Validation.php48
-rw-r--r--system/libraries/Xmlrpc.php18
-rw-r--r--system/libraries/Xmlrpcs.php8
-rw-r--r--system/libraries/Zip.php8
31 files changed, 251 insertions, 251 deletions
diff --git a/system/libraries/Benchmark.php b/system/libraries/Benchmark.php
index bca37822b..323d9668d 100644
--- a/system/libraries/Benchmark.php
+++ b/system/libraries/Benchmark.php
@@ -71,12 +71,12 @@ class CI_Benchmark {
return '{elapsed_time}';
}
- if ( ! isset($this->marker[$point1]))
+ if (! isset($this->marker[$point1]))
{
return '';
}
- if ( ! isset($this->marker[$point2]))
+ if (! isset($this->marker[$point2]))
{
$this->marker[$point2] = microtime();
}
diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php
index a85c18303..e9621fec1 100644
--- a/system/libraries/Calendar.php
+++ b/system/libraries/Calendar.php
@@ -49,7 +49,7 @@ class CI_Calendar {
{
$this->CI =& get_instance();
- if ( ! in_array('calendar_lang'.EXT, $this->CI->lang->is_loaded, TRUE))
+ if (! in_array('calendar_lang'.EXT, $this->CI->lang->is_loaded, TRUE))
{
$this->CI->lang->load('calendar');
}
@@ -125,7 +125,7 @@ class CI_Calendar {
// Set the starting day of the week
$start_days = array('sunday' => 0, 'monday' => 1, 'tuesday' => 2, 'wednesday' => 3, 'thursday' => 4, 'friday' => 5, 'saturday' => 6);
- $start_day = ( ! isset($start_days[$this->start_day])) ? 0 : $start_days[$this->start_day];
+ $start_day = (! isset($start_days[$this->start_day])) ? 0 : $start_days[$this->start_day];
// Set the starting day number
$local_date = mktime(12, 0, 0, $month, 1, $year);
diff --git a/system/libraries/Config.php b/system/libraries/Config.php
index 9b8b07c5a..73f1986a0 100644
--- a/system/libraries/Config.php
+++ b/system/libraries/Config.php
@@ -66,7 +66,7 @@ class CI_Config {
return TRUE;
}
- if ( ! file_exists(APPPATH.'config/'.$file.EXT))
+ if (! file_exists(APPPATH.'config/'.$file.EXT))
{
if ($fail_gracefully === TRUE)
{
@@ -77,7 +77,7 @@ class CI_Config {
include(APPPATH.'config/'.$file.EXT);
- if ( ! isset($config) OR ! is_array($config))
+ if (! isset($config) OR ! is_array($config))
{
if ($fail_gracefully === TRUE)
{
@@ -125,7 +125,7 @@ class CI_Config {
{
if ($index == '')
{
- if ( ! isset($this->config[$item]))
+ if (! isset($this->config[$item]))
{
return FALSE;
}
@@ -134,12 +134,12 @@ class CI_Config {
}
else
{
- if ( ! isset($this->config[$index]))
+ if (! isset($this->config[$index]))
{
return FALSE;
}
- if ( ! isset($this->config[$index][$item]))
+ if (! isset($this->config[$index][$item]))
{
return FALSE;
}
@@ -165,7 +165,7 @@ class CI_Config {
*/
function slash_item($item)
{
- if ( ! isset($this->config[$item]))
+ if (! isset($this->config[$item]))
{
return FALSE;
}
diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php
index ad9c66805..4957fc35e 100644
--- a/system/libraries/Controller.php
+++ b/system/libraries/Controller.php
@@ -111,7 +111,7 @@ class Controller extends CI_Base {
show_404('Scaffolding unavailable');
}
- $method = ( ! in_array($this->uri->segment(3), array('add', 'insert', 'edit', 'update', 'view', 'delete', 'do_delete'), TRUE)) ? 'view' : $this->uri->segment(3);
+ $method = (! in_array($this->uri->segment(3), array('add', 'insert', 'edit', 'update', 'view', 'delete', 'do_delete'), TRUE)) ? 'view' : $this->uri->segment(3);
require_once(BASEPATH.'scaffolding/Scaffolding'.EXT);
$scaff = new Scaffolding($this->_ci_scaff_table);
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 19121c56b..3b4dddd00 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -371,7 +371,7 @@ class CI_Email {
*/
function _str_to_array($email)
{
- if ( ! is_array($email))
+ if (! is_array($email))
{
if (strpos($email, ',') !== FALSE)
{
@@ -439,7 +439,7 @@ class CI_Email {
*/
function set_protocol($protocol = 'mail')
{
- $this->protocol = ( ! in_array($protocol, $this->_protocols, TRUE)) ? 'mail' : strtolower($protocol);
+ $this->protocol = (! in_array($protocol, $this->_protocols, TRUE)) ? 'mail' : strtolower($protocol);
}
// --------------------------------------------------------------------
@@ -453,7 +453,7 @@ class CI_Email {
*/
function set_priority($n = 3)
{
- if ( ! is_numeric($n))
+ if (! is_numeric($n))
{
$this->priority = 3;
return;
@@ -551,7 +551,7 @@ class CI_Email {
function _get_protocol($return = TRUE)
{
$this->protocol = strtolower($this->protocol);
- $this->protocol = ( ! in_array($this->protocol, $this->_protocols, TRUE)) ? 'mail' : $this->protocol;
+ $this->protocol = (! in_array($this->protocol, $this->_protocols, TRUE)) ? 'mail' : $this->protocol;
if ($return == TRUE)
return $this->protocol;
@@ -568,7 +568,7 @@ class CI_Email {
*/
function _get_encoding($return = TRUE)
{
- $this->_encoding = ( ! in_array($this->_encoding, $this->_bit_depths)) ? '8bit' : $this->_encoding;
+ $this->_encoding = (! in_array($this->_encoding, $this->_bit_depths)) ? '8bit' : $this->_encoding;
foreach ($this->_base_charsets as $charset)
{
@@ -648,7 +648,7 @@ class CI_Email {
*/
function validate_email($email)
{
- if ( ! is_array($email))
+ if (! is_array($email))
{
$this->_set_error_message('email_must_be_array');
return FALSE;
@@ -656,7 +656,7 @@ class CI_Email {
foreach ($email as $val)
{
- if ( ! $this->valid_email($val))
+ if (! $this->valid_email($val))
{
$this->_set_error_message('email_invalid_address', $val);
return FALSE;
@@ -675,7 +675,7 @@ class CI_Email {
*/
function valid_email($address)
{
- return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;
+ return (! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;
}
// --------------------------------------------------------------------
@@ -689,7 +689,7 @@ class CI_Email {
*/
function clean_email($email)
{
- if ( ! is_array($email))
+ if (! is_array($email))
{
if (preg_match('/\<(.*)\>/', $email, $match))
return $match['1'];
@@ -1055,7 +1055,7 @@ class CI_Email {
$basename = basename($filename);
$ctype = $this->_attach_type[$i];
- if ( ! file_exists($filename))
+ if (! file_exists($filename))
{
$this->_set_error_message('email_attachment_missing', $filename);
return FALSE;
@@ -1070,7 +1070,7 @@ class CI_Email {
$attachment[$z++] = $h;
$file = filesize($filename) +1;
- if ( ! $fp = fopen($filename, 'r'))
+ if (! $fp = fopen($filename, 'r'))
{
$this->_set_error_message('email_attachment_unreadable', $filename);
return FALSE;
@@ -1194,9 +1194,9 @@ class CI_Email {
$this->reply_to($this->_headers['From']);
}
- if (( ! isset($this->_recipients) AND ! isset($this->_headers['To'])) AND
- ( ! isset($this->_bcc_array) AND ! isset($this->_headers['Bcc'])) AND
- ( ! isset($this->_headers['Cc'])))
+ if ((! isset($this->_recipients) AND ! isset($this->_headers['To'])) AND
+ (! isset($this->_bcc_array) AND ! isset($this->_headers['Bcc'])) AND
+ (! isset($this->_headers['Cc'])))
{
$this->_set_error_message('email_no_recipients');
return FALSE;
@@ -1212,7 +1212,7 @@ class CI_Email {
$this->_build_message();
- if ( ! $this->_spool_email())
+ if (! $this->_spool_email())
return FALSE;
else
return TRUE;
@@ -1311,7 +1311,7 @@ class CI_Email {
{
case 'mail' :
- if ( ! $this->_send_with_mail())
+ if (! $this->_send_with_mail())
{
$this->_set_error_message('email_send_failure_phpmail');
return FALSE;
@@ -1319,7 +1319,7 @@ class CI_Email {
break;
case 'sendmail' :
- if ( ! $this->_send_with_sendmail())
+ if (! $this->_send_with_sendmail())
{
$this->_set_error_message('email_send_failure_sendmail');
return FALSE;
@@ -1327,7 +1327,7 @@ class CI_Email {
break;
case 'smtp' :
- if ( ! $this->_send_with_smtp())
+ if (! $this->_send_with_smtp())
{
$this->_set_error_message('email_send_failure_smtp');
return FALSE;
@@ -1352,7 +1352,7 @@ class CI_Email {
{
if ($this->_safe_mode == TRUE)
{
- if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str))
+ if (! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str))
return FALSE;
else
return TRUE;
@@ -1361,7 +1361,7 @@ class CI_Email {
{
// most documentation of sendmail using the "-f" flag lacks a space after it, however
// we've encountered servers that seem to require it to be in place.
- if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f ".$this->clean_email($this->_headers['From'])))
+ if (! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f ".$this->clean_email($this->_headers['From'])))
return FALSE;
else
return TRUE;
@@ -1380,7 +1380,7 @@ class CI_Email {
{
$fp = @popen($this->mailpath . " -oi -f ".$this->clean_email($this->_headers['From'])." -t", 'w');
- if ( ! is_resource($fp))
+ if (! is_resource($fp))
{
$this->_set_error_message('email_no_socket');
return FALSE;
@@ -1472,7 +1472,7 @@ class CI_Email {
$errstr,
$this->smtp_timeout);
- if( ! is_resource($this->_smtp_connect))
+ if(! is_resource($this->_smtp_connect))
{
$this->_set_error_message('email_smtp_error', $errno." ".$errstr);
return FALSE;
@@ -1557,7 +1557,7 @@ class CI_Email {
*/
function _smtp_authenticate()
{
- if ( ! $this->_smtp_auth)
+ if (! $this->_smtp_auth)
return TRUE;
if ($this->smtp_user == "" AND $this->smtp_pass == "")
@@ -1609,7 +1609,7 @@ class CI_Email {
*/
function _send_data($data)
{
- if ( ! fwrite($this->_smtp_connect, $data . $this->newline))
+ if (! fwrite($this->_smtp_connect, $data . $this->newline))
{
$this->_set_error_message('email_smtp_data_failure', $data);
return FALSE;
@@ -1684,7 +1684,7 @@ class CI_Email {
$this->_IP = end($x);
}
- if ( ! preg_match( "/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $this->_IP))
+ if (! preg_match( "/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/", $this->_IP))
$this->_IP = '0.0.0.0';
unset($cip);
@@ -1842,7 +1842,7 @@ class CI_Email {
'eml' => 'message/rfc822'
);
- return ( ! isset($mimes[strtolower($ext)])) ? "application/x-unknown-content-type" : $mimes[strtolower($ext)];
+ return (! isset($mimes[strtolower($ext)])) ? "application/x-unknown-content-type" : $mimes[strtolower($ext)];
}
}
diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php
index 48f9d3e51..9a784d254 100644
--- a/system/libraries/Encrypt.php
+++ b/system/libraries/Encrypt.php
@@ -44,7 +44,7 @@ class CI_Encrypt {
function CI_Encrypt()
{
$this->CI =& get_instance();
- $this->_mcrypt_exists = ( ! function_exists('mcrypt_encrypt')) ? FALSE : TRUE;
+ $this->_mcrypt_exists = (! function_exists('mcrypt_encrypt')) ? FALSE : TRUE;
log_message('debug', "Encrypt Class Initialized");
}
@@ -459,9 +459,9 @@ class CI_Encrypt {
*/
function sha1($str)
{
- if ( ! function_exists('sha1'))
+ if (! function_exists('sha1'))
{
- if ( ! function_exists('mhash'))
+ if (! function_exists('mhash'))
{
require_once(BASEPATH.'libraries/Sha1'.EXT);
$SH = new CI_SHA;
diff --git a/system/libraries/Exceptions.php b/system/libraries/Exceptions.php
index b22ef9f7a..7c9640554 100644
--- a/system/libraries/Exceptions.php
+++ b/system/libraries/Exceptions.php
@@ -74,7 +74,7 @@ class CI_Exceptions {
*/
function log_exception($severity, $message, $filepath, $line)
{
- $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity];
+ $severity = (! isset($this->levels[$severity])) ? $severity : $this->levels[$severity];
log_message('error', 'Severity: '.$severity.' --> '.$message. ' '.$filepath.' '.$line, TRUE);
}
@@ -115,7 +115,7 @@ class CI_Exceptions {
*/
function show_error($heading, $message, $template = 'error_general')
{
- $message = '<p>'.implode('</p><p>', ( ! is_array($message)) ? array($message) : $message).'</p>';
+ $message = '<p>'.implode('</p><p>', (! is_array($message)) ? array($message) : $message).'</p>';
if (ob_get_level() > $this->ob_level + 1)
{
@@ -142,7 +142,7 @@ class CI_Exceptions {
*/
function show_php_error($severity, $message, $filepath, $line)
{
- $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity];
+ $severity = (! isset($this->levels[$severity])) ? $severity : $this->levels[$severity];
$filepath = str_replace("\\", "/", $filepath);
diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php
index ed934b548..1b5ec2fd2 100644
--- a/system/libraries/Ftp.php
+++ b/system/libraries/Ftp.php
@@ -98,7 +98,7 @@ class CI_FTP {
return FALSE;
}
- if ( ! $this->_login())
+ if (! $this->_login())
{
if ($this->debug == TRUE)
{
@@ -139,7 +139,7 @@ class CI_FTP {
*/
function _is_conn()
{
- if ( ! is_resource($this->conn_id))
+ if (! is_resource($this->conn_id))
{
if ($this->debug == TRUE)
{
@@ -216,7 +216,7 @@ class CI_FTP {
}
// Set file permissions if needed
- if ( ! is_null($permissions))
+ if (! is_null($permissions))
{
$this->chmod($path, (int)$permissions);
}
@@ -237,12 +237,12 @@ class CI_FTP {
*/
function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL)
{
- if ( ! $this->_is_conn())
+ if (! $this->_is_conn())
{
return FALSE;
}
- if ( ! file_exists($locpath))
+ if (! file_exists($locpath))
{
$this->_error('ftp_no_source_file');
return FALSE;
@@ -270,7 +270,7 @@ class CI_FTP {
}
// Set file permissions if needed
- if ( ! is_null($permissions))
+ if (! is_null($permissions))
{
$this->chmod($rempath, (int)$permissions);
}
@@ -291,7 +291,7 @@ class CI_FTP {
*/
function rename($old_file, $new_file, $move = FALSE)
{
- if ( ! $this->_is_conn())
+ if (! $this->_is_conn())
{
return FALSE;
}
@@ -338,7 +338,7 @@ class CI_FTP {
*/
function delete_file($filepath)
{
- if ( ! $this->_is_conn())
+ if (! $this->_is_conn())
{
return FALSE;
}
@@ -369,7 +369,7 @@ class CI_FTP {
*/
function delete_dir($filepath)
{
- if ( ! $this->_is_conn())
+ if (! $this->_is_conn())
{
return FALSE;
}
@@ -385,7 +385,7 @@ class CI_FTP {
{
// If we can't delete the item it's probaly a folder so
// we'll recursively call delete_dir()
- if ( ! @ftp_delete($this->conn_id, $filepath.$item))
+ if (! @ftp_delete($this->conn_id, $filepath.$item))
{
$this->delete_dir($filepath.$item);
}
@@ -418,13 +418,13 @@ class CI_FTP {
*/
function chmod($path, $perm)
{
- if ( ! $this->_is_conn())
+ if (! $this->_is_conn())
{
return FALSE;
}
// Permissions can only be set when running PHP 5
- if ( ! function_exists('ftp_chmod'))
+ if (! function_exists('ftp_chmod'))
{
if ($this->debug == TRUE)
{
@@ -457,7 +457,7 @@ class CI_FTP {
*/
function list_files($path = '.')
{
- if ( ! $this->_is_conn())
+ if (! $this->_is_conn())
{
return FALSE;
}
@@ -481,7 +481,7 @@ class CI_FTP {
*/
function mirror($locpath, $rempath)
{
- if ( ! $this->_is_conn())
+ if (! $this->_is_conn())
{
return FALSE;
}
@@ -490,10 +490,10 @@ class CI_FTP {
if ($fp = @opendir($locpath))
{
// Attempt to open the remote file path.
- if ( ! $this->changedir($rempath, TRUE))
+ if (! $this->changedir($rempath, TRUE))
{
// If it doesn't exist we'll attempt to create the direcotory
- if ( ! $this->mkdir($rempath) OR ! $this->changedir($rempath))
+ if (! $this->mkdir($rempath) OR ! $this->changedir($rempath))
{
return FALSE;
}
@@ -586,7 +586,7 @@ class CI_FTP {
*/
function close()
{
- if ( ! $this->_is_conn())
+ if (! $this->_is_conn())
{
return FALSE;
}
diff --git a/system/libraries/Hooks.php b/system/libraries/Hooks.php
index 49cb230c0..a41320c5e 100644
--- a/system/libraries/Hooks.php
+++ b/system/libraries/Hooks.php
@@ -68,7 +68,7 @@ class CI_Hooks {
@include(APPPATH.'config/hooks'.EXT);
- if ( ! isset($hook) OR ! is_array($hook))
+ if (! isset($hook) OR ! is_array($hook))
{
return;
}
@@ -90,7 +90,7 @@ class CI_Hooks {
*/
function _call_hook($which = '')
{
- if ( ! $this->enabled OR ! isset($this->hooks[$which]))
+ if (! $this->enabled OR ! isset($this->hooks[$which]))
{
return FALSE;
}
@@ -123,7 +123,7 @@ class CI_Hooks {
*/
function _run_hook($data)
{
- if ( ! is_array($data))
+ if (! is_array($data))
{
return FALSE;
}
@@ -144,14 +144,14 @@ class CI_Hooks {
// Set file path
// -----------------------------------
- if ( ! isset($data['filepath']) OR ! isset($data['filename']))
+ if (! isset($data['filepath']) OR ! isset($data['filename']))
{
return FALSE;
}
$filepath = APPPATH.$data['filepath'].'/'.$data['filename'];
- if ( ! file_exists($filepath))
+ if (! file_exists($filepath))
{
return FALSE;
}
@@ -196,7 +196,7 @@ class CI_Hooks {
if ($class !== FALSE)
{
- if ( ! class_exists($class))
+ if (! class_exists($class))
{
require($filepath);
}
@@ -206,7 +206,7 @@ class CI_Hooks {
}
else
{
- if ( ! function_exists($function))
+ if (! function_exists($function))
{
require($filepath);
}
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index 85435f6c9..c236e391e 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -158,7 +158,7 @@ class CI_Image_lib {
* properties using ImageMagick and NetPBM
*
*/
- if ( ! function_exists('getimagesize'))
+ if (! function_exists('getimagesize'))
{
$this->set_error('imglib_gd_required_for_props');
return FALSE;
@@ -188,7 +188,7 @@ class CI_Image_lib {
$this->source_folder = str_replace($this->source_image, '', $full_source_path);
// Set the Image Properties
- if ( ! $this->get_image_properties($this->source_folder.$this->source_image))
+ if (! $this->get_image_properties($this->source_folder.$this->source_image))
{
return FALSE;
}
@@ -226,7 +226,7 @@ class CI_Image_lib {
}
// Is there a file name?
- if ( ! preg_match("#[\.jpg|\.jpeg|\.gif|\.png]$#i", $full_dest_path))
+ if (! preg_match("#[\.jpg|\.jpeg|\.gif|\.png]$#i", $full_dest_path))
{
$this->dest_folder = $full_dest_path.'/';
$this->dest_image = $this->source_image;
@@ -478,7 +478,7 @@ class CI_Image_lib {
// we'll simply make a copy of the original with the new name
if (($this->orig_width == $this->width AND $this->orig_height == $this->height) AND ($this->source_image != $this->new_image))
{
- if ( ! @copy($this->full_src_path, $this->full_dst_path))
+ if (! @copy($this->full_src_path, $this->full_dst_path))
{
$this->set_error('imglib_copy_failed');
return FALSE;
@@ -494,7 +494,7 @@ class CI_Image_lib {
}
// Create the image handle
- if ( ! ($src_img = $this->image_create_gd()))
+ if (! ($src_img = $this->image_create_gd()))
{
return FALSE;
}
@@ -528,7 +528,7 @@ class CI_Image_lib {
else
{
// Or save it
- if ( ! $this->image_save_gd($dst_img))
+ if (! $this->image_save_gd($dst_img))
{
return FALSE;
}
@@ -564,9 +564,9 @@ class CI_Image_lib {
return FALSE;
}
- if ( ! eregi("convert$", $this->library_path))
+ if (! eregi("convert$", $this->library_path))
{
- if ( ! eregi("/$", $this->library_path)) $this->library_path .= "/";
+ if (! eregi("/$", $this->library_path)) $this->library_path .= "/";
$this->library_path .= 'convert';
}
@@ -712,14 +712,14 @@ class CI_Image_lib {
{
// Is Image Rotation Supported?
// this function is only supported as of PHP 4.3
- if ( ! function_exists('imagerotate'))
+ if (! function_exists('imagerotate'))
{
$this->set_error('imglib_rotate_unsupported');
return FALSE;
}
// Create the image handle
- if ( ! ($src_img = $this->image_create_gd()))
+ if (! ($src_img = $this->image_create_gd()))
{
return FALSE;
}
@@ -742,7 +742,7 @@ class CI_Image_lib {
else
{
// Or save it
- if ( ! $this->image_save_gd($dst_img))
+ if (! $this->image_save_gd($dst_img))
{
return FALSE;
}
@@ -771,7 +771,7 @@ class CI_Image_lib {
*/
function image_mirror_gd()
{
- if ( ! $src_img = $this->image_create_gd())
+ if (! $src_img = $this->image_create_gd())
{
return FALSE;
}
@@ -828,7 +828,7 @@ class CI_Image_lib {
else
{
// Or save it
- if ( ! $this->image_save_gd($src_img))
+ if (! $this->image_save_gd($src_img))
{
return FALSE;
}
@@ -877,7 +877,7 @@ class CI_Image_lib {
*/
function overlay_watermark()
{
- if ( ! function_exists('imagecolortransparent'))
+ if (! function_exists('imagecolortransparent'))
{
$this->set_error('imglib_gd_required');
return FALSE;
@@ -955,7 +955,7 @@ class CI_Image_lib {
}
else
{
- if ( ! $this->image_save_gd($src_img))
+ if (! $this->image_save_gd($src_img))
{
return FALSE;
}
@@ -977,7 +977,7 @@ class CI_Image_lib {
*/
function text_watermark()
{
- if ( ! ($src_img = $this->image_create_gd()))
+ if (! ($src_img = $this->image_create_gd()))
{
return FALSE;
}
@@ -1131,7 +1131,7 @@ class CI_Image_lib {
switch ($image_type)
{
case 1 :
- if ( ! function_exists('imagecreatefromgif'))
+ if (! function_exists('imagecreatefromgif'))
{
$this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported'));
return FALSE;
@@ -1140,7 +1140,7 @@ class CI_Image_lib {
return imagecreatefromgif($path);
break;
case 2 :
- if ( ! function_exists('imagecreatefromjpeg'))
+ if (! function_exists('imagecreatefromjpeg'))
{
$this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported'));
return FALSE;
@@ -1149,7 +1149,7 @@ class CI_Image_lib {
return imagecreatefromjpeg($path);
break;
case 3 :
- if ( ! function_exists('imagecreatefrompng'))
+ if (! function_exists('imagecreatefrompng'))
{
$this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported'));
return FALSE;
@@ -1181,7 +1181,7 @@ class CI_Image_lib {
switch ($this->image_type)
{
case 1 :
- if ( ! function_exists('imagegif'))
+ if (! function_exists('imagegif'))
{
$this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported'));
return FALSE;
@@ -1190,7 +1190,7 @@ class CI_Image_lib {
@imagegif($resource, $this->full_dst_path);
break;
case 2 :
- if ( ! function_exists('imagejpeg'))
+ if (! function_exists('imagejpeg'))
{
$this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported'));
return FALSE;
@@ -1204,7 +1204,7 @@ class CI_Image_lib {
@imagejpeg($resource, $this->full_dst_path, $this->quality);
break;
case 3 :
- if ( ! function_exists('imagepng'))
+ if (! function_exists('imagepng'))
{
$this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported'));
return FALSE;
@@ -1267,10 +1267,10 @@ class CI_Image_lib {
*/
function image_reproportion()
{
- if ( ! is_numeric($this->width) OR ! is_numeric($this->height) OR $this->width == 0 OR $this->height == 0)
+ if (! is_numeric($this->width) OR ! is_numeric($this->height) OR $this->width == 0 OR $this->height == 0)
return;
- if ( ! is_numeric($this->orig_width) OR ! is_numeric($this->orig_height) OR $this->orig_width == 0 OR $this->orig_height == 0)
+ if (! is_numeric($this->orig_width) OR ! is_numeric($this->orig_height) OR $this->orig_width == 0 OR $this->orig_height == 0)
return;
$new_width = ceil($this->orig_width*$this->height/$this->orig_height);
@@ -1315,7 +1315,7 @@ class CI_Image_lib {
if ($path == '')
$path = $this->full_src_path;
- if ( ! file_exists($path))
+ if (! file_exists($path))
{
$this->set_error('imglib_invalid_path');
return FALSE;
@@ -1369,14 +1369,14 @@ class CI_Image_lib {
*/
function size_calculator($vals)
{
- if ( ! is_array($vals))
+ if (! is_array($vals))
return;
$allowed = array('new_width', 'new_height', 'width', 'height');
foreach ($allowed as $item)
{
- if ( ! isset($vals[$item]) OR $vals[$item] == '')
+ if (! isset($vals[$item]) OR $vals[$item] == '')
$vals[$item] = 0;
}
@@ -1447,9 +1447,9 @@ class CI_Image_lib {
*/
function gd_loaded()
{
- if ( ! extension_loaded('gd'))
+ if (! extension_loaded('gd'))
{
- if ( ! dl('gd.so'))
+ if (! dl('gd.so'))
{
return FALSE;
}
diff --git a/system/libraries/Input.php b/system/libraries/Input.php
index 1c5682eb7..8a0478be2 100644
--- a/system/libraries/Input.php
+++ b/system/libraries/Input.php
@@ -76,9 +76,9 @@ class CI_Input {
// This is effectively the same as register_globals = off
foreach (array($_GET, $_POST, $_COOKIE, $_SERVER, $_FILES, $_ENV, (isset($_SESSION) && is_array($_SESSION)) ? $_SESSION : array()) as $global)
{
- if ( ! is_array($global))
+ if (! is_array($global))
{
- if ( ! in_array($global, $protected))
+ if (! in_array($global, $protected))
{
unset($GLOBALS[$global]);
}
@@ -87,7 +87,7 @@ class CI_Input {
{
foreach ($global as $key => $val)
{
- if ( ! in_array($key, $protected))
+ if (! in_array($key, $protected))
{
unset($GLOBALS[$key]);
}
@@ -96,7 +96,7 @@ class CI_Input {
{
foreach($val as $k => $v)
{
- if ( ! in_array($k, $protected))
+ if (! in_array($k, $protected))
{
unset($GLOBALS[$k]);
}
@@ -198,7 +198,7 @@ class CI_Input {
*/
function _clean_input_keys($str)
{
- if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
+ if (! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
{
exit('Disallowed Key Characters.');
}
@@ -218,7 +218,7 @@ class CI_Input {
*/
function get($index = '', $xss_clean = FALSE)
{
- if ( ! isset($_GET[$index]))
+ if (! isset($_GET[$index]))
{
return FALSE;
}
@@ -253,7 +253,7 @@ class CI_Input {
*/
function post($index = '', $xss_clean = FALSE)
{
- if ( ! isset($_POST[$index]))
+ if (! isset($_POST[$index]))
{
return FALSE;
}
@@ -288,7 +288,7 @@ class CI_Input {
*/
function cookie($index = '', $xss_clean = FALSE)
{
- if ( ! isset($_COOKIE[$index]))
+ if (! isset($_COOKIE[$index]))
{
return FALSE;
}
@@ -328,7 +328,7 @@ class CI_Input {
*/
function server($index = '', $xss_clean = FALSE)
{
- if ( ! isset($_SERVER[$index]))
+ if (! isset($_SERVER[$index]))
{
return FALSE;
}
@@ -385,7 +385,7 @@ class CI_Input {
$this->ip_address = end($x);
}
- if ( ! $this->valid_ip($this->ip_address))
+ if (! $this->valid_ip($this->ip_address))
{
$this->ip_address = '0.0.0.0';
}
@@ -447,7 +447,7 @@ class CI_Input {
return $this->user_agent;
}
- $this->user_agent = ( ! isset($_SERVER['HTTP_USER_AGENT'])) ? FALSE : $_SERVER['HTTP_USER_AGENT'];
+ $this->user_agent = (! isset($_SERVER['HTTP_USER_AGENT'])) ? FALSE : $_SERVER['HTTP_USER_AGENT'];
return $this->user_agent;
}
diff --git a/system/libraries/Language.php b/system/libraries/Language.php
index 3dac1a61f..a8e6366bb 100644
--- a/system/libraries/Language.php
+++ b/system/libraries/Language.php
@@ -83,7 +83,7 @@ class CI_Language {
}
- if ( ! isset($lang))
+ if (! isset($lang))
{
log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile);
return;
diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php
index 31e7d660f..5cf1f2ae6 100644
--- a/system/libraries/Loader.php
+++ b/system/libraries/Loader.php
@@ -152,7 +152,7 @@ class CI_Loader {
$model = strtolower($model);
- if ( ! file_exists(APPPATH.'models/'.$path.$model.EXT))
+ if (! file_exists(APPPATH.'models/'.$path.$model.EXT))
{
show_error('Unable to locate the model you have specified: '.$model);
}
@@ -165,7 +165,7 @@ class CI_Loader {
$CI->load->database($db_conn, FALSE, TRUE);
}
- if ( ! class_exists('Model'))
+ if (! class_exists('Model'))
{
load_class('Model', FALSE);
}
@@ -230,7 +230,7 @@ class CI_Loader {
*/
function dbutil()
{
- if ( ! class_exists('CI_DB'))
+ if (! class_exists('CI_DB'))
{
$this->database();
}
@@ -260,7 +260,7 @@ class CI_Loader {
*/
function dbforge()
{
- if ( ! class_exists('CI_DB'))
+ if (! class_exists('CI_DB'))
{
$this->database();
}
@@ -353,7 +353,7 @@ class CI_Loader {
*/
function helper($helpers = array())
{
- if ( ! is_array($helpers))
+ if (! is_array($helpers))
{
$helpers = array($helpers);
}
@@ -374,7 +374,7 @@ class CI_Loader {
{
$base_helper = BASEPATH.'helpers/'.$helper.EXT;
- if ( ! file_exists($base_helper))
+ if (! file_exists($base_helper))
{
show_error('Unable to load the requested file: helpers/'.$helper.EXT);
}
@@ -435,7 +435,7 @@ class CI_Loader {
*/
function plugin($plugins = array())
{
- if ( ! is_array($plugins))
+ if (! is_array($plugins))
{
$plugins = array($plugins);
}
@@ -505,7 +505,7 @@ class CI_Loader {
*/
function script($scripts = array())
{
- if ( ! is_array($scripts))
+ if (! is_array($scripts))
{
$scripts = array($scripts);
}
@@ -519,7 +519,7 @@ class CI_Loader {
continue;
}
- if ( ! file_exists(APPPATH.'scripts/'.$script.EXT))
+ if (! file_exists(APPPATH.'scripts/'.$script.EXT))
{
show_error('Unable to load the requested script: scripts/'.$script.EXT);
}
@@ -544,7 +544,7 @@ class CI_Loader {
{
$CI =& get_instance();
- if ( ! is_array($file))
+ if (! is_array($file))
{
$file = array($file);
}
@@ -630,7 +630,7 @@ class CI_Loader {
// Set the default data variables
foreach (array('_ci_view', '_ci_vars', '_ci_path', '_ci_return') as $_ci_val)
{
- $$_ci_val = ( ! isset($_ci_data[$_ci_val])) ? FALSE : $_ci_data[$_ci_val];
+ $$_ci_val = (! isset($_ci_data[$_ci_val])) ? FALSE : $_ci_data[$_ci_val];
}
// Set the path to the requested file
@@ -646,7 +646,7 @@ class CI_Loader {
$_ci_file = end($_ci_x);
}
- if ( ! file_exists($_ci_path))
+ if (! file_exists($_ci_path))
{
show_error('Unable to load the requested file: '.$_ci_file);
}
@@ -660,7 +660,7 @@ class CI_Loader {
$_ci_CI =& get_instance();
foreach (get_object_vars($_ci_CI) as $_ci_key => $_ci_var)
{
- if ( ! isset($this->$_ci_key))
+ if (! isset($this->$_ci_key))
{
$this->$_ci_key =& $_ci_CI->$_ci_key;
}
@@ -768,7 +768,7 @@ class CI_Loader {
{
$baseclass = BASEPATH.'libraries/'.ucfirst($class).EXT;
- if ( ! file_exists($baseclass))
+ if (! file_exists($baseclass))
{
log_message('error', "Unable to load the requested class: ".$class);
show_error("Unable to load the requested class: ".$class);
@@ -797,7 +797,7 @@ class CI_Loader {
$filepath = $path.'libraries/'.$class.EXT;
// Does the file exist? No? Bummer...
- if ( ! file_exists($filepath))
+ if (! file_exists($filepath))
{
continue;
}
@@ -858,7 +858,7 @@ class CI_Loader {
}
// Set the variable name we will assign the class to
- $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class];
+ $classvar = (! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class];
// Instantiate the class
$CI =& get_instance();
@@ -888,7 +888,7 @@ class CI_Loader {
{
include_once(APPPATH.'config/autoload'.EXT);
- if ( ! isset($autoload))
+ if (! isset($autoload))
{
return FALSE;
}
@@ -916,7 +916,7 @@ class CI_Loader {
// A little tweak to remain backward compatible
// The $autoload['core'] item was deprecated
- if ( ! isset($autoload['libraries']))
+ if (! isset($autoload['libraries']))
{
$autoload['libraries'] = $autoload['core'];
}
diff --git a/system/libraries/Log.php b/system/libraries/Log.php
index 1aa8bd0f4..247aee13c 100644
--- a/system/libraries/Log.php
+++ b/system/libraries/Log.php
@@ -46,7 +46,7 @@ class CI_Log {
$this->log_path = ($config['log_path'] != '') ? $config['log_path'] : BASEPATH.'logs/';
- if ( ! is_dir($this->log_path) OR ! is_really_writable($this->log_path))
+ if (! is_dir($this->log_path) OR ! is_really_writable($this->log_path))
{
$this->_enabled = FALSE;
}
@@ -84,7 +84,7 @@ class CI_Log {
$level = strtoupper($level);
- if ( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold))
+ if (! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold))
{
return FALSE;
}
@@ -92,12 +92,12 @@ class CI_Log {
$filepath = $this->log_path.'log-'.date('Y-m-d').EXT;
$message = '';
- if ( ! file_exists($filepath))
+ if (! file_exists($filepath))
{
$message .= "<"."?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n";
}
- if ( ! $fp = @fopen($filepath, "a"))
+ if (! $fp = @fopen($filepath, "a"))
{
return FALSE;
}
diff --git a/system/libraries/Model.php b/system/libraries/Model.php
index 8181ead32..e87d6045c 100644
--- a/system/libraries/Model.php
+++ b/system/libraries/Model.php
@@ -59,7 +59,7 @@ class Model {
$CI =& get_instance();
foreach (array_keys(get_object_vars($CI)) as $key)
{
- if ( ! isset($this->$key) AND $key != $this->_parent_name)
+ if (! isset($this->$key) AND $key != $this->_parent_name)
{
// In some cases using references can cause
// problems so we'll conditionally use them
diff --git a/system/libraries/Output.php b/system/libraries/Output.php
index 07990eb16..d513a1279 100644
--- a/system/libraries/Output.php
+++ b/system/libraries/Output.php
@@ -137,7 +137,7 @@ class CI_Output {
*/
function cache($time)
{
- $this->cache_expiration = ( ! is_numeric($time)) ? 0 : $time;
+ $this->cache_expiration = (! is_numeric($time)) ? 0 : $time;
}
// --------------------------------------------------------------------
@@ -187,7 +187,7 @@ class CI_Output {
$elapsed = $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end');
$output = str_replace('{elapsed_time}', $elapsed, $output);
- $memory = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB';
+ $memory = (! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB';
$output = str_replace('{memory_usage}', $memory, $output);
// --------------------------------------------------------------------
@@ -220,7 +220,7 @@ class CI_Output {
// Does the get_instance() function exist?
// If not we know we are dealing with a cache file so we'll
// simply echo out the data and exit.
- if ( ! function_exists('get_instance'))
+ if (! function_exists('get_instance'))
{
echo $output;
log_message('debug', "Final output sent to browser");
@@ -285,7 +285,7 @@ class CI_Output {
$cache_path = ($path == '') ? BASEPATH.'cache/' : $path;
- if ( ! is_dir($cache_path) OR ! is_really_writable($cache_path))
+ if (! is_dir($cache_path) OR ! is_really_writable($cache_path))
{
return;
}
@@ -296,7 +296,7 @@ class CI_Output {
$cache_path .= md5($uri);
- if ( ! $fp = @fopen($cache_path, 'wb'))
+ if (! $fp = @fopen($cache_path, 'wb'))
{
log_message('error', "Unable to write cache file: ".$cache_path);
return;
@@ -327,7 +327,7 @@ class CI_Output {
$cache_path = ($CFG->item('cache_path') == '') ? BASEPATH.'cache/' : $CFG->item('cache_path');
- if ( ! is_dir($cache_path) OR ! is_really_writable($cache_path))
+ if (! is_dir($cache_path) OR ! is_really_writable($cache_path))
{
return FALSE;
}
@@ -339,12 +339,12 @@ class CI_Output {
$filepath = $cache_path.md5($uri);
- if ( ! @file_exists($filepath))
+ if (! @file_exists($filepath))
{
return FALSE;
}
- if ( ! $fp = @fopen($filepath, 'rb'))
+ if (! $fp = @fopen($filepath, 'rb'))
{
return FALSE;
}
@@ -361,7 +361,7 @@ class CI_Output {
fclose($fp);
// Strip out the embedded timestamp
- if ( ! preg_match("/(\d+TS--->)/", $cache, $match))
+ if (! preg_match("/(\d+TS--->)/", $cache, $match))
{
return FALSE;
}
diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php
index 28b74f1f0..e1212035a 100644
--- a/system/libraries/Pagination.php
+++ b/system/libraries/Pagination.php
@@ -132,7 +132,7 @@ class CI_Pagination {
show_error('Your number of links must be a positive number.');
}
- if ( ! is_numeric($this->cur_page))
+ if (! is_numeric($this->cur_page))
{
$this->cur_page = 0;
}
diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php
index a0b310f00..417e04f29 100644
--- a/system/libraries/Parser.php
+++ b/system/libraries/Parser.php
@@ -130,7 +130,7 @@ class CI_Parser {
$temp = $match['1'];
foreach ($row as $key => $val)
{
- if ( ! is_array($val))
+ if (! is_array($val))
{
$temp = $this->_parse_single($key, $val, $temp);
}
@@ -158,7 +158,7 @@ class CI_Parser {
*/
function _match_pair($string, $variable)
{
- if ( ! preg_match("|".$this->l_delim . $variable . $this->r_delim."(.+)".$this->l_delim . '/' . $variable . $this->r_delim."|s", $string, $match))
+ if (! preg_match("|".$this->l_delim . $variable . $this->r_delim."(.+)".$this->l_delim . '/' . $variable . $this->r_delim."|s", $string, $match))
{
return FALSE;
}
diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php
index 8a45933e1..807c1aff6 100644
--- a/system/libraries/Profiler.php
+++ b/system/libraries/Profiler.php
@@ -106,7 +106,7 @@ class CI_Profiler {
$output .= '<fieldset style="border:1px solid #0000FF;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
$output .= "\n";
- if ( ! class_exists('CI_DB_driver'))
+ if (! class_exists('CI_DB_driver'))
{
$output .= '<legend style="color:#0000FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries').'&nbsp;&nbsp;</legend>';
$output .= "\n";
@@ -175,7 +175,7 @@ class CI_Profiler {
foreach ($_GET as $key => $val)
{
- if ( ! is_numeric($key))
+ if (! is_numeric($key))
{
$key = "'".$key."'";
}
@@ -225,7 +225,7 @@ class CI_Profiler {
foreach ($_POST as $key => $val)
{
- if ( ! is_numeric($key))
+ if (! is_numeric($key))
{
$key = "'".$key."'";
}
diff --git a/system/libraries/Router.php b/system/libraries/Router.php
index 804e80bd2..6bb85518f 100644
--- a/system/libraries/Router.php
+++ b/system/libraries/Router.php
@@ -80,12 +80,12 @@ class CI_Router {
// Load the routes.php file.
@include(APPPATH.'config/routes'.EXT);
- $this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route;
+ $this->routes = (! isset($route) OR ! is_array($route)) ? array() : $route;
unset($route);
// Set the default controller so we can display it in the event
// the URI doesn't correlated to a valid controller.
- $this->default_controller = ( ! isset($this->routes['default_controller']) OR $this->routes['default_controller'] == '') ? FALSE : strtolower($this->routes['default_controller']);
+ $this->default_controller = (! isset($this->routes['default_controller']) OR $this->routes['default_controller'] == '') ? FALSE : strtolower($this->routes['default_controller']);
// Fetch the complete URI string
$this->uri->_fetch_uri_string();
@@ -202,7 +202,7 @@ class CI_Router {
if (count($segments) > 0)
{
// Does the requested controller exist in the sub-folder?
- if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].EXT))
+ if (! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].EXT))
{
show_404($this->fetch_directory().$segments[0]);
}
@@ -213,7 +213,7 @@ class CI_Router {
$this->set_method('index');
// Does the default controller exist in the sub-folder?
- if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$this->default_controller.EXT))
+ if (! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$this->default_controller.EXT))
{
$this->directory = '';
return array();
diff --git a/system/libraries/Session.php b/system/libraries/Session.php
index afa43348e..d4fdd3ac7 100644
--- a/system/libraries/Session.php
+++ b/system/libraries/Session.php
@@ -146,7 +146,7 @@ class CI_Session {
* a new one. If it does, we'll update it.
*
*/
- if ( ! $this->sess_read())
+ if (! $this->sess_read())
{
$this->sess_create();
}
@@ -214,7 +214,7 @@ class CI_Session {
$session = @unserialize($this->strip_slashes($session));
- if ( ! is_array($session) OR ! isset($session['last_activity']))
+ if (! is_array($session) OR ! isset($session['last_activity']))
{
log_message('error', 'The session cookie data did not contain a valid array. This could be a possible hacking attempt.');
return FALSE;
@@ -439,7 +439,7 @@ class CI_Session {
*/
function userdata($item)
{
- return ( ! isset($this->userdata[$item])) ? FALSE : $this->userdata[$item];
+ return (! isset($this->userdata[$item])) ? FALSE : $this->userdata[$item];
}
// --------------------------------------------------------------------
@@ -452,7 +452,7 @@ class CI_Session {
*/
function all_userdata()
{
- return ( ! isset($this->userdata)) ? FALSE : $this->userdata;
+ return (! isset($this->userdata)) ? FALSE : $this->userdata;
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Table.php b/system/libraries/Table.php
index 439fe2ef9..38affa579 100644
--- a/system/libraries/Table.php
+++ b/system/libraries/Table.php
@@ -53,7 +53,7 @@ class CI_Table {
*/
function set_template($template)
{
- if ( ! is_array($template))
+ if (! is_array($template))
{
return FALSE;
}
@@ -93,7 +93,7 @@ class CI_Table {
*/
function make_columns($array = array(), $col_limit = 0)
{
- if ( ! is_array($array) OR count($array) == 0)
+ if (! is_array($array) OR count($array) == 0)
{
return FALSE;
}
@@ -187,7 +187,7 @@ class CI_Table {
{
// The table data can optionally be passed to this function
// either as a database result object or an array
- if ( ! is_null($table_data))
+ if (! is_null($table_data))
{
if (is_object($table_data))
{
@@ -246,7 +246,7 @@ class CI_Table {
$i = 1;
foreach($this->rows as $row)
{
- if ( ! is_array($row))
+ if (! is_array($row))
{
break;
}
@@ -309,7 +309,7 @@ class CI_Table {
*/
function _set_from_object($query)
{
- if ( ! is_object($query))
+ if (! is_object($query))
{
return FALSE;
}
@@ -317,7 +317,7 @@ class CI_Table {
// First generate the headings from the table column names
if (count($this->heading) == 0)
{
- if ( ! method_exists($query, 'list_fields'))
+ if (! method_exists($query, 'list_fields'))
{
return FALSE;
}
@@ -347,7 +347,7 @@ class CI_Table {
*/
function _set_from_array($data, $set_heading = TRUE)
{
- if ( ! is_array($data) OR count($data) == 0)
+ if (! is_array($data) OR count($data) == 0)
{
return FALSE;
}
@@ -355,7 +355,7 @@ class CI_Table {
$i = 0;
foreach ($data as $row)
{
- if ( ! is_array($row))
+ if (! is_array($row))
{
$this->rows[] = $data;
break;
@@ -394,7 +394,7 @@ class CI_Table {
$this->temp = $this->_default_template();
foreach (array('table_open','heading_row_start', 'heading_row_end', 'heading_cell_start', 'heading_cell_end', 'row_start', 'row_end', 'cell_start', 'cell_end', 'row_alt_start', 'row_alt_end', 'cell_alt_start', 'cell_alt_end', 'table_close') as $val)
{
- if ( ! isset($this->template[$val]))
+ if (! isset($this->template[$val]))
{
$this->template[$val] = $this->temp[$val];
}
diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php
index 5371e9050..3e1c20210 100644
--- a/system/libraries/Trackback.php
+++ b/system/libraries/Trackback.php
@@ -56,7 +56,7 @@ class CI_Trackback {
*/
function send($tb_data)
{
- if ( ! is_array($tb_data))
+ if (! is_array($tb_data))
{
$this->set_error('The send() method must be passed an array');
return FALSE;
@@ -65,7 +65,7 @@ class CI_Trackback {
// Pre-process the Trackback Data
foreach (array('url', 'title', 'excerpt', 'blog_name', 'ping_url') as $item)
{
- if ( ! isset($tb_data[$item]))
+ if (! isset($tb_data[$item]))
{
$this->set_error('Required item missing: '.$item);
return FALSE;
@@ -102,7 +102,7 @@ class CI_Trackback {
}
// Build the Trackback data string
- $charset = ( ! isset($tb_data['charset'])) ? $this->charset : $tb_data['charset'];
+ $charset = (! isset($tb_data['charset'])) ? $this->charset : $tb_data['charset'];
$data = "url=".rawurlencode($url)."&title=".rawurlencode($title)."&blog_name=".rawurlencode($blog_name)."&excerpt=".rawurlencode($excerpt)."&charset=".rawurlencode($charset);
@@ -139,13 +139,13 @@ class CI_Trackback {
{
foreach (array('url', 'title', 'blog_name', 'excerpt') as $val)
{
- if ( ! isset($_POST[$val]) OR $_POST[$val] == '')
+ if (! isset($_POST[$val]) OR $_POST[$val] == '')
{
$this->set_error('The following required POST variable is missing: '.$val);
return FALSE;
}
- $this->data['charset'] = ( ! isset($_POST['charset'])) ? 'auto' : strtoupper(trim($_POST['charset']));
+ $this->data['charset'] = (! isset($_POST['charset'])) ? 'auto' : strtoupper(trim($_POST['charset']));
if ($val != 'url' && function_exists('mb_convert_encoding'))
{
@@ -212,7 +212,7 @@ class CI_Trackback {
*/
function data($item)
{
- return ( ! isset($this->data[$item])) ? '' : $this->data[$item];
+ return (! isset($this->data[$item])) ? '' : $this->data[$item];
}
// --------------------------------------------------------------------
@@ -233,14 +233,14 @@ class CI_Trackback {
$target = parse_url($url);
// Open the socket
- if ( ! $fp = @fsockopen($target['host'], 80))
+ if (! $fp = @fsockopen($target['host'], 80))
{
$this->set_error('Invalid Connection: '.$url);
return FALSE;
}
// Build the path
- $ppath = ( ! isset($target['path'])) ? $url : $target['path'];
+ $ppath = (! isset($target['path'])) ? $url : $target['path'];
$path = (isset($target['query']) && $target['query'] != "") ? $ppath.'?'.$target['query'] : $ppath;
@@ -267,7 +267,7 @@ class CI_Trackback {
}
@fclose($fp);
- if ( ! eregi("<error>0</error>", $this->response))
+ if (! eregi("<error>0</error>", $this->response))
{
$message = 'An unknown error was encountered';
@@ -360,7 +360,7 @@ class CI_Trackback {
$tb_array = explode('/', $url);
$tb_end = $tb_array[count($tb_array)-1];
- if ( ! is_numeric($tb_end))
+ if (! is_numeric($tb_end))
{
$tb_end = $tb_array[count($tb_array)-2];
}
@@ -378,13 +378,13 @@ class CI_Trackback {
$tb_array = explode('/', $url);
$tb_id = $tb_array[count($tb_array)-1];
- if ( ! is_numeric($tb_id))
+ if (! is_numeric($tb_id))
{
$tb_id = $tb_array[count($tb_array)-2];
}
}
- if ( ! preg_match ("/^([0-9]+)$/", $tb_id))
+ if (! preg_match ("/^([0-9]+)$/", $tb_id))
{
return false;
}
diff --git a/system/libraries/URI.php b/system/libraries/URI.php
index d10a5daeb..f0d02101a 100644
--- a/system/libraries/URI.php
+++ b/system/libraries/URI.php
@@ -133,7 +133,7 @@ class CI_URI {
*/
function _parse_request_uri()
{
- if ( ! isset($_SERVER['REQUEST_URI']) OR $_SERVER['REQUEST_URI'] == '')
+ if (! isset($_SERVER['REQUEST_URI']) OR $_SERVER['REQUEST_URI'] == '')
{
return '';
}
@@ -185,7 +185,7 @@ class CI_URI {
{
if ($str != '' AND $this->config->item('permitted_uri_chars') != '')
{
- if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str))
+ if (! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str))
{
exit('The URI you submitted has disallowed characters.');
}
@@ -278,7 +278,7 @@ class CI_URI {
*/
function segment($n, $no_result = FALSE)
{
- return ( ! isset($this->segments[$n])) ? $no_result : $this->segments[$n];
+ return (! isset($this->segments[$n])) ? $no_result : $this->segments[$n];
}
// --------------------------------------------------------------------
@@ -297,7 +297,7 @@ class CI_URI {
*/
function rsegment($n, $no_result = FALSE)
{
- return ( ! isset($this->rsegments[$n])) ? $no_result : $this->rsegments[$n];
+ return (! isset($this->rsegments[$n])) ? $no_result : $this->rsegments[$n];
}
// --------------------------------------------------------------------
@@ -360,7 +360,7 @@ class CI_URI {
$segment_array = 'rsegment_array';
}
- if ( ! is_numeric($n))
+ if (! is_numeric($n))
{
return $default;
}
@@ -409,7 +409,7 @@ class CI_URI {
{
foreach ($default as $val)
{
- if ( ! array_key_exists($val, $retval))
+ if (! array_key_exists($val, $retval))
{
$retval[$val] = FALSE;
}
diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php
index ff4d0c7ed..3cdf45f12 100644
--- a/system/libraries/Unit_test.php
+++ b/system/libraries/Unit_test.php
@@ -260,8 +260,8 @@ class CI_Unit_test {
{
$back = debug_backtrace();
- $file = ( ! isset($back['1']['file'])) ? '' : $back['1']['file'];
- $line = ( ! isset($back['1']['line'])) ? '' : $back['1']['line'];
+ $file = (! isset($back['1']['file'])) ? '' : $back['1']['file'];
+ $line = (! isset($back['1']['line'])) ? '' : $back['1']['line'];
return array('file' => $file, 'line' => $line);
}
@@ -300,7 +300,7 @@ class CI_Unit_test {
*/
function _parse_template()
{
- if ( ! is_null($this->_template_rows))
+ if (! is_null($this->_template_rows))
{
return;
}
@@ -311,7 +311,7 @@ class CI_Unit_test {
return;
}
- if ( ! preg_match("/\{rows\}(.*?)\{\/rows\}/si", $this->_template, $match))
+ if (! preg_match("/\{rows\}(.*?)\{\/rows\}/si", $this->_template, $match))
{
$this->_default_template();
return;
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index 760d93999..f13907000 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -135,23 +135,23 @@ class CI_Upload {
function do_upload($field = 'userfile')
{
// Is $_FILES[$field] set? If not, no reason to continue.
- if ( ! isset($_FILES[$field]))
+ if (! isset($_FILES[$field]))
{
$this->set_error('upload_no_file_selected');
return FALSE;
}
// Is the upload path valid?
- if ( ! $this->validate_upload_path())
+ if (! $this->validate_upload_path())
{
$this->set_error('upload_no_filepath');
return FALSE;
}
// Was the file able to be uploaded? If not, determine the reason why.
- if ( ! is_uploaded_file($_FILES[$field]['tmp_name']))
+ if (! is_uploaded_file($_FILES[$field]['tmp_name']))
{
- $error = ( ! isset($_FILES[$field]['error'])) ? 4 : $_FILES[$field]['error'];
+ $error = (! isset($_FILES[$field]['error'])) ? 4 : $_FILES[$field]['error'];
switch($error)
{
@@ -198,14 +198,14 @@ class CI_Upload {
}
// Is the file type allowed to be uploaded?
- if ( ! $this->is_allowed_filetype())
+ if (! $this->is_allowed_filetype())
{
$this->set_error('upload_invalid_filetype');
return FALSE;
}
// Is the file size within the allowed maximum?
- if ( ! $this->is_allowed_filesize())
+ if (! $this->is_allowed_filesize())
{
$this->set_error('upload_invalid_filesize');
return FALSE;
@@ -213,7 +213,7 @@ class CI_Upload {
// Are the image dimensions within the allowed size?
// Note: This can fail if the server has an open_basdir restriction.
- if ( ! $this->is_allowed_dimensions())
+ if (! $this->is_allowed_dimensions())
{
$this->set_error('upload_invalid_dimensions');
return FALSE;
@@ -253,9 +253,9 @@ class CI_Upload {
* we'll use move_uploaded_file(). One of the two should
* reliably work in most environments
*/
- if ( ! @copy($this->file_temp, $this->upload_path.$this->file_name))
+ if (! @copy($this->file_temp, $this->upload_path.$this->file_name))
{
- if ( ! @move_uploaded_file($this->file_temp, $this->upload_path.$this->file_name))
+ if (! @move_uploaded_file($this->file_temp, $this->upload_path.$this->file_name))
{
$this->set_error('upload_destination_error');
return FALSE;
@@ -350,7 +350,7 @@ class CI_Upload {
$filename = md5(uniqid(mt_rand())).$this->file_ext;
}
- if ( ! file_exists($path.$filename))
+ if (! file_exists($path.$filename))
{
return $filename;
}
@@ -360,7 +360,7 @@ class CI_Upload {
$new_filename = '';
for ($i = 1; $i < 100; $i++)
{
- if ( ! file_exists($path.$filename.$i.$this->file_ext))
+ if (! file_exists($path.$filename.$i.$this->file_ext))
{
$new_filename = $filename.$i.$this->file_ext;
break;
@@ -389,7 +389,7 @@ class CI_Upload {
*/
function set_max_filesize($n)
{
- $this->max_size = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n;
+ $this->max_size = (! eregi("^[[:digit:]]+$", $n)) ? 0 : $n;
}
// --------------------------------------------------------------------
@@ -403,7 +403,7 @@ class CI_Upload {
*/
function set_max_width($n)
{
- $this->max_width = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n;
+ $this->max_width = (! eregi("^[[:digit:]]+$", $n)) ? 0 : $n;
}
// --------------------------------------------------------------------
@@ -417,7 +417,7 @@ class CI_Upload {
*/
function set_max_height($n)
{
- $this->max_height = ( ! eregi("^[[:digit:]]+$", $n)) ? 0 : $n;
+ $this->max_height = (! eregi("^[[:digit:]]+$", $n)) ? 0 : $n;
}
// --------------------------------------------------------------------
@@ -447,7 +447,7 @@ class CI_Upload {
*/
function set_image_properties($path = '')
{
- if ( ! $this->is_image())
+ if (! $this->is_image())
{
return;
}
@@ -460,7 +460,7 @@ class CI_Upload {
$this->image_width = $D['0'];
$this->image_height = $D['1'];
- $this->image_type = ( ! isset($types[$D['2']])) ? 'unknown' : $types[$D['2']];
+ $this->image_type = (! isset($types[$D['2']])) ? 'unknown' : $types[$D['2']];
$this->image_size_str = $D['3']; // string containing height and width
}
}
@@ -587,7 +587,7 @@ class CI_Upload {
*/
function is_allowed_dimensions()
{
- if ( ! $this->is_image())
+ if (! $this->is_image())
{
return TRUE;
}
@@ -636,13 +636,13 @@ class CI_Upload {
$this->upload_path = str_replace("\\", "/", realpath($this->upload_path));
}
- if ( ! @is_dir($this->upload_path))
+ if (! @is_dir($this->upload_path))
{
$this->set_error('upload_no_filepath');
return FALSE;
}
- if ( ! is_really_writable($this->upload_path))
+ if (! is_really_writable($this->upload_path))
{
$this->set_error('upload_not_writable');
return FALSE;
@@ -741,7 +741,7 @@ class CI_Upload {
return FALSE;
}
- if ( ! $fp = @fopen($file, 'r+b'))
+ if (! $fp = @fopen($file, 'r+b'))
{
return FALSE;
}
@@ -830,7 +830,7 @@ class CI_Upload {
}
}
- return ( ! isset($this->mimes[$mime])) ? FALSE : $this->mimes[$mime];
+ return (! isset($this->mimes[$mime])) ? FALSE : $this->mimes[$mime];
}
/**
diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php
index ff6d4a933..dd60a56a1 100644
--- a/system/libraries/User_agent.php
+++ b/system/libraries/User_agent.php
@@ -63,7 +63,7 @@ class CI_User_agent {
$this->agent = trim($_SERVER['HTTP_USER_AGENT']);
}
- if ( ! is_null($this->agent))
+ if (! is_null($this->agent))
{
if ($this->_load_agent_file())
{
@@ -84,7 +84,7 @@ class CI_User_agent {
*/
function _load_agent_file()
{
- if ( ! @include(APPPATH.'config/user_agents'.EXT))
+ if (! @include(APPPATH.'config/user_agents'.EXT))
{
return FALSE;
}
@@ -339,7 +339,7 @@ class CI_User_agent {
*/
function is_referral()
{
- return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? FALSE : TRUE;
+ return (! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? FALSE : TRUE;
}
// --------------------------------------------------------------------
@@ -429,7 +429,7 @@ class CI_User_agent {
*/
function referrer()
{
- return ( ! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? '' : trim($_SERVER['HTTP_REFERER']);
+ return (! isset($_SERVER['HTTP_REFERER']) OR $_SERVER['HTTP_REFERER'] == '') ? '' : trim($_SERVER['HTTP_REFERER']);
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php
index 18fdba2d3..16e8cd74f 100644
--- a/system/libraries/Validation.php
+++ b/system/libraries/Validation.php
@@ -74,7 +74,7 @@ class CI_Validation {
}
else
{
- if ( ! is_array($data))
+ if (! is_array($data))
{
$data = array($data => $field);
}
@@ -87,10 +87,10 @@ class CI_Validation {
foreach($this->_fields as $key => $val)
{
- $this->$key = ( ! isset($_POST[$key])) ? '' : $this->prep_for_form($_POST[$key]);
+ $this->$key = (! isset($_POST[$key])) ? '' : $this->prep_for_form($_POST[$key]);
$error = $key.'_error';
- if ( ! isset($this->$error))
+ if (! isset($this->$error))
{
$this->$error = '';
}
@@ -112,7 +112,7 @@ class CI_Validation {
*/
function set_rules($data, $rules = '')
{
- if ( ! is_array($data))
+ if (! is_array($data))
{
if ($rules == '')
return;
@@ -141,7 +141,7 @@ class CI_Validation {
*/
function set_message($lang, $val = '')
{
- if ( ! is_array($lang))
+ if (! is_array($lang))
{
$lang = array($lang => $val);
}
@@ -195,9 +195,9 @@ class CI_Validation {
$ex = explode('|', $rules);
// Is the field required? If not, if the field is blank we'll move on to the next test
- if ( ! in_array('required', $ex, TRUE))
+ if (! in_array('required', $ex, TRUE))
{
- if ( ! isset($_POST[$field]) OR $_POST[$field] == '')
+ if (! isset($_POST[$field]) OR $_POST[$field] == '')
{
continue;
}
@@ -212,11 +212,11 @@ class CI_Validation {
* test for it here since there's not reason to go
* further
*/
- if ( ! isset($_POST[$field]))
+ if (! isset($_POST[$field]))
{
if (in_array('isset', $ex, TRUE) OR in_array('required', $ex))
{
- if ( ! isset($this->_error_messages['isset']))
+ if (! isset($this->_error_messages['isset']))
{
if (FALSE === ($line = $this->CI->lang->line('isset')))
{
@@ -229,7 +229,7 @@ class CI_Validation {
}
// Build the error message
- $mfield = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field];
+ $mfield = (! isset($this->_fields[$field])) ? $field : $this->_fields[$field];
$message = sprintf($line, $mfield);
// Set the error variable. Example: $this->username_error
@@ -274,7 +274,7 @@ class CI_Validation {
// Call the function that corresponds to the rule
if ($callback === TRUE)
{
- if ( ! method_exists($this->CI, $rule))
+ if (! method_exists($this->CI, $rule))
{
continue;
}
@@ -282,7 +282,7 @@ class CI_Validation {
$result = $this->CI->$rule($_POST[$field], $param);
// If the field isn't required and we just processed a callback we'll move on...
- if ( ! in_array('required', $ex, TRUE) AND $result !== FALSE)
+ if (! in_array('required', $ex, TRUE) AND $result !== FALSE)
{
continue 2;
}
@@ -290,7 +290,7 @@ class CI_Validation {
}
else
{
- if ( ! method_exists($this, $rule))
+ if (! method_exists($this, $rule))
{
/*
* Run the native PHP function if called for
@@ -314,7 +314,7 @@ class CI_Validation {
// Did the rule test negatively? If so, grab the error.
if ($result === FALSE)
{
- if ( ! isset($this->_error_messages[$rule]))
+ if (! isset($this->_error_messages[$rule]))
{
if (FALSE === ($line = $this->CI->lang->line($rule)))
{
@@ -327,8 +327,8 @@ class CI_Validation {
}
// Build the error message
- $mfield = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field];
- $mparam = ( ! isset($this->_fields[$param])) ? $param : $this->_fields[$param];
+ $mfield = (! isset($this->_fields[$field])) ? $field : $this->_fields[$field];
+ $mparam = (! isset($this->_fields[$param])) ? $param : $this->_fields[$param];
$message = sprintf($line, $mfield, $mparam);
// Set the error variable. Example: $this->username_error
@@ -385,13 +385,13 @@ class CI_Validation {
*/
function required($str)
{
- if ( ! is_array($str))
+ if (! is_array($str))
{
return (trim($str) == '') ? FALSE : TRUE;
}
else
{
- return ( ! empty($str));
+ return (! empty($str));
}
}
@@ -406,7 +406,7 @@ class CI_Validation {
*/
function matches($str, $field)
{
- if ( ! isset($_POST[$field]))
+ if (! isset($_POST[$field]))
{
return FALSE;
}
@@ -482,7 +482,7 @@ class CI_Validation {
*/
function valid_email($str)
{
- return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;
+ return (! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;
}
// --------------------------------------------------------------------
@@ -537,7 +537,7 @@ class CI_Validation {
*/
function alpha($str)
{
- return ( ! preg_match("/^([a-z])+$/i", $str)) ? FALSE : TRUE;
+ return (! preg_match("/^([a-z])+$/i", $str)) ? FALSE : TRUE;
}
// --------------------------------------------------------------------
@@ -551,7 +551,7 @@ class CI_Validation {
*/
function alpha_numeric($str)
{
- return ( ! preg_match("/^([a-z0-9])+$/i", $str)) ? FALSE : TRUE;
+ return (! preg_match("/^([a-z0-9])+$/i", $str)) ? FALSE : TRUE;
}
// --------------------------------------------------------------------
@@ -565,7 +565,7 @@ class CI_Validation {
*/
function alpha_dash($str)
{
- return ( ! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? FALSE : TRUE;
+ return (! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? FALSE : TRUE;
}
// --------------------------------------------------------------------
@@ -594,7 +594,7 @@ class CI_Validation {
*/
function is_numeric($str)
{
- return ( ! is_numeric($str)) ? FALSE : TRUE;
+ return (! is_numeric($str)) ? FALSE : TRUE;
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php
index f90ee56b1..f8ad01714 100644
--- a/system/libraries/Xmlrpc.php
+++ b/system/libraries/Xmlrpc.php
@@ -13,7 +13,7 @@
* @filesource
*/
-if ( ! function_exists('xml_parser_create'))
+if (! function_exists('xml_parser_create'))
{
show_error('Your PHP installation does not support XML');
}
@@ -176,7 +176,7 @@ class CI_Xmlrpc {
function timeout($seconds=5)
{
- if ( ! is_null($this->client) && is_int($seconds))
+ if (! is_null($this->client) && is_int($seconds))
{
$this->client->timeout = $seconds;
}
@@ -199,7 +199,7 @@ class CI_Xmlrpc {
function request($incoming)
{
- if ( ! is_array($incoming))
+ if (! is_array($incoming))
{
// Send Error
}
@@ -231,7 +231,7 @@ class CI_Xmlrpc {
{
if (is_array($value) && isset($value['0']))
{
- if ( ! isset($value['1']) OR ! isset($this->xmlrpcTypes[strtolower($value['1'])]))
+ if (! isset($value['1']) OR ! isset($this->xmlrpcTypes[strtolower($value['1'])]))
{
if (is_array($value[0]))
{
@@ -275,12 +275,12 @@ class CI_Xmlrpc {
$this->message = new XML_RPC_Message($this->method,$this->data);
$this->message->debug = $this->debug;
- if ( ! $this->result = $this->client->send($this->message))
+ if (! $this->result = $this->client->send($this->message))
{
$this->error = $this->result->errstr;
return FALSE;
}
- elseif( ! is_object($this->result->val))
+ elseif(! is_object($this->result->val))
{
$this->error = $this->result->errstr;
return FALSE;
@@ -765,7 +765,7 @@ class XML_RPC_Message extends CI_Xmlrpc
$r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']);
return $r;
}
- elseif ( ! is_object($this->xh[$parser]['value']))
+ elseif (! is_object($this->xh[$parser]['value']))
{
$r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']);
return $r;
@@ -961,7 +961,7 @@ class XML_RPC_Message extends CI_Xmlrpc
case 'STRUCT':
case 'ARRAY':
$cur_val = array_shift($this->xh[$the_parser]['valuestack']);
- $this->xh[$the_parser]['value'] = ( ! isset($cur_val['values'])) ? array() : $cur_val['values'];
+ $this->xh[$the_parser]['value'] = (! isset($cur_val['values'])) ? array() : $cur_val['values'];
$this->xh[$the_parser]['vt'] = strtolower($name);
break;
case 'NAME':
@@ -1101,7 +1101,7 @@ class XML_RPC_Message extends CI_Xmlrpc
$this->xh[$the_parser]['lv'] = 2; // Found a value
}
- if( ! @isset($this->xh[$the_parser]['ac']))
+ if(! @isset($this->xh[$the_parser]['ac']))
{
$this->xh[$the_parser]['ac'] = '';
}
diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php
index ac644d894..1b2ffca05 100644
--- a/system/libraries/Xmlrpcs.php
+++ b/system/libraries/Xmlrpcs.php
@@ -13,12 +13,12 @@
* @filesource
*/
-if ( ! function_exists('xml_parser_create'))
+if (! function_exists('xml_parser_create'))
{
show_error('Your PHP installation does not support XML');
}
-if ( ! class_exists('CI_Xmlrpc'))
+if (! class_exists('CI_Xmlrpc'))
{
show_error('You must load the Xmlrpc class before loading the Xmlrpcs class in order to create a server.');
}
@@ -176,7 +176,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
// PARSE + PROCESS XML DATA
//-------------------------------------
- if ( ! xml_parse($parser, $data, 1))
+ if (! xml_parse($parser, $data, 1))
{
// return XML error as a faultCode
$r = new XML_RPC_Response(0,
@@ -244,7 +244,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
// Valid Method
//-------------------------------------
- if ( ! isset($this->methods[$methName]['function']))
+ if (! isset($this->methods[$methName]['function']))
{
return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']);
}
diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php
index fab8e7f6b..4bdc92547 100644
--- a/system/libraries/Zip.php
+++ b/system/libraries/Zip.php
@@ -57,7 +57,7 @@ class CI_Zip {
{
foreach ((array)$directory as $dir)
{
- if ( ! preg_match("|.+/$|", $dir))
+ if (! preg_match("|.+/$|", $dir))
{
$dir .= '/';
}
@@ -196,7 +196,7 @@ class CI_Zip {
*/
function read_file($path, $preserve_filepath = FALSE)
{
- if ( ! file_exists($path))
+ if (! file_exists($path))
{
return FALSE;
}
@@ -301,7 +301,7 @@ class CI_Zip {
*/
function archive($filepath)
{
- if ( ! ($fp = @fopen($filepath, "wb")))
+ if (! ($fp = @fopen($filepath, "wb")))
{
return FALSE;
}
@@ -326,7 +326,7 @@ class CI_Zip {
*/
function download($filename = 'backup.zip')
{
- if ( ! preg_match("|.+?\.zip$|", $filename))
+ if (! preg_match("|.+?\.zip$|", $filename))
{
$filename .= '.zip';
}