1
1
<?php namespace Scriptotek \Sru ;
2
2
3
- use Danmichaelo \QuiteSimpleXMLElement \QuiteSimpleXMLElement ;
4
3
use \Guzzle \Http \Client as HttpClient ;
5
4
5
+ /**
6
+ * SRU client
7
+ */
6
8
class Client {
7
9
10
+ /** @var HttpClient */
8
11
protected $ httpClient ;
12
+
13
+ /** @var string SRU service base URL */
9
14
protected $ url ;
15
+
16
+ /** @var string Requested schema for the returned records */
10
17
protected $ schema ;
11
- protected $ namespaces ;
18
+
19
+ /** @var string SRU protocol version */
12
20
protected $ version ;
21
+
22
+ /** @var string Some user agent string to identify our client */
13
23
protected $ userAgent ;
14
24
15
25
/**
16
- * Proxy: Either a string or an array:
17
- * - '127.0.0.1:3128'
18
- * - array( '127.0.0.1:3128', 'my_username', 'my_password' )
26
+ * @var string|string[] Proxy configuration details.
27
+ *
28
+ * Either a string 'host:port' or an
29
+ * array('host:port', 'username', 'password').
19
30
*/
20
31
protected $ proxy ;
21
32
22
33
/**
23
- * array( username, password)
34
+ * @var string[] Array containing username and password
24
35
*/
25
36
protected $ credentials ;
26
37
27
38
/**
28
39
* Create a new client
29
40
*
30
- * @param string $url
41
+ * @param string $url Base URL to the SRU service
31
42
* @param array $options Associative array of options
32
- * @param Guzzle\Http\Client $httpClient
43
+ * @param HttpClient $httpClient
33
44
*/
34
45
public function __construct ($ url , $ options = null , $ httpClient = null )
35
46
{
@@ -69,9 +80,9 @@ public function __construct($url, $options = null, $httpClient = null)
69
80
/**
70
81
* Construct the URL for a CQL query
71
82
*
72
- * @param string $cql
83
+ * @param string $cql The CQL query
73
84
* @param int $start Start value in result set (optional)
74
- * @param count $count Number of records to request (optional)
85
+ * @param int $count Number of records to request (optional)
75
86
* @return string
76
87
*/
77
88
public function urlTo ($ cql , $ start = 1 , $ count = 10 )
@@ -98,8 +109,8 @@ public function urlTo($cql, $start = 1, $count = 10)
98
109
*
99
110
* @param string $cql
100
111
* @param int $start Start value in result set (optional)
101
- * @param count $count Number of records to request (optional)
102
- * @return QuiteSimpleXMLElement
112
+ * @param int $count Number of records to request (optional)
113
+ * @return Response
103
114
*/
104
115
public function search ($ cql , $ start = 1 , $ count = 10 ) {
105
116
0 commit comments