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

Commit

Permalink
Bump to v.2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dugjason committed Nov 4, 2015
1 parent 6fd2599 commit eba8bfd
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 51 deletions.
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
54 changes: 27 additions & 27 deletions lib/DataSift/User.php
Expand Up @@ -27,7 +27,7 @@
*/
class DataSift_User
{
const USER_AGENT = 'DataSiftPHP/2.4.1';
const USER_AGENT = 'DataSiftPHP/2.5.0';

/**
* @var string The api url of the user.
Expand Down Expand Up @@ -97,39 +97,39 @@ class DataSift_User
* @throws DataSift_Exception_InvalidData
*/
public function __construct(
$username,
$api_key,
$use_ssl = true,
$debug_mode = false,
$username,
$api_key,
$use_ssl = true,
$debug_mode = false,
$api_url = false,
$api_version = false,
$stream_url = false,
$ingest_url = false
){
){
if (strlen(trim($username)) == 0) {
throw new DataSift_Exception_InvalidData('Please supply valid credentials when creating a DataSift_User object.');
}

if (strlen(trim($api_key)) == 0) {
throw new DataSift_Exception_InvalidData('Please supply valid credentials when creating a DataSift_User object.');
}

if ($api_url) {
$this->_api_url = $api_url;
}

if ($api_version) {
$this->_api_version = $api_version;
}

if ($stream_url) {
$this->_stream_url = $stream_url;
}

if ($ingest_url) {
$this->_ingest_url = $ingest_url;
}

$this->_username = $username;
$this->_api_key = $api_key;
$this->_use_ssl = $use_ssl;
Expand All @@ -138,7 +138,7 @@ public function __construct(

/**
* setApiVersion
*
*
* @param string $version
* @return string
*/
Expand All @@ -149,7 +149,7 @@ public function setApiVersion($version)

/**
* getApiVersion
*
*
* @return string
*/
public function getApiVersion()
Expand All @@ -170,7 +170,7 @@ public function setApiClient($api_client)
if (!class_exists($api_client) || !method_exists($api_client, 'call')) {
throw new DataSift_Exception_InvalidData('Class "'.$api_client.'" does not exist');
}

$this->_api_client = $api_client;
}

Expand Down Expand Up @@ -386,10 +386,10 @@ public function getPushSubscription($id)
* @throws DataSift_Exception_AccessDenied
*/
public function listPushSubscriptions(
$page = 1,
$per_page = 100,
$order_by = DataSift_Push_Subscription::ORDERBY_CREATED_AT,
$order_dir = DataSift_Push_Subscription::ORDERDIR_ASC,
$page = 1,
$per_page = 100,
$order_by = DataSift_Push_Subscription::ORDERBY_CREATED_AT,
$order_dir = DataSift_Push_Subscription::ORDERDIR_ASC,
$include_finished = false
) {
return DataSift_Push_Subscription::listSubscriptions($this, $page, $per_page, $order_by, $order_dir, $include_finished);
Expand All @@ -409,9 +409,9 @@ public function listPushSubscriptions(
* @throws DataSift_Exception_APIError
*/
public function getPushSubscriptionLogs(
$page = 1,
$per_page = 100,
$order_by = DataSift_Push_Subscription::ORDERBY_REQUEST_TIME,
$page = 1,
$per_page = 100,
$order_by = DataSift_Push_Subscription::ORDERBY_REQUEST_TIME,
$order_dir = DataSift_Push_Subscription::ORDERDIR_DESC
) {
return DataSift_Push_Subscription::getLogs($this, $page, $per_page, $order_by, $order_dir);
Expand Down Expand Up @@ -460,22 +460,22 @@ public function getIngestUrl()

/**
* getLastResponse
*
*
* @return array
* @throws Exception
*/
public function getLastResponse()
{
{
if (!$this->_debug) {
throw new Exception("Datasift user object must be set to debug mode to use this method", 1);
}

return $this->_last_response;
}

/**
* setLastResponse
*
*
* @param array $last_response
* @throws Exception
*/
Expand All @@ -484,13 +484,13 @@ public function setLastResponse($last_response)
if (!$this->_debug) {
throw new Exception("Datasift user object must be set to debug mode to use this method", 1);
}

$this->_last_response = $last_response;
}

/**
* getDebug
*
*
* @return boolean
*/
public function getDebug()
Expand All @@ -499,7 +499,7 @@ public function getDebug()
}

private function handleResponse($res)
{
{
$retval = array();
switch ($res['response_code']) {
case 200:
Expand Down Expand Up @@ -554,7 +554,7 @@ private function handleResponse($res)
* @throws DataSift_Exception_RateLimitExceeded
*/
public function post($endpoint, $params = array(), $headers = array(), $ingest = false)
{
{
$res = call_user_func(
array($this->_api_client, 'call'),
$this,
Expand Down

0 comments on commit eba8bfd

Please sign in to comment.