{"action":"created","comment":{"url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/pulls/comments/86942103","pull_request_review_id":7573179,"id":86942103,"diff_hunk":"@@ -0,0 +1,281 @@\n+<?php\n+\n+namespace OSS\\Tests;\n+\n+require_once __DIR__ . '/Common.php';\n+\n+use OSS\\OssClient;\n+use OSS\\Model\\LiveChannelConfig;\n+use OSS\\Model\\LiveChannelInfo;\n+use OSS\\Model\\LiveChannelListInfo;\n+use OSS\\Core\\OssException;\n+\n+class BucketLiveChannelTest extends \\PHPUnit_Framework_TestCase\n+{\n+    private $bucketName;\n+    private $client;\n+\n+    public function setUp()\n+    {\n+        $this->client = Common::getOssClient();\n+        $this->bucketName = 'php-sdk-test-bucket-name-' . strval(rand(0, 10));\n+        $this->client->createBucket($this->bucketName);\n+        Common::waitMetaSync();\n+        sleep(30);\n+    }\n+\n+    public function tearDown()\n+    {\n+    ////to delete created bucket\n+    //1. delele live channel\n+        $list = $this->client->listBucketLiveChannels($this->bucketName);\n+        if (count($list->getChannelList()) != 0)\n+        {\n+            foreach($list->getChannelList() as $list)\n+            {\n+                $this->client->deleteBucketLiveChannel($this->bucketName, $list->getName());\n+            }\n+        }\n+    //2. delete exsited object\n+        $prefix = 'live-test/';\n+        $delimiter = '/';\n+        $nextMarker = '';\n+        $maxkeys = 1000;\n+        $options = array(\n+            'delimiter' => $delimiter,\n+            'prefix' => $prefix,\n+            'max-keys' => $maxkeys,\n+            'marker' => $nextMarker,\n+        );\n+\n+        try {\n+            $listObjectInfo = $this->client->listObjects($this->bucketName, $options);\n+        } catch (OssException $e) {\n+            printf($e->getMessage() . \"\\n\");\n+            return;\n+        }\n+\n+        $objectList = $listObjectInfo->getObjectList(); // 文件列表\n+        if (!empty($objectList))\n+        {   \n+            foreach($objectList as $objectInfo)\n+                $this->client->deleteObject($this->bucketName, $objectInfo->getKey());     \n+        }\n+    //3. delete the bucket\n+        $this->client->deleteBucket($this->bucketName);\n+    }\n+\n+    public function testPutLiveChannel()\n+    {\n+        $config = new LiveChannelConfig(array(","path":"tests/OSS/Tests/BucketLiveChannelTest.php","position":70,"original_position":70,"commit_id":"8b47f1e238130ac8c797149f58193384223b468f","original_commit_id":"80c1a1245a8b86a3b96ac9a12bf9829975834a07","user":{"login":"mars-coder","id":17476119,"avatar_url":"https://avatars.githubusercontent.com/u/17476119?v=3","gravatar_id":"","url":"https://api.github.com/users/mars-coder","html_url":"https://github.com/mars-coder","followers_url":"https://api.github.com/users/mars-coder/followers","following_url":"https://api.github.com/users/mars-coder/following{/other_user}","gists_url":"https://api.github.com/users/mars-coder/gists{/gist_id}","starred_url":"https://api.github.com/users/mars-coder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mars-coder/subscriptions","organizations_url":"https://api.github.com/users/mars-coder/orgs","repos_url":"https://api.github.com/users/mars-coder/repos","events_url":"https://api.github.com/users/mars-coder/events{/privacy}","received_events_url":"https://api.github.com/users/mars-coder/received_events","type":"User","site_admin":false},"body":"测试","created_at":"2016-11-08T08:25:13Z","updated_at":"2016-11-08T08:25:13Z","html_url":"https://github.com/aliyun/aliyun-oss-php-sdk/pull/18#discussion_r86942103","pull_request_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/pulls/comments/86942103"},"html":{"href":"https://github.com/aliyun/aliyun-oss-php-sdk/pull/18#discussion_r86942103"},"pull_request":{"href":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/pulls/18","id":62035613,"html_url":"https://github.com/aliyun/aliyun-oss-php-sdk/pull/18","diff_url":"https://github.com/aliyun/aliyun-oss-php-sdk/pull/18.diff","patch_url":"https://github.com/aliyun/aliyun-oss-php-sdk/pull/18.patch","issue_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/issues/18","number":18,"state":"open","locked":false,"title":"Add live channel API","user":{"login":"rockuw","id":1209779,"avatar_url":"https://avatars.githubusercontent.com/u/1209779?v=3","gravatar_id":"","url":"https://api.github.com/users/rockuw","html_url":"https://github.com/rockuw","followers_url":"https://api.github.com/users/rockuw/followers","following_url":"https://api.github.com/users/rockuw/following{/other_user}","gists_url":"https://api.github.com/users/rockuw/gists{/gist_id}","starred_url":"https://api.github.com/users/rockuw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rockuw/subscriptions","organizations_url":"https://api.github.com/users/rockuw/orgs","repos_url":"https://api.github.com/users/rockuw/repos","events_url":"https://api.github.com/users/rockuw/events{/privacy}","received_events_url":"https://api.github.com/users/rockuw/received_events","type":"User","site_admin":false},"body":"TODO:\n1. Complete API\n   - Put status\n   - Get status\n   - Get Info\n2. Code review\n","created_at":"2016-03-08T07:43:54Z","updated_at":"2016-11-08T08:25:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"083af3a029337240fa90f73a18e5d92c59a84cba","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/pulls/18/commits","review_comments_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/pulls/18/comments","review_comment_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/issues/18/comments","statuses_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/statuses/8b47f1e238130ac8c797149f58193384223b468f","head":{"label":"aliyun:live-channel","ref":"live-channel","sha":"8b47f1e238130ac8c797149f58193384223b468f","user":{"login":"aliyun","id":941070,"avatar_url":"https://avatars.githubusercontent.com/u/941070?v=3","gravatar_id":"","url":"https://api.github.com/users/aliyun","html_url":"https://github.com/aliyun","followers_url":"https://api.github.com/users/aliyun/followers","following_url":"https://api.github.com/users/aliyun/following{/other_user}","gists_url":"https://api.github.com/users/aliyun/gists{/gist_id}","starred_url":"https://api.github.com/users/aliyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliyun/subscriptions","organizations_url":"https://api.github.com/users/aliyun/orgs","repos_url":"https://api.github.com/users/aliyun/repos","events_url":"https://api.github.com/users/aliyun/events{/privacy}","received_events_url":"https://api.github.com/users/aliyun/received_events","type":"Organization","site_admin":false},"repo":{"id":46963511,"name":"aliyun-oss-php-sdk","full_name":"aliyun/aliyun-oss-php-sdk","owner":{"login":"aliyun","id":941070,"avatar_url":"https://avatars.githubusercontent.com/u/941070?v=3","gravatar_id":"","url":"https://api.github.com/users/aliyun","html_url":"https://github.com/aliyun","followers_url":"https://api.github.com/users/aliyun/followers","following_url":"https://api.github.com/users/aliyun/following{/other_user}","gists_url":"https://api.github.com/users/aliyun/gists{/gist_id}","starred_url":"https://api.github.com/users/aliyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliyun/subscriptions","organizations_url":"https://api.github.com/users/aliyun/orgs","repos_url":"https://api.github.com/users/aliyun/repos","events_url":"https://api.github.com/users/aliyun/events{/privacy}","received_events_url":"https://api.github.com/users/aliyun/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aliyun/aliyun-oss-php-sdk","description":"Aliyun OSS SDK for PHP","fork":false,"url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk","forks_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/forks","keys_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/teams","hooks_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/hooks","issue_events_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/events","assignees_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/tags","blobs_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/languages","stargazers_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/stargazers","contributors_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/contributors","subscribers_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/subscribers","subscription_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/subscription","commits_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/merges","archive_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/downloads","issues_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/labels{/name}","releases_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/deployments","created_at":"2015-11-27T06:27:28Z","updated_at":"2016-11-08T02:01:02Z","pushed_at":"2016-11-08T06:41:58Z","git_url":"git://github.com/aliyun/aliyun-oss-php-sdk.git","ssh_url":"git@github.com:aliyun/aliyun-oss-php-sdk.git","clone_url":"https://github.com/aliyun/aliyun-oss-php-sdk.git","svn_url":"https://github.com/aliyun/aliyun-oss-php-sdk","homepage":"","size":1140,"stargazers_count":126,"watchers_count":126,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":6,"forks":65,"open_issues":6,"watchers":126,"default_branch":"master"}},"base":{"label":"aliyun:master","ref":"master","sha":"8b7199230e53a50044a674c68fcbeb6b5893f6c2","user":{"login":"aliyun","id":941070,"avatar_url":"https://avatars.githubusercontent.com/u/941070?v=3","gravatar_id":"","url":"https://api.github.com/users/aliyun","html_url":"https://github.com/aliyun","followers_url":"https://api.github.com/users/aliyun/followers","following_url":"https://api.github.com/users/aliyun/following{/other_user}","gists_url":"https://api.github.com/users/aliyun/gists{/gist_id}","starred_url":"https://api.github.com/users/aliyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliyun/subscriptions","organizations_url":"https://api.github.com/users/aliyun/orgs","repos_url":"https://api.github.com/users/aliyun/repos","events_url":"https://api.github.com/users/aliyun/events{/privacy}","received_events_url":"https://api.github.com/users/aliyun/received_events","type":"Organization","site_admin":false},"repo":{"id":46963511,"name":"aliyun-oss-php-sdk","full_name":"aliyun/aliyun-oss-php-sdk","owner":{"login":"aliyun","id":941070,"avatar_url":"https://avatars.githubusercontent.com/u/941070?v=3","gravatar_id":"","url":"https://api.github.com/users/aliyun","html_url":"https://github.com/aliyun","followers_url":"https://api.github.com/users/aliyun/followers","following_url":"https://api.github.com/users/aliyun/following{/other_user}","gists_url":"https://api.github.com/users/aliyun/gists{/gist_id}","starred_url":"https://api.github.com/users/aliyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliyun/subscriptions","organizations_url":"https://api.github.com/users/aliyun/orgs","repos_url":"https://api.github.com/users/aliyun/repos","events_url":"https://api.github.com/users/aliyun/events{/privacy}","received_events_url":"https://api.github.com/users/aliyun/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aliyun/aliyun-oss-php-sdk","description":"Aliyun OSS SDK for PHP","fork":false,"url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk","forks_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/forks","keys_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/teams","hooks_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/hooks","issue_events_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/events","assignees_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/tags","blobs_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/languages","stargazers_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/stargazers","contributors_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/contributors","subscribers_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/subscribers","subscription_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/subscription","commits_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/merges","archive_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/downloads","issues_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/labels{/name}","releases_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/deployments","created_at":"2015-11-27T06:27:28Z","updated_at":"2016-11-08T02:01:02Z","pushed_at":"2016-11-08T06:41:58Z","git_url":"git://github.com/aliyun/aliyun-oss-php-sdk.git","ssh_url":"git@github.com:aliyun/aliyun-oss-php-sdk.git","clone_url":"https://github.com/aliyun/aliyun-oss-php-sdk.git","svn_url":"https://github.com/aliyun/aliyun-oss-php-sdk","homepage":"","size":1140,"stargazers_count":126,"watchers_count":126,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":6,"forks":65,"open_issues":6,"watchers":126,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/pulls/18"},"html":{"href":"https://github.com/aliyun/aliyun-oss-php-sdk/pull/18"},"issue":{"href":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/issues/18"},"comments":{"href":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/statuses/8b47f1e238130ac8c797149f58193384223b468f"}}}}
{"actor":{"display_login":"mars-coder"}}