Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/symphonycms/remote_datasource
An improved datasource to fetch data from TXT, CSV, XML and JSON sources.
https://github.com/symphonycms/remote_datasource
symphony-cms symphony-cms-extension
Last synced: 11 days ago
JSON representation
An improved datasource to fetch data from TXT, CSV, XML and JSON sources.
- Host: GitHub
- URL: https://github.com/symphonycms/remote_datasource
- Owner: symphonycms
- License: other
- Created: 2012-03-10T14:16:22.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2020-02-21T22:38:21.000Z (over 4 years ago)
- Last Synced: 2024-03-25T22:02:27.079Z (8 months ago)
- Topics: symphony-cms, symphony-cms-extension
- Language: PHP
- Homepage:
- Size: 101 KB
- Stars: 14
- Watchers: 13
- Forks: 9
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Remote Datasource
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) {}
````