Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/2.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dugjason committed Nov 20, 2015
2 parents 640b732 + 4a6df77 commit 4a48a9d
Show file tree
Hide file tree
Showing 10 changed files with 285 additions and 138 deletions.
16 changes: 13 additions & 3 deletions .travis.yml
@@ -1,8 +1,18 @@
language: php

sudo: false

php:
- 5.6
- 5.5
- 5.4
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm

matrix:
allow_failures:
- php: 7.0
- php: hhvm

script: phpunit tests/
55 changes: 31 additions & 24 deletions CHANGELOG.md
@@ -1,5 +1,12 @@
Changelog
=========================
## v.2.5.0
### Added
* Support for the [/pylon/sample API endpoint](http://dev.datasift.com/pylon/docs/api/pylon-api-endpoints/pylonsample)

### Changed
* Added PHP7 and HHVM to Travis

##v.2.4.1
###Fixed
* Fixed being able to search for identities by label
Expand All @@ -8,29 +15,29 @@ Changelog
###Added
* Support for Open Data Processing

##v.2.3.0
##v.2.3.0
### Added
* ```The DataSift_Pylon::getAll()``` method now returns a raw response
* ```DataSift_Pylon::find``` and ```DataSift_Pylon::findAll``` methods added

##v.2.2.2
##v.2.2.2
### Added
* Upgraded the API version to 1.2

### Removed
* Removed some obsolete files.

##v.2.2.0
### Added
##v.2.2.0
### Added
* Support for PYLON
* CLI has been added for testing purposes along with some changes to the API client.

##v.2.1.8
### Added
##v.2.1.8
### Added
* Support for ```pull```, ```historics/pause```, ```historics/resume```, ```source/add```, ```source/remove``` and ```source/log```.

##v.2.1.7 (2014-02-18)
###Added
###Added
* Composer support

###Deprecated
Expand All @@ -41,58 +48,58 @@ Changelog

##v.2.1.6 (2013-04-24)
###Fixed
* Updated autoloader to use DIRECTORY_SEPARATOR for Windows interoperability
* Updated autoloader to use DIRECTORY_SEPARATOR for Windows interoperability

##v.2.1.5 (2013-04-17)
###Fixed
* Fixed minor typo in consume-stream.php example.
* Fixed minor typo in consume-stream.php example.

##v.2.1.4 (2013-03-05)
###Added
###Added
* Addeded support for new Historics field ```estimated_completion```.

* Made API requests default to using SSL.

* Modified Historics the 'sample' param.
* Modified Historics the 'sample' param.

##v.2.1.3
###Fixed
##v.2.1.3
###Fixed
* Fixed reconnect issue from server-side disconnects.

##v.2.1.2 (2012-12-04)
###Fixed
* Fixed missing 'sample' param from ```historics/prepare``` calls.
###Fixed
* Fixed missing 'sample' param from ```historics/prepare``` calls.

##v.2.1.1
###Fixed
##v.2.1.1
###Fixed
* Fixed issue #10 "Bug in api" by @salehsed

* Fixed syntax error in tests/testdata.php

##v.2.1.0 (2012-08-17)
###Added
* Added support for Historics and Push delivery.
###Added
* Added support for Historics and Push delivery.

##v.2.0.0
###Added
* Added SSL support for streams. (2012-06-18)
* Consumers no longer take functions for event handling. Instead you define a class that implements the ```DataSift_IStreamConsumerEventHandler``` interface and pass an instance of that.
* Consumers no longer take functions for event handling. Instead you define a class that implements the ```DataSift_IStreamConsumerEventHandler``` interface and pass an instance of that.
* In addition to switching to an object-based event handler we have also introduced the following new events: ```onConnect```, ```onDisconnect``` and ```onStatus```.
* Added the develop branch as required by git flow (2012-05-24)
###Changed

###Changed
* Changed event handling to an object instead of functions.
* SSL is enabled by default and can be disabled by passing false as the third parameter to the User constructor, or calling enableSSL(false) on the User object.

##v.1.3.0
##v.1.3.0
### Added
* Added ```onError``` and ```onWarning``` events - see ```examples/consume-stream.php``` for an example.

### Changed
* Improved error handling (2012-03-08)
* Stopped the HTTP consumer from attempting to reconnect when it receives a 4xx response from the server.

##v.1.2.0
##v.1.2.0
### Added
* Support for multiple streams (2012-02-29)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2011-2012 MediaSift Ltd
Copyright (c) 2011-2015 MediaSift Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -86,7 +86,7 @@ creating a user, or by calling $user->enableSSL(false) on the user object.
License
-------

All code contained in this repository is Copyright 2011-2012 MediaSift Ltd.
All code contained in this repository is Copyright 2011-2015 MediaSift Ltd.

This code is released under the BSD license. Please see the LICENSE file for
more details.
Expand Down
6 changes: 3 additions & 3 deletions examples/pylon.php → examples/pylon/pylon.php
Expand Up @@ -12,10 +12,10 @@
*/

// Include the DataSift library
require dirname(__FILE__) . '/../lib/datasift.php';
require dirname(__FILE__) . '/../../lib/datasift.php';

// Include the configuration - put your username and API key in this file
require dirname(__FILE__) . '/../config.php';
require dirname(__FILE__) . '/../../config.php';

// Authenticate
echo "Creating user...\n";
Expand All @@ -38,7 +38,7 @@
//Add CSDL to the PYLON
$pylon->setCsdl($csdl);

$pylon->compile();
$pylon->compile();

//Start the pylon
$pylon->start();
Expand Down
41 changes: 41 additions & 0 deletions examples/pylon/pylonSample.php
@@ -0,0 +1,41 @@
<?php
/**
* This simple example demonstrates how to use the Pylon Sample API endpoint
*
* @category DataSift
* @package PHP-client
* @author Ryan Stanley <ryan.stanley@datasift.com>
* @copyright 2015 MediaSift Ltd.
* @license http://www.debian.org/misc/bsd.license BSD License (3 Clause)
* @link http://www.mediasift.com
*/

// Include the DataSift library
require dirname(__FILE__) . '/../../lib/datasift.php';

// Include the configuration - put your username and API key in this file
require dirname(__FILE__) . '/../../config.php';

// Authenticate
echo "Creating user...\n";
$user = new DataSift_User(USERNAME, API_KEY, false);

$filter = '(fb.content any "coffee" OR fb.hashtags in "tea") AND fb.language in "en"';

//Validate the CSDL
$validate = DataSift_Pylon::validate($user, $filter);

echo "Definition has been successfully validated, DPUs: {$validate['dpu']} created at: {$validate['created_at']} \n\n";

//Create the PYLON object and manually enter a Pylon Hash to use in the sample; you'll need to
// replace the hash below with a real PYLON hash from your own DataSift account
$pylon = new DataSift_Pylon($user, array('hash' => '1a4268c9b924d2c48ed1946d6a7e6288'));

// Setting up parameters for the /pylon/sample request
$start = 1445209200;
$end = 1445274000;
$count = 10;

$sample = $pylon->sample($filter, $start, $end, $count);

echo "Sample created successfully";

0 comments on commit 4a48a9d

Please sign in to comment.