Skip to content

03 Configuration

Shubhra Prakash Nandi edited this page Mar 26, 2026 · 3 revisions

Most of simple configuration keys are documented in file conf/conf.php.example. For the ones which require advanced configuration are documented below.

Creating a field map for address book contacts

The 'fieldmap' key in an address book configuration is an array which provides the mapping of vCard properties to one or multiple backend fields. All the backend field names provided here should be unique.

'fieldmap' => [ 'vcard_property_name_1' => [ ... ],
'vcard_property_name_2' => [ [ ... ], [ ... ], ... ],
...
'vcard_property_name_N' => [ ... ]
],

Each vCard property name key is an array with below configuration keys. If a vCard property value needs to stored in different backend fields based on it's parameters then vCard property name key is set of array with each array having the same configuration keys as below. The 'group_fieldmap' field is analogous to 'fieldmap' for a contact group and has the same configuration keys as below.

  • field_name (mandatory): The name of the backend field to which the data of the property should be stored. In case the vCard property is a composite value property this key could also be an array. To map a composite value property to individual backend fields check conf/vcard_metadata.json for logical names of the components of a composite value.

  • field_data_format (optional): The data format of the backend field. Possible values are as below.

    • text (default): Stores value as text.

      For example
      'NICKNAME' => ['field_name' => 'displayName']

    • binary: Stores value as binary.

      For example
      'PHOTO' => [
      // Mapping a picture
      [
      'field_name' => 'photo',
      'field_data_format' => 'binary',
      'field_data_mediatype' => ['image/g3fax'], // List of mediatype which a
      // binary backend field will accept
      ],

      // Mapping profile picture
      [
      'field_name' => 'jpegPhoto',
      'field_data_format' => 'binary',
      'field_data_mediatype' => ['image/jpeg', 'image/png'], // List of mediatype which a
      // binary backend field will accept
      ]
      ]

    • timestamp: Stores value as generalized time.

      For example
      'X-EVENT-TIME' => [
      [
      'field_name' => 'customEventTime',
      'field_data_format' => 'timestamp',
      ]
      ]
  • field_data_mediatype (optional): The MIME type of the data which is accepted to be stored in the field_name. Defaults to 'text/ascii'.

  • parameters (optional): vCard parameter(s) to match for field_name to be selected for storing the value.

  • map_component_separator (mandatory if the vCard property is a composite value property and field_name is not an array): The character to use as a separator for component values in a composite backend field.

    For example
    'ADR' => [
    'field_name' => 'postalAddress',
    'map_component_separator' => '$'
    ],

  • reverse_map_parameter_index (optional): vCard parameters to be added from parameters when generating a vCard from a backend contact. Defaults to first parameters array if parameters is defined.

Tuning sync database connection

The sub keys of 'sync_database' key in the conf file is used to define connection parameters to sync database. Below is some more description about the sub keys.

  • options (optional): This is an array of database connection attributes and their values in the form [attr1 => val1, attr2 => val2].

For example [PDO::ATTR_TIMEOUT => 10, PDO::ATTR_PERSISTENT => true] sets database connection timeout to 10 secs and turns on database connection reuse.

More information on the possible attributes and their values is present here - https://www.php.net/manual/en/pdo.constants.php (this application though supports only a subset of the options provided in the link).

Clone this wiki locally