2.1.1releasedRemote Datasource

A datasource that consumes XML, JSON, CSV or TEXT content.

Clone URLhttps://github.com/symphonycms/remote_datasource.git

Add as a submodulegit submodule add https://github.com/symphonycms/remote_datasource.git extensions/remote_datasource --recursive

Compatibility

2.0.02.0.32.0.42.0.52.0.62.0.72.1.02.1.12.1.22.2.02.2.12.2.22.2.32.2.42.2.52.3.02.3.12.3.22.3.32.3.42.3.52.3.62.4.02.5.02.5.1
NoNoNoNoNoNoNoNoNoNoNoNoNoNoNo1.1.01.1.01.1.01.1.01.1.01.1.01.1.02.1.1NoNo. Soon?

Readme

Remote Datasource

Version 2.1

The Remote Datasource allows you to consume XML, JSON, CSV and TXT sources in Symphony. This extension aims to build upon the Dynamic XML datasource functionality provided in Symphony to allow better cache control, the automatic discovery of namespaces and more flexibility.

Installation

  1. Install this extension by copying /remote_datasource folder to your /extensions folder. Then navigate to the System > Extensions page in the Symphony backend page, select the Remote Datasource extension and then apply the "Enable/Install".

  2. Create a new Remote Datasource via the Datasource Editor, choosing Remote Datasource from the Source dropdown (it's under __From extensions)

API

If you need to add custom php code in your Data Source, there is two methods that you can override in your DataSource sub-class:

````php /** * This methods allows custom remote data source to set other * properties on the HTTP gateway, like Authentication or other * parameters. This method is call just before the exec method. * * @param Gateway $gateway * the Gateway object that will be use for the current HTTP request * passed by reference */ public static function prepareGateway(&$gateway) {}

/** * This methods allows custom remote data source to read the returned * data before it becomes only available in the XML. * * @since Remote Datasource 2.0 * @param string $data * the parsed xml string data returned by the Gateway by reference */ public function exposeData(&$data) {}

/** * This method is called when their is an http error * or when content type is unsupported * * @since Remote Datasource 2.0 * @param array $info * info of the http request */ public function httpError(&$info) {} ````

Version history

Requires Symphony 2.4

  • Expose the CURL error via httpError()
  • Fix error with CSV importing

Requires Symphony 2.4

  • Add support for text format (a copy of the html response body)
  • Add some documentation

Requires Symphony 2.4

  • Clean-up

Requires Symphony 2.4

  • Add support for Symphony 2.4
  • Support CSV data format
  • Allow $gateway to be manipulated and $data to previewed
  • When the Datasource fails, data is added to the ?debug page to assist in debugging
  • Allow no cache to be set
  • Sanitize XPath to allow for more complex queries

Symphony 2.3 to 2.4

  • Officially release the extension
  • Add url to the resulting XML result so you can see what URL was actually fetched
  • Fix bug where a result would always be stale
  • Allow timeout to be user configurable in the Data Source Editor
  • Various PHP E_NOTICE fixes

Requires Symphony 2.3

  • Initial release