\Turba_Data_Ldif

Horde_Data implementation for LDAP Data Interchange Format (LDIF).

Copyright 2007-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (ASL). If you did not receive this file, see http://www.horde.org/licenses/apache.

Summary

Methods
Properties
Constants
importData()
exportFile()
exportData()
nextStep()
No public properties found
No constants found
_is_safe_string()
$_extension
$_contentType
$_mozillaAttr
$_turbaAttr
$_turbaMozillaMap
N/A
No private methods found
No private properties found
N/A

Properties

$_extension

$_extension : 

Type

$_contentType

$_contentType : 

Type

$_mozillaAttr

$_mozillaAttr : array

Useful Mozilla address book attribute names.

Type

array

$_turbaAttr

$_turbaAttr : array

Useful Turba address book attribute names.

Type

array

$_turbaMozillaMap

$_turbaMozillaMap : array

Turba address book attribute names and the corresponding Mozilla name.

Type

array

Methods

importData()

importData(  $contents,   $header = false) 

Parameters

$contents
$header

exportFile()

exportFile(string  $filename, array  $data, boolean  $header = false) 

Builds a LDIF file from a given data structure and triggers its download.

It DOES NOT exit the current script but only outputs the correct headers and data.

Parameters

string $filename

The name of the file to be downloaded.

array $data

A two-dimensional array containing the data set.

boolean $header

If true, the rows of $data are associative arrays with field names as their keys.

exportData()

exportData(array  $data, boolean  $header = false) : string

Builds a LDIF file from a given data structure and returns it as a string.

Parameters

array $data

A two-dimensional array containing the data set.

boolean $header

If true, the rows of $data are associative arrays with field names as their keys.

Returns

string —

The LDIF data.

nextStep()

nextStep(integer  $action, array  $param = array()) : mixed

Takes all necessary actions for the given import step, parameters and form values and returns the next necessary step.

Parameters

integer $action

The current step. One of the IMPORT_* constants.

array $param

An associative array containing needed parameters for the current step.

Throws

\Horde_Data_Exception

Returns

mixed —

Either the next step as an integer constant or imported data set after the final step.

_is_safe_string()

_is_safe_string(string  $str) : boolean

Checks if a string is safe according to RFC 2849, or if it needs to be base64 encoded.

Parameters

string $str

The string to check.

Returns

boolean —

True if the string is safe.