[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Horde/ -> Util.php (sommaire)

Error code for a missing driver configuration.

Poids: 866 lignes (28 kb)
Inclus ou requis: 1 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Util:: (27 méthodes):
  cloneObject()
  bufferOutput()
  nonInputVar()
  addParameter()
  removeParameter()
  nocacheUrl()
  formInput()
  pformInput()
  dispelMagicQuotes()
  getFormData()
  getGet()
  getPost()
  getTempDir()
  getTempFile()
  createTempDir()
  realPath()
  deleteAtShutdown()
  _deleteAtShutdown()
  closeWindowJS()
  extensionExists()
  loadExtension()
  assertDriverConfig()
  date2strftime()
  strftime2date()
  _()
  bindtextdomain()
  textdomain()


Classe: Util  - X-Ref

The Util:: class provides generally useful methods of different kinds.

$Horde: framework/Util/Util.php,v 1.384.6.17 2006/05/05 16:02:12 jan Exp $

Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
Copyright 1999-2006 Jon Parise <jon@horde.org>

See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

cloneObject(&$obj)   X-Ref
Returns an object's clone.

param: object &$obj  The object to clone.
return: object  The cloned object.

bufferOutput()   X-Ref
Buffers the output from a function call, like readfile() or
highlight_string(), that prints the output directly, so that instead it
can be returned as a string and used.

param: string $function  The function to run.
param: mixed $arg1       First argument to $function().
param: mixed $arg2       Second argument to $function().
param: mixed $arg...     ...
param: mixed $argN       Nth argument to $function().
return: string  The output of the function.

nonInputVar($varname, $default = null)   X-Ref
Checks to see if a value has been set by the script and not by GET,
POST, or cookie input. The value being checked MUST be in the global
scope.

param: string $varname  The variable name to check.
param: mixed $default   Default value if the variable isn't present
return: mixed  $default if the var is in user input or not present,

addParameter($url, $parameter, $value = null, $encode = true)   X-Ref
Adds a name=value pair to the end of an URL, taking care of whether
there are existing parameters and whether to use ?, & or &amp; as the
glue.  All data will be urlencoded.

param: string $url       The URL to modify
param: mixed $parameter  Either the name=value pair to add
param: string $value     If specified, the value part ($parameter is
param: boolean $encode   If true, and we don't have argument separators
return: string  The modified URL.

removeParameter($url, $remove)   X-Ref
Removes name=value pairs from a URL.

param: string $url    The URL to modify.
param: mixed $remove  Either a single parameter to remove or an array
return: string  The modified URL.

nocacheUrl($url)   X-Ref
Returns a url with the 'nocache' parameter added, if the browser is
buggy and caches old URLs.

param: string $url  The URL to modify.
return: string  The requested URI.

formInput($append_session = 0)   X-Ref
Returns a hidden form input containing the session name and id.

param: boolean $append_session  0 = only if needed, 1 = always.
return: string  The hidden form input, if needed/requested.

pformInput($append_session = 0)   X-Ref
Prints a hidden form input containing the session name and id.

param: boolean $append_session  0 = only if needed, 1 = always.

dispelMagicQuotes(&$var)   X-Ref
If magic_quotes_gpc is in use, run stripslashes() on $var.

param: string &$var  The string to un-quote, if necessary.
return: string  $var, minus any magic quotes.

getFormData($var, $default = null)   X-Ref
Gets a form variable from GET or POST data, stripped of magic quotes if
necessary. If the variable is somehow set in both the GET data and the
POST data, the value from the POST data will be returned and the GET
value will be ignored.

param: string $var      The name of the form variable to look for.
param: string $default  The value to return if the variable is not
return: string  The cleaned form variable, or $default.

getGet($var, $default = null)   X-Ref
Gets a form variable from GET data, stripped of magic quotes if
necessary. This function will NOT return a POST variable.

param: string $var      The name of the form variable to look for.
param: string $default  The value to return if the variable is not
return: string  The cleaned form variable, or $default.

getPost($var, $default = null)   X-Ref
Gets a form variable from POST data, stripped of magic quotes if
necessary. This function will NOT return a GET variable.

param: string $var      The name of the form variable to look for.
param: string $default  The value to return if the variable is not
return: string  The cleaned form variable, or $default.

getTempDir()   X-Ref
Determines the location of the system temporary directory.

return: string  A directory name which can be used for temp files.

getTempFile($prefix = '', $delete = true, $dir = '', $secure = false)   X-Ref
Creates a temporary filename for the lifetime of the script, and
(optionally) register it to be deleted at request shutdown.

param: string $prefix   Prefix to make the temporary name more
param: boolean $delete  Delete the file at the end of the request?
param: string $dir      Directory to create the temporary file in.
param: boolean $secure  If deleting file, should we securely delete the
return: string   Returns the full path-name to the temporary file.

createTempDir($delete = true, $temp_dir = null)   X-Ref
Creates a temporary directory in the system's temporary directory.

param: boolean $delete   Delete the temporary directory at the end of
param: string $temp_dir  Use this temporary directory as the directory
return: string  The pathname to the new temporary directory.

realPath($path)   X-Ref
Returns the canonical path of the string.  Like PHP's built-in
realpath() except the directory need not exist on the local server.

Algorithim loosely based on code from the Perl File::Spec::Unix module
(version 1.5).

param: string $path  A file path.
return: string  The canonicalized file path.

deleteAtShutdown($filename = false, $register = true,$secure = false)   X-Ref
Removes given elements at request shutdown.

If called with a filename will delete that file at request shutdown; if
called with a directory will remove that directory and all files in that
directory at request shutdown.

If called with no arguments, return all elements to be deleted (this
should only be done by Util::_deleteAtShutdown).

The first time it is called, it initializes the array and registers
Util::_deleteAtShutdown() as a shutdown function - no need to do so
manually.

The second parameter allows the unregistering of previously registered
elements.

param: string $filename   The filename to be deleted at the end of the
param: boolean $register  If true, then register the element for
param: boolean $secure    If deleting file, should we securely delete

_deleteAtShutdown()   X-Ref
Deletes registered files at request shutdown.

This function should never be called manually; it is registered as a
shutdown function by Util::deleteAtShutdown() and called automatically
at the end of the request. It will retrieve the list of folders and
files to delete from Util::deleteAtShutdown()'s static array, and then
iterate through, deleting folders recursively.

Contains code from gpg_functions.php.
Copyright (c) 2002-2003 Braverock Ventures


closeWindowJS($code = '')   X-Ref
Outputs javascript code to close the current window.

param: string $code  Any addtional javascript code to run before

extensionExists($ext)   X-Ref
Caches the result of extension_loaded() calls.

param: string $ext  The extension name.
return: boolean  Is the extension loaded?

loadExtension($ext)   X-Ref
Tries to load a PHP extension, behaving correctly for all operating
systems.

param: string $ext  The extension to load.
return: boolean  True if the extension is now loaded, false if not.

assertDriverConfig($params, $fields, $name, $info = array()   X-Ref
Checks if all necessary parameters for a driver's configuration are set
and returns a PEAR_Error if something is missing.

param: array $params   The configuration array with all parameters.
param: array $fields   An array with mandatory parameter names for this
param: string $name    The clear text name of the driver. If not
param: array $info     A hash containing detailed information about the

date2strftime($format)   X-Ref
Returns a format string to be used by strftime().

param: string $format  A format string as used by date().
return: string  A format string as similar as possible to $format.

strftime2date($format)   X-Ref
Returns a format string to be used by date().

param: string $format  A format string as used by strftime().
return: string  A format string as similar as possible to $format.

_($string)   X-Ref
Pas de description

bindtextdomain()   X-Ref
Pas de description

textdomain()   X-Ref
Pas de description



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7