diff options
author | Karl Vollmer <vollmer@ampache.org> | 2011-11-23 15:59:41 -0400 |
---|---|---|
committer | Karl Vollmer <vollmer@ampache.org> | 2011-11-23 15:59:41 -0400 |
commit | 8fbbe64e8ff9b0f9b598a397f3ad9b256331e978 (patch) | |
tree | 5f84bb83ab906caa46aab802a4fd0f7796268ccf /modules | |
parent | d02561c96c6b2dc0e9c22355e39d376a3a7b5b8a (diff) | |
download | ampache-8fbbe64e8ff9b0f9b598a397f3ad9b256331e978.tar.gz ampache-8fbbe64e8ff9b0f9b598a397f3ad9b256331e978.tar.bz2 ampache-8fbbe64e8ff9b0f9b598a397f3ad9b256331e978.zip |
AmpacheApi -- Store handshake information
Catalog -- pull handshake info, do something with it?
Diffstat (limited to 'modules')
-rw-r--r-- | modules/ampacheapi/AmpacheApi.lib.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/ampacheapi/AmpacheApi.lib.php b/modules/ampacheapi/AmpacheApi.lib.php index c234eb19..5f34170d 100644 --- a/modules/ampacheapi/AmpacheApi.lib.php +++ b/modules/ampacheapi/AmpacheApi.lib.php @@ -28,6 +28,10 @@ class AmpacheApi { private $password; private $api_secure; + // Handshake variables + private $handshake; + private $handshake_time; // Used to figure out how stale our data is + // Response variables private $api_session; @@ -93,6 +97,10 @@ class AmpacheApi { $results = array_shift($this->get_response()); $this->api_auth = $results['auth']; + // Define when we pulled this, it is not wine, it does + // not get better with age + $this->handshake_time = time(); + $this->handshake = $results; } // connect @@ -161,6 +169,22 @@ class AmpacheApi { } // state /** + * info + * Returns the information gathered by the handshake + * not raw so we can formated it if we wanted? + */ + public function info() { + + if ($this->state() != 'READY') { + trigger_error('AmpacheApi::info API in non-ready state, unable to return info'); + return false; + } + + return $this->handshake; + + } // info + + /** * send_command * This sends an API command, with options to the currently connected * host, and returns a nice clean keyed array |