From 0b59f270a432f8c7b6128981f0a39b4a2e2fbd34 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 13 May 2008 04:22:33 +0000 Subject: Some sweeping syntax changes for consistency: (! foo) changed to ( ! foo) || changed to OR changed newline standardization code in various places from preg_replace to str_replace --- user_guide/general/creating_libraries.html | 4 ++-- user_guide/helpers/file_helper.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/image_lib.html | 6 +++--- user_guide/libraries/input.html | 4 ++-- user_guide/libraries/trackback.html | 4 ++-- user_guide/libraries/xmlrpc.html | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) (limited to 'user_guide') diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html index c2c600e29..c1318709f 100644 --- a/user_guide/general/creating_libraries.html +++ b/user_guide/general/creating_libraries.html @@ -98,7 +98,7 @@ they are initialized.

Classes should have this basic prototype (Note: We are using the name Someclass purely as an example):

-<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Someclass {

@@ -137,7 +137,7 @@ $this->load->library('Someclass', $params);

If you use this feature you must set up your class constructor to expect data:

-<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Someclass {

diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 13d0beb97..2c3dba13a 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -88,7 +88,7 @@ might not work if you are trying to access a file above the calling script.

$data = 'Some file data';

-if (! write_file('./path/to/file.php', $data))
+if ( ! write_file('./path/to/file.php', $data))
{
     echo 'Unable to write the file';
}
diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index bc6bd9d83..d4990dffd 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -250,7 +250,7 @@ in a loop, permitting the data to be reset between cycles.

The Email sending function. Returns boolean TRUE or FALSE based on success or failure, enabling it to be used conditionally:

-if (! $this->email->send())
+if ( ! $this->email->send())
{
    // Generate error
}
diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index c8773f253..25cb51556 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -140,7 +140,7 @@ $plaintext_string = $this->encrypt->decode($encrypted_string);

Please visit php.net for a list of available ciphers.

If you'd like to manually test whether your server supports Mcrypt you can use:

-echo (! function_exists('mcrypt_encrypt')) ? 'Nope' : 'Yup'; +echo ( ! function_exists('mcrypt_encrypt')) ? 'Nope' : 'Yup';

$this->encrypt->set_mode();

diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 6e0d10f83..277878147 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -167,7 +167,7 @@ class Upload extends Controller { $this->load->library('upload', $config); - if (! $this->upload->do_upload()) + if ( ! $this->upload->do_upload()) { $error = array('error' => $this->upload->display_errors()); diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index f905b88f8..8fd751317 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -132,7 +132,7 @@ error message using this function:

A good practice is use the processing function conditionally, showing an error upon failure, like this:

-if (! $this->image_lib->resize())
+if ( ! $this->image_lib->resize())
{
    echo $this->image_lib->display_errors();
}
@@ -370,7 +370,7 @@ $config['y_axis'] = '60';
$this->image_lib->initialize($config);

-if (! $this->image_lib->crop())
+if ( ! $this->image_lib->crop())
{
    echo $this->image_lib->display_errors();
}
@@ -407,7 +407,7 @@ $config['rotation_angle'] = 'hor';
$this->image_lib->initialize($config);

-if (! $this->image_lib->rotate())
+if ( ! $this->image_lib->rotate())
{
    echo $this->image_lib->display_errors();
}
diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 311dab82f..17ed7f0ff 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -120,7 +120,7 @@ return false (boolean) if not. This lets you conveniently use data without havi In other words, normally you might do something like this:

-if (! isset($_POST['something']))
+if ( ! isset($_POST['something']))
{
    $something = FALSE;
}
@@ -178,7 +178,7 @@ else

Takes an IP address as input and returns TRUE or FALSE (boolean) if it is valid or not. Note: The $this->input->ip_address() function above validates the IP automatically.

-if (! $this->input->valid_ip($ip))
+if ( ! $this->input->valid_ip($ip))
{
     echo 'Not Valid';
}
diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 02c8852d4..f86ccca02 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -86,7 +86,7 @@ $tb_data = array(
                'charset'   => 'utf-8'
                );

-if (! $this->trackback->send($tb_data))
+if ( ! $this->trackback->send($tb_data))
{
     echo $this->trackback->display_errors();
}
@@ -173,7 +173,7 @@ if ($this->uri->segment(3) == FALSE)
    $this->trackback->send_error("Unable to determine the entry ID");
}

-if (! $this->trackback->receive())
+if ( ! $this->trackback->receive())
{
    $this->trackback->send_error("The Trackback did not contain valid data");
}
diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index b7e98f653..24bbf403b 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -120,7 +120,7 @@ $this->xmlrpc->method('weblogUpdates.ping');
$request = array('My Photoblog', 'http://www.my-site.com/photoblog/');
$this->xmlrpc->request($request);

-if (! $this->xmlrpc->send_request())
+if ( ! $this->xmlrpc->send_request())
{
    echo $this->xmlrpc->display_error();
}
@@ -336,7 +336,7 @@ class Xmlrpc_client extends Controller { $request = array('How is it going?'); $this->xmlrpc->request($request); - if (! $this->xmlrpc->send_request()) + if ( ! $this->xmlrpc->send_request()) { echo $this->xmlrpc->display_error(); } -- cgit v1.2.3-24-g4f1b