PHP Class Horde_Data_Base, horde

Author: Jan Schneider ([email protected])
Author: Chuck Hagenbuch ([email protected])
Show file Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$storage Horde_Data_Storage Storage object.

Protected Properties

Property Type Description
$_browser Horde_Browser Browser object.
$_cleanupCallback callback Cleanup callback function.
$_contentType string MIME content type.
$_extension string File extension.
$_http Horde_Http_Client HTTP client object.
$_vars Horde_Variables Variables object.
$_warnings array A list of warnings raised during the last operation.

Public Methods

Method Description
__construct ( Horde_Data_Storage $storage, array $params = [] ) Constructor.
cleanup ( ) : mixed Removes any uploaded and moved files.
exportData ( $data, $method = 'REQUEST' ) Stub to return exported data.
exportFile ( $filename, $data ) Stub to export data to a file.
getContentType ( ) : string Returns the content type.
getFilename ( string $basename ) : string Returns the full filename including the basename and extension.
getNewline ( ) : string Tries to determine the expected newline character based on the platform information passed by the browser's agent header.
importData ( $text ) Stub to import passed data.
importFile ( $filename, $header = false ) Imports a file.
importUrl ( $url, $header = false ) Imports a URL.
nextStep ( integer $action, array $param = [] ) : mixed Takes all necessary actions for the given import step, parameters and form values and returns the next necessary step.
warnings ( ) : array Returns a list of warnings that have been raised during the last operation.

Protected Methods

Method Description
_mapDate ( string $date, string $type, array $params, integer $key ) : string Maps a date/time string to an associative array.

Method Details

__construct() public method

Constructor.
public __construct ( Horde_Data_Storage $storage, array $params = [] )
$storage Horde_Data_Storage
$params array Optional parameters: - browser: (Horde_Browser) A browser object. - http: (Horde_Http_Client) A HTTP client object. - cleanup: (callback) A callback to call at cleanup time. - vars: (Horde_Variables) Form data.

_mapDate() protected method

Maps a date/time string to an associative array.
protected _mapDate ( string $date, string $type, array $params, integer $key ) : string
$date string The date.
$type string One of 'date', 'time' or 'datetime'.
$params array Two-dimensional array with additional information about the formatting. Possible keys are: - delimiter: The character that seperates the different date/time parts. - format: If 'ampm' and $date contains a time we assume that it is in AM/PM format. - order: If $type is 'datetime' the order of the day and time parts: -1 (timestamp), 0 (day/time), 1 (time/day).
$key integer The key to use for $params.
return string The date or time in ISO format.

cleanup() public method

Removes any uploaded and moved files.
public cleanup ( ) : mixed
return mixed If callback called, the return value of this call. This should be the value of the first import step.

exportData() abstract public method

Stub to return exported data.
abstract public exportData ( $data, $method = 'REQUEST' )

exportFile() abstract public method

Stub to export data to a file.
abstract public exportFile ( $filename, $data )

getContentType() public method

Returns the content type.
public getContentType ( ) : string
return string The content type.

getFilename() public method

Returns the full filename including the basename and extension.
public getFilename ( string $basename ) : string
$basename string Basename for the file.
return string The file name.

getNewline() public method

Tries to determine the expected newline character based on the platform information passed by the browser's agent header.
public getNewline ( ) : string
return string The guessed expected newline characters, either \n, \r or \r\n.

importData() public method

Stub to import passed data.
public importData ( $text )

importFile() public method

Imports a file.
public importFile ( $filename, $header = false )

importUrl() public method

Imports a URL.
Since: 2.1.0
public importUrl ( $url, $header = false )

nextStep() public method

Takes all necessary actions for the given import step, parameters and form values and returns the next necessary step.
public nextStep ( integer $action, array $param = [] ) : mixed
$action integer The current step. One of the IMPORT_* constants.
$param array An associative array containing needed parameters for the current step.
return mixed Either the next step as an integer constant or imported data set after the final step.

warnings() public method

Returns a list of warnings that have been raised during the last operation.
public warnings ( ) : array
return array A (possibly empty) list of warnings.

Property Details

$_browser protected property

Browser object.
protected Horde_Browser $_browser
return Horde_Browser

$_cleanupCallback protected property

Cleanup callback function.
protected callback $_cleanupCallback
return callback

$_contentType protected property

MIME content type.
protected string $_contentType
return string

$_extension protected property

File extension.
protected string $_extension
return string

$_http protected property

HTTP client object.
protected Horde_Http_Client $_http
return Horde_Http_Client

$_vars protected property

Variables object.
protected Horde_Variables $_vars
return Horde_Variables

$_warnings protected property

A list of warnings raised during the last operation.
protected array $_warnings
return array

$storage public property

Storage object.
public Horde_Data_Storage $storage
return Horde_Data_Storage