46 |
50 |
51 |
52 |
53 |
54 |
55 |
57 | -
58 | global
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/docs/phpdoc-cache-2e/phpdoc-cache-settings.dat:
--------------------------------------------------------------------------------
1 | O:51:"phpDocumentor\Descriptor\ProjectDescriptor\Settings":2:{s:13:" * isModified";b:0;s:13:" * visibility";i:7;}
--------------------------------------------------------------------------------
/docs/phpdoc-cache-34/phpdoc-cache-file_6313c8684ed97495cd6c85612f310684.dat:
--------------------------------------------------------------------------------
1 | O:39:"phpDocumentor\Descriptor\FileDescriptor":22:{s:7:" * hash";s:32:"81d12c119bc415e1d2c2b3530087d899";s:7:" * path";s:30:"Models/ListConfigsResponse.php";s:9:" * source";s:974:"size = $resp['total'];
28 | $this->configs = $resp['configs'];
29 | }
30 |
31 | public function getSize(){
32 | return count($this->configs)
33 | }
34 |
35 | public function getTotal(){
36 | return $this ->total;
37 | }
38 |
39 | public function getConfigs(){
40 | return $this->configs;
41 | }
42 |
43 |
44 | }
45 | ";s:19:" * namespaceAliases";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:11:" * includes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:12:" * constants";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:12:" * functions";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:10:" * classes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:13:" * interfaces";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:9:" * traits";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:10:" * markers";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}s:8:" * fqsen";s:0:"";s:7:" * name";s:23:"ListConfigsResponse.php";s:12:" * namespace";N;s:10:" * package";s:11:"LOG_PHP_SDK";s:10:" * summary";s:0:"";s:14:" * description";s:0:"";s:17:" * fileDescriptor";N;s:7:" * line";i:0;s:7:" * tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:2:{s:7:"package";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:38:"phpDocumentor\Descriptor\TagDescriptor":3:{s:7:" * name";s:7:"package";s:14:" * description";s:11:"LOG_PHP_SDK";s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}}s:10:"subpackage";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:0:{}}}}s:9:" * errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:" * items";a:1:{i:0;O:40:"phpDocumentor\Descriptor\Validator\Error":4:{s:11:" * severity";s:5:"error";s:7:" * code";s:13:"PPC:ERR-50000";s:7:" * line";i:0;s:10:" * context";a:2:{s:11:"{{ value }}";s:2:"""";i:0;s:0:"";}}}}s:19:" * inheritedElement";N;}
--------------------------------------------------------------------------------
/sample/credentialsProviderSample.php:
--------------------------------------------------------------------------------
1 | 'TestContent',
24 | 'kv_json' => '{"a": "b", "c": 19021}'
25 | );
26 | $logItem = new Aliyun_Log_Models_LogItem();
27 | $logItem->setTime(time());
28 | $logItem->setContents($contents);
29 | $logitems = array($logItem);
30 | $request = new Aliyun_Log_Models_PutLogsRequest(
31 | $project,
32 | $logstore,
33 | $topic,
34 | null,
35 | $logitems
36 | );
37 |
38 | try {
39 | $response = $client->putLogs($request);
40 | } catch (Aliyun_Log_Exception $ex) {
41 | var_dump($ex);
42 | } catch (Exception $ex) {
43 | var_dump($ex);
44 | }
45 | }
46 |
47 | putLogs($client, $project, $logstore);
48 | $res = $client->getLogs($req);
49 | var_dump($res->getLogs());
50 |
--------------------------------------------------------------------------------
/tests/EndpointTest.php:
--------------------------------------------------------------------------------
1 | assertEquals($this->getUrl('https://cn-hangzhou.log.aliyuncs.com', 'test', '/', array()), 'https://test.cn-hangzhou.log.aliyuncs.com/');
10 | $this->assertEquals($this->getUrl('cn-hangzhou.log.aliyuncs.com', 'test', '/', array()), 'http://test.cn-hangzhou.log.aliyuncs.com/');
11 | $this->assertEquals($this->getUrl('http://cn-hangzhou.log.aliyuncs.com', 'test', '/logstores', array()), 'http://test.cn-hangzhou.log.aliyuncs.com/logstores');
12 | $this->assertEquals($this->getUrl('https://cn-hangzhou.log.aliyuncs.com:443', 'test', '/logstores', array()), 'https://test.cn-hangzhou.log.aliyuncs.com:443/logstores');
13 | $this->assertEquals($this->getUrl('https://111.111.111.111:80', 'test', '/logstores', array()), 'https://111.111.111.111:80/logstores');
14 | $this->assertEquals($this->getUrl('111.111.111.111:442', 'test', '/test', array()), 'http://111.111.111.111:442/test');
15 | $this->assertEquals($this->getUrl('111.111.111.111:442', null, '/test', array()), 'http://111.111.111.111:442/test');
16 | $this->assertEquals($this->getUrl('http://111.111.111.111:442', 'test', '/cursor', array('type' => 'cursor')), 'http://111.111.111.111:442/cursor?type=cursor');
17 | $this->assertEquals($this->getUrl('https://cn-hangzhou.log.aliyuncs.com', null, '/cursor', array('type' => 'cursor')), 'https://cn-hangzhou.log.aliyuncs.com/cursor?type=cursor');
18 | $this->assertEquals($this->getUrl('cn-hangzhou.log.aliyuncs.com', null, '/', array()), 'http://cn-hangzhou.log.aliyuncs.com/');
19 | }
20 |
21 | public function getUrl($endpoint, $project, $resource, $params) {
22 | $accessKeyId = 'testKey';
23 | $accessKey = 'testAccessKey';
24 | $client = new Aliyun_Log_Client($endpoint, $accessKeyId, $accessKey);
25 | $reflection = new ReflectionClass($client);
26 | $method = $reflection->getMethod('buildUrl');
27 | $method->setAccessible(true);
28 | return $method->invokeArgs($client, [$project, $resource, $params]);
29 | }
30 | }
--------------------------------------------------------------------------------