From be9f96e74ef96c85ef0b9c11c30f220c140ad48a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 17 Nov 2013 17:46:48 +0100 Subject: WIP for pkgdb2 --- class/FedoraClient.php | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'class/FedoraClient.php') diff --git a/class/FedoraClient.php b/class/FedoraClient.php index 62f8eac..7aa2bbb 100644 --- a/class/FedoraClient.php +++ b/class/FedoraClient.php @@ -42,7 +42,7 @@ require_once 'Cache/Lite.php'; abstract class FedoraClient { - const VERSION='0.1.0-dev'; + const VERSION='0.2.0-dev'; protected $url; private $_agent; private $_debug = 0; @@ -60,18 +60,30 @@ abstract class FedoraClient ) ); - $this->url = $url; + if (isset($options['debug']) && intval($options['debug'])>0) { + $this->_debug = intval($options['debug']); + } + + $this->setUrl($url); + if (isset($options['agent']) && !empty($options['agent'])) { $this->_agent = $options['agent']; } else { $this->_agent = 'Fedora PHPClient/'.self::VERSION; } - if (isset($options['debug']) && intval($options['debug'])>0) { - $this->_debug = intval($options['debug']); - } + + $this->logDebug( + 3, + __CLASS__."::".__FUNCTION__.": agent='".$this->_agent."'" + ); + } + + function setUrl($url) + { + $this->url = $url; $this->logDebug( 3, - __CLASS__."::".__FUNCTION__.": url='$url', agent='".$this->_agent."'" + __CLASS__."::".__FUNCTION__.": url='$url'" ); } @@ -161,4 +173,3 @@ abstract class FedoraClient } } -?> \ No newline at end of file -- cgit