Skip to main content Help Control Panel

Aubagne HipHop

Tout le Hip Hop d'Aubagne et des alentours

Home «   Server software «  

Documentation: shared/safe.php

ContentClick to slide

class Safe - Safe PHP library

PHP is very powerful and versatile, and this explains its phenomenal on-going success. The drawback of PHP openness and richness is that some run-time may miss the promise. This class attempts to compensate for such discrepancies as smoothly as possible.

For example, some ISP (e.g., Free in France) forbid some function calls, such as set_time_limit(). In such a case, original code has to be modified to Safe::set_time_limit() instead.

Most member functions of the Safe class just mimic functions normally provided by the PHP library:

This script is a reference file of this system.

Licence: GNU Lesser General Public License

Auteurs:

chdir() - Change current directory

function chdir($path)

chmod() - Change file mode

function chmod($file_name, $mode = 0777)

closedir() - Release a directory resource

function closedir($handle)

copy() - Copy a file

function copy($source, $destination)

error_reporting() - Change reporting level

function error_reporting($level)

file() - Make an array out of a file

function file($path)

file_get_contents() - Read one file in a string

function file_get_contents($file)

file_put_contents() - Write one string in a file

function file_put_contents($file, $content)

This function also creates the path, if necessary.

Warning: this function expects path information relative to the YACS installation directory. This behavior differs from the original PHP function.

filemtime() - Date of last modification

function filemtime($path)

filesize() - Get file size

function filesize($path)

fopen() - Open a file

function fopen($path, $mode)

fsockopen() - Open a network stream

function fsockopen($server, $port, &$errno, &$errstr, $timeout)

get_cfg_var() - Get one run-time parameter

function get_cfg_var($parameter)

GetImageSize() - Get image meta-data

function GetImageSize($name)

gettext() - Localize a string

function gettext($text)

header() - Change the web response

function header($attribute)



highlight_string() - Beautify some code

function highlight_string($text)

ignore_user_abort() - Ignore user abort

function ignore_user_abort($value)

is_uploaded_file() - Ensure a file has been properly uploaded

function is_uploaded_file($path)

is_writable() - Check if a file is writable

function is_writable($path)

ini_get() - Get the value of a configuration option

function ini_get($name)

ini_set() - Set the value of a configuration option

function ini_set($name, $value)

glob() - List matching files

function glob($pattern)

load() - Include one script

function load($name)

If you include some file with this function, and miss some variables afterwards, ensure that these variables are globally defined in the included file.

make_path() - Create a complete path to a file

function make_path($path)

mkdir() - Create a directory

function mkdir($path_name, $mode = 0777)

move_uploaded_file() - Move a new file

function move_uploaded_file($source, $destination)

ngettext() - Localize a string in singualr/plural form

function ngettext($singular, $plural, $count)

ob_start() - Start output buffering

function ob_start($handler='ob_gz_handler')

opendir() - Prepare to read content of a directory

function opendir($path)

readdir() - Get next entry in directory

function readdir($handle)

realpath() - Locate some file

function realpath($path)

redirect() - Jump to another web page

function redirect($reference)

This function never returns.

rename() - Rename a file

function rename($original, $target)

rmdir() - Remove a directory

function rmdir($path_name)

set_time_limit() - Extends execution time

function set_time_limit($duration)

Set the number of seconds a script is allowed to run.

setcookie() - Save data on browser side

function setcookie($name, $value, $expire, $path)

setlocale() - Set locale parameter

function setlocale($category, $locale)

Caution: only work with a fixed number of parameters

sleep() - Delay execution for some time

function sleep($duration)

stat() - Describe a file

function stat($file_name)

syslog() - Generate a system log message

function syslog($priority, $message)

system() - Execute a system command

function system($command)

Caution: only work with one parameter

tempnam() - Create a temporary file

function tempnam($path, $prefix)

touch() - Touch a file

function touch($file_name, $modification_stamp=NULL)

unlink() - Remove a file

function unlink($file_name)

Tools
Browse the source of this script
Server software