Active
Project:
Eve Online HTTP Tools
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Jan 2011 at 12:55 UTC
Updated:
6 Jan 2011 at 12:55 UTC
I suggest revising the eveRequest class as follows:
class eveRequest {
// User Data
protected $userID = NULL;
protected $apiKey = NULL;
protected $isFullKey = NULL; // Added
// Api method
protected $requestURI = NULL;
protected $fullKeyRequired = NULL; // Added
private $baseURI = 'http://api.eve-online.com/';
// Post request data
protected $data = NULL; // Changed to protected
private $cachedUntil = NULL;
private $currentTime = NULL;
public function __construct($userID, $apiKey, $reqURI, $fullRequired) {
$this->userID = $userID;
$this->apiKey = $apiKey;
$this->$requestURI = ( isNull($reqURI) ? NULL : $reqURI ); // Added
$this->$fullKeyRequired = ( isNull($fullRequired) ? false : $fullRequired ); // Added
}
$isFullKey and $fullKeyRequired are added to accomodate requests that require a full API key rather than a limited one.
$data is changed to protected as derived child classes will need ready access to it
__construct() had 2 additional arguments added permitting the type of request to be established on object creation.
These changes seem advisable because of the wealth of child classes that may be derived from this simple class. See this page for examples.