public class DatasourceManager

class.datasourcemanager.php #14

The DatasourceManager class is responsible for managing all Datasource objects in Symphony. Datasources's are stored on the file system either in the WORKSPACE . /data-sources folder or provided by an extension in EXTENSIONS . /./data-sources folder. Datasources are run from the Frontend to commonly output Entries and parameters, however there any different types of Datasource that query external sources for data. Typically, a Datasource returns XML.

Methods

static string __getClassName(string $handle)

Given a name, returns the full class name of an Datasources. Datasources use a 'datasource' prefix.

Parameters
  • $handle stringThe Datasource handle

static string|boolean __getClassPath(string $handle)

Finds a Datasource by name by searching the data-sources folder in the workspace and in all installed extension folders and returns the path to it's folder.

Parameters
  • $handle stringThe handle of the Datasource free from any Symphony conventions such as data.*.php

Returns

If the datasource is found, the function returns the path it's folder, otherwise false.

static string __getDriverPath(string $handle)

Given a name, return the path to the Datasource class

Parameters
  • $handle stringThe handle of the Datasource free from any Symphony conventions such as data.*.php

See Also
static string __getHandleFromFilename(string $filename)

Given the filename of a Datasource, return its handle. This will remove the Symphony convention of data.*.php

Parameters
  • $filename stringThe filename of the Datasource

static void about(mixed $name)
static Datasource create(string $handle, array $env, boolean $process_params)

Creates an instance of a given class and returns it.

Parameters
  • $handle stringThe handle of the Datasource to create

  • $env arrayThe environment variables from the Frontend class which includes any params set by Symphony or Events or by other Datasources

static array listAll()

Finds all available Datasources by searching the data-sources folder in the workspace and in all installed extension folders. Returns an associative array of data sources.

Returns

Associative array of Datasources with the key being the handle of the Datasource and the value being the Datasource's about() information.

See Also

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details