is_php()
is_php( $version) : boolean
Determines if the current version of PHP is equal to or greater than the supplied value
Parameters
$version |
Returns
boolean —TRUE if the current version is $version or higher
CodeIgniter
An open source application development framework for PHP
This content is released under the MIT License (MIT)
Copyright (c) 2014 - 2016, British Columbia Institute of Technology
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
is_really_writable( $file) : boolean
Tests for file writability
is_writable() returns TRUE on Windows servers when you really can't write to the file, based on the read-only attribute. is_writable() is also unreliable on Unix servers if safe_mode is on.
$file |
load_class( $class, $directory = 'libraries', $param = NULL) : object
Class registry
This function acts as a singleton. If the requested class does not exist it is instantiated and set to a static variable. If it has previously been instantiated the variable is returned.
$class | ||
$directory | ||
$param |
show_error( $message, $status_code = 500, $heading = 'An Error Was Encountered') : void
Error Handler
This function lets us invoke the exception class and display errors using the standard error template located in application/views/errors/error_general.php This function will send the error page directly to the browser and exit.
$message | ||
$status_code | ||
$heading |
_error_handler(integer $severity, string $message, string $filepath, integer $line) : void
Error Handler
This is the custom error handler that is declared at the (relative) top of CodeIgniter.php. The main reason we use this is to permit PHP errors to be logged in our own log files since the user may not have access to server logs. Since this function effectively intercepts PHP errors, however, we also need to display errors based on the current error_reporting level. We do that with the use of a PHP error template.
integer | $severity | |
string | $message | |
string | $filepath | |
integer | $line |
_shutdown_handler() : void
Shutdown Handler
This is the shutdown handler that is declared at the top of CodeIgniter.php. The main reason we use this is to simulate a complete custom exception handler.
E_STRICT is purposively neglected because such events may have been caught. Duplication or none? None is preferred for now.
html_escape(mixed $var, boolean $double_encode = TRUE) : mixed
Returns HTML escaped variable.
mixed | $var | The input string or array of strings to be escaped. |
boolean | $double_encode | $double_encode set to FALSE prevents escaping twice. |
The escaped string or array of strings as a result.
function_usable(string $function_name) : boolean
Function usable
Executes a function_exists() check, and if the Suhosin PHP extension is loaded - checks whether the function that is checked might be disabled in there as well.
This is useful as function_exists() will return FALSE for functions disabled via the disable_functions php.ini setting, but not for suhosin.executor.func.blacklist and suhosin.executor.disable_eval. These settings will just terminate script execution if a disabled function is executed.
The above described behavior turned out to be a bug in Suhosin, but even though a fix was commited for 0.9.34 on 2012-02-12, that version is yet to be released. This function will therefore be just temporary, but would probably be kept for a few years.
string | $function_name | Function to check for |
TRUE if the function exists and is safe to call, FALSE otherwise.