PHP library to communicate with API
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Dreamstar Cash encoding library for API services

A PHP library that contains a number of classes to allow the use of the [API provided by] ( The library comes in two parts:

*Encoder (library/EncoderApi.php) 
*Responder (library/Responder.php)


The encoder simply allows the user to specify the source video and the destination video along with the required format. The API will respond and if all is well, will provide a media id which can be used as a local reference to store updates later on.

The encoder reads configuration data required to use the API including the userid and password. This information is provided by once you have an account.


When making the initial request with the responder, there is an option to specify an notify url. When the request has completed or when there is an update from, they will hit the url you have specified with update information. This is handled by the Responder class.

Currently this only provides information about AddMedia requests.

The responder will update the local entry based on the media id saved beforehand from the encoder.


Currently the library expects mysql to be used to store data using the following schema:

    CREATE TABLE queue(
        int media_id, 
        text source, 
        text destination, 
        int priority, 
        varchar(20) status


Make a copy of the config.yml.default file and call it config.yml. With the user credentials provided by change the values inside <...> brackets. This needs to be done before attempting to use the library.

Example Usage


    // set up the configuration object

    $conf_ob = new Configuration();
    $config = $conf_ob->getConfiguration();

    // set up the http client

    $url = $config['xml_data']['api_url'];
    $http_client = new Zend_Http_Client($url, $settings);

    // create an instance of the encoder

    $encoder = new Encoder($conf, $http_client, $db);
    $response = $encoder->requestEncoding('some/source', 'some/destination', 'priority');