summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorDaniel Hunsaker <danhunsaker@gmail.com>2013-03-04 10:05:20 +0100
committerDaniel Hunsaker <danhunsaker@gmail.com>2013-03-04 10:05:20 +0100
commit50dfe0175df02fe4aa243757bdf1b42fb9fc3169 (patch)
treeaecad56261ff780ffb92d75492445de5e6479cc1 /system
parente5d7af508680afced4c96b5a52a054c73b6c537e (diff)
Updated in accordance with feedback from @narfbg
- Removed commented lists of constants from the three reference conventions, replacing each with the URLs at which more information can be found. - Renamed a few constants to more closely reflect CodeIgniter conventions. - Modified a couple of lines which were in violation of the CI Style Guide. Signed-off-by: Daniel Hunsaker <danhunsaker@gmail.com>
Diffstat (limited to 'system')
-rw-r--r--system/core/Common.php23
-rw-r--r--system/core/Exceptions.php2
-rw-r--r--system/helpers/download_helper.php4
-rw-r--r--system/libraries/Driver.php2
-rw-r--r--system/libraries/Xmlrpcs.php2
5 files changed, 18 insertions, 15 deletions
diff --git a/system/core/Common.php b/system/core/Common.php
index 479f0da7f..e11668d5f 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -177,7 +177,7 @@ if ( ! function_exists('load_class'))
// self-referencing loop with the Exceptions class
set_status_header(503);
echo 'Unable to locate the specified class: '.$class.'.php';
- exit(EXIT_UNK_CLASS);
+ exit(EXIT_UNKNOWN_CLASS);
}
// Keep track of what we just loaded
@@ -377,13 +377,13 @@ if ( ! function_exists('show_error'))
$exit_status = $status_code + EXIT__AUTO_MIN;
if ($exit_status > EXIT__AUTO_MAX)
{
- $exit_status = EXIT_FAILURE;
+ $exit_status = EXIT_ERROR;
}
$status_code = 500;
}
else
{
- $exit_status = EXIT_FAILURE;
+ $exit_status = EXIT_ERROR;
}
$_error =& load_class('Exceptions', 'core');
@@ -411,7 +411,7 @@ if ( ! function_exists('show_404'))
{
$_error =& load_class('Exceptions', 'core');
$_error->show_404($page, $log_error);
- exit(EXIT_UNK_FILE);
+ exit(EXIT_UNKNOWN_FILE);
}
}
@@ -531,13 +531,16 @@ if ( ! function_exists('set_status_header'))
$server_protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : FALSE;
- if (strpos(php_sapi_name(), 'cgi') === 0)
+ if ( ! headers_sent())
{
- if (!headers_sent()) header('Status: '.$code.' '.$text, TRUE);
- }
- else
- {
- if (!headers_sent()) header(($server_protocol ? $server_protocol : 'HTTP/1.1').' '.$code.' '.$text, TRUE, $code);
+ if (strpos(php_sapi_name(), 'cgi') === 0)
+ {
+ header('Status: '.$code.' '.$text, TRUE);
+ }
+ else
+ {
+ header(($server_protocol ? $server_protocol : 'HTTP/1.1').' '.$code.' '.$text, TRUE, $code);
+ }
}
}
}
diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php
index 423387ff9..9c68d06a5 100644
--- a/system/core/Exceptions.php
+++ b/system/core/Exceptions.php
@@ -117,7 +117,7 @@ class CI_Exceptions {
}
echo $this->show_error($heading, $message, 'error_404', 404);
- exit(EXIT_UNK_FILE);
+ exit(EXIT_UNKNOWN_FILE);
}
// --------------------------------------------------------------------
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php
index 25863eaa4..bd3296574 100644
--- a/system/helpers/download_helper.php
+++ b/system/helpers/download_helper.php
@@ -142,7 +142,7 @@ if ( ! function_exists('force_download'))
if ($data !== NULL)
{
echo $data;
- exit(EXIT_SUCCESS);
+ exit;
}
// Flush 1MB chunks of data
@@ -152,7 +152,7 @@ if ( ! function_exists('force_download'))
}
fclose($fp);
- exit(EXIT_SUCCESS);
+ exit;
}
}
diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php
index 9a56013ab..1bc365cbc 100644
--- a/system/libraries/Driver.php
+++ b/system/libraries/Driver.php
@@ -290,7 +290,7 @@ class CI_Driver {
$trace = debug_backtrace();
_exception_handler(E_ERROR, "No such method '{$method}'", $trace[1]['file'], $trace[1]['line']);
- exit(EXIT_UNK_MEMBER);
+ exit(EXIT_UNKNOWN_METHOD);
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php
index e150c13b7..a6048cb9f 100644
--- a/system/libraries/Xmlrpcs.php
+++ b/system/libraries/Xmlrpcs.php
@@ -171,7 +171,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc {
header('Content-Type: text/xml');
header('Content-Length: '.strlen($payload));
echo $payload;
- exit(EXIT_SUCCESS);
+ exit;
}
// --------------------------------------------------------------------