Skip to content

Commit

Permalink
remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
baiyubin2020 committed Nov 21, 2016
1 parent 747b455 commit 7010c2f
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 52 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -3,3 +3,6 @@ composer.lock
doc
output
.idea
.buildpath
.project
.settings
31 changes: 17 additions & 14 deletions phpunit.xml
@@ -1,16 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>

<phpunit>
<filter>
<whitelist>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="coverage.xml" />
</logging>
<testsuites>
<testsuite name="FunctionTest">
<directory>./tests</directory>
<exclude>./tests/OSS/Tests/BucketCnameTest.php</exclude>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="coverage.xml" />
</logging>
<testsuites>
<testsuite name="FunctionTest">
<directory>./tests</directory>
<exclude>./tests/OSS/Tests/BucketCnameTest.php</exclude>
</testsuite>
</testsuites>
</phpunit>
14 changes: 8 additions & 6 deletions samples/Callback.php
Expand Up @@ -2,11 +2,11 @@
require_once __DIR__ . '/Common.php';

use OSS\OssClient;
use OSS\Core\OssException;

$bucket = Common::getBucketName();
$ossClient = Common::getOssClient();
if (is_null($ossClient)) exit(1);

//*******************************简单使用***************************************************************

/** putObject 使用callback上传内容到oss文件
Expand All @@ -33,6 +33,7 @@
$result = $ossClient->putObject($bucket, "b.file", "random content", $options);
Common::println($result['body']);
Common::println($result['info']['http_code']);

/**
* completeMultipartUpload 使用callback上传内容到oss文件
* callbackurl参数指定请求回调的服务器url
Expand All @@ -42,11 +43,13 @@
$object = "multipart-callback-test.txt";
$copiedObject = "multipart-callback-test.txt.copied";
$ossClient->putObject($bucket, $copiedObject, file_get_contents(__FILE__));

/**
* step 1. 初始化一个分块上传事件, 也就是初始化上传Multipart, 获取upload id
*/
$upload_id = $ossClient->initiateMultipartUpload($bucket, $object);
/*

/**
* step 2. uploadPartCopy
*/
$copyId = 1;
Expand All @@ -56,17 +59,17 @@
'ETag' => $eTag,
);
$listPartsInfo = $ossClient->listParts($bucket, $object, $upload_id);

/**
* step 3.
*/
* step 3.
*/
$json =
'{
"callbackUrl":"callback.oss-demo.com:23450",
"callbackHost":"oss-cn-hangzhou.aliyuncs.com",
"callbackBody":"{\"mimeType\":${mimeType},\"size\":${size},\"x:var1\":${x:var1},\"x:var2\":${x:var2}}",
"callbackBodyType":"application/json"
}';

$var =
'{
"x:var1":"value1",
Expand All @@ -78,4 +81,3 @@
$result = $ossClient->completeMultipartUpload($bucket, $object, $upload_id, $upload_parts, $options);
Common::println($result['body']);
Common::println($result['info']['http_code']);

5 changes: 3 additions & 2 deletions samples/Image.php
Expand Up @@ -2,14 +2,15 @@
require_once __DIR__ . '/Common.php';

use OSS\OssClient;
use OSS\Core\OssException;

$bucketName = Common::getBucketName();
$object = "example.jpg";
$ossClient = Common::getOssClient();
$download_file = "download.jpg";
if (is_null($ossClient)) exit(1);

//*******************************简单使用***************************************************************

// 先把本地的example.jpg上传到指定$bucket, 命名为$object
$ossClient->uploadFile($bucketName, $object, "example.jpg");

Expand Down Expand Up @@ -64,7 +65,7 @@


/**
生成一个带签名的可用于浏览器直接打开的url, URL的有效期是3600秒
* 生成一个带签名的可用于浏览器直接打开的url, URL的有效期是3600秒
*/
$timeout = 3600;
$options = array(
Expand Down
11 changes: 5 additions & 6 deletions samples/LiveChannel.php
Expand Up @@ -2,7 +2,6 @@
require_once __DIR__ . '/Common.php';

use OSS\OssClient;
use OSS\Core\OssException;
use OSS\Model\LiveChannelConfig;

$bucket = Common::getBucketName();
Expand Down Expand Up @@ -65,7 +64,7 @@

/**
创建好直播频道之后调用getLiveChannelInfo可以得到频道相关的信息
*/
*/
$info = $ossClient->getLiveChannelInfo($bucket, 'test_rtmp_live');
Common::println("bucket $bucket LiveChannelInfo:\n" .
"live channel info description: ". $info->getDescription() . "\n" .
Expand Down Expand Up @@ -109,9 +108,9 @@
"live channel status AdioCodec: ". $status->getAudioCodec() . "\n");

/**
如果希望利用直播推流产生的ts文件生成一个点播列表,可以使用postVodPlaylist方法。
指定起始时间为当前时间减去60秒,结束时间为当前时间,这意味着将生成一个长度为60秒的点播视频。
播放列表指定为“vod_playlist.m3u8”,也就是说这个接口调用成功之后会在OSS上生成一个名叫“vod_playlist.m3u8”的播放列表文件。
* 如果希望利用直播推流产生的ts文件生成一个点播列表,可以使用postVodPlaylist方法。
* 指定起始时间为当前时间减去60秒,结束时间为当前时间,这意味着将生成一个长度为60秒的点播视频。
* 播放列表指定为“vod_playlist.m3u8”,也就是说这个接口调用成功之后会在OSS上生成一个名叫“vod_playlist.m3u8”的播放列表文件。
*/
$current_time = time();
$ossClient->postVodPlaylist($bucket,
Expand All @@ -121,6 +120,6 @@
);

/**
如果一个直播频道已经不打算再使用了,那么可以调用delete_live_channel来删除频道。
* 如果一个直播频道已经不打算再使用了,那么可以调用delete_live_channel来删除频道。
*/
$ossClient->deleteBucketLiveChannel($bucket, "test_rtmp_live");
2 changes: 0 additions & 2 deletions src/OSS/Model/LiveChannelConfig.php
Expand Up @@ -3,8 +3,6 @@
namespace OSS\Model;


use OSS\Core\OssException;

/**
* Class LiveChannelConfig
* @package OSS\Model
Expand Down
1 change: 0 additions & 1 deletion src/OSS/Result/AclResult.php
Expand Up @@ -3,7 +3,6 @@
namespace OSS\Result;

use OSS\Core\OssException;
use OSS\Tests\OssExceptionTest;

/**
* Class AclResult getBucketAcl接口返回结果类,封装了
Expand Down
2 changes: 0 additions & 2 deletions tests/OSS/Tests/BucketCnameTest.php
Expand Up @@ -4,9 +4,7 @@

require_once __DIR__ . '/Common.php';

use OSS\OssClient;
use OSS\Model\CnameConfig;
use OSS\Core\OssException;

class BucketCnameTest extends \PHPUnit_Framework_TestCase
{
Expand Down
3 changes: 0 additions & 3 deletions tests/OSS/Tests/BucketLiveChannelTest.php
Expand Up @@ -4,10 +4,7 @@

require_once __DIR__ . '/Common.php';

use OSS\OssClient;
use OSS\Model\LiveChannelConfig;
use OSS\Model\LiveChannelInfo;
use OSS\Model\LiveChannelListInfo;
use OSS\Core\OssException;

class BucketLiveChannelTest extends \PHPUnit_Framework_TestCase
Expand Down
3 changes: 0 additions & 3 deletions tests/OSS/Tests/ContentTypeTest.php
Expand Up @@ -4,9 +4,6 @@

require_once __DIR__ . '/Common.php';

use OSS\OssClient;
use OSS\Core\OssException;

class ContentTypeTest extends \PHPUnit_Framework_TestCase
{
private function runCmd($cmd)
Expand Down
1 change: 0 additions & 1 deletion tests/OSS/Tests/LiveChannelXmlTest.php
Expand Up @@ -9,7 +9,6 @@
use OSS\Model\LiveChannelConfig;
use OSS\Model\GetLiveChannelStatus;
use OSS\Model\GetLiveChannelHistory;
use OSS\Core\OssException;

class LiveChannelXmlTest extends \PHPUnit_Framework_TestCase
{
Expand Down
3 changes: 0 additions & 3 deletions tests/OSS/Tests/ObjectAclTest.php
Expand Up @@ -4,9 +4,6 @@

require_once __DIR__ . '/Common.php';

use OSS\OssClient;
use OSS\Core\OssException;

class ObjectAclTest extends \PHPUnit_Framework_TestCase
{
public function testGetSet()
Expand Down
1 change: 0 additions & 1 deletion tests/OSS/Tests/OssClientBucketCorsTest.php
Expand Up @@ -5,7 +5,6 @@
use OSS\Core\OssException;
use OSS\Model\CorsConfig;
use OSS\Model\CorsRule;
use OSS\Core\OssUtil;
use OSS\OssClient;

require_once __DIR__ . DIRECTORY_SEPARATOR . 'TestOssClientBase.php';
Expand Down
1 change: 0 additions & 1 deletion tests/OSS/Tests/OssClientBucketTest.php
Expand Up @@ -3,7 +3,6 @@
namespace OSS\Tests;

use OSS\Core\OssException;
use OSS\Core\OssUtil;
use OSS\OssClient;

require_once __DIR__ . DIRECTORY_SEPARATOR . 'TestOssClientBase.php';
Expand Down
6 changes: 0 additions & 6 deletions tests/OSS/Tests/OssClientImageTest.php
Expand Up @@ -5,12 +5,6 @@
require_once __DIR__ . '/Common.php';

use OSS\OssClient;
use OSS\Model\LiveChannelConfig;
use OSS\Model\LiveChannelInfo;
use OSS\Model\LiveChannelListInfo;
use OSS\Core\OssException;



class OssClinetImageTest extends \PHPUnit_Framework_TestCase
{
Expand Down
1 change: 0 additions & 1 deletion tests/OSS/Tests/WebsiteConfigTest.php
Expand Up @@ -4,7 +4,6 @@


use OSS\Model\WebsiteConfig;
use OSS\Core\OssException;

class WebsiteConfigTest extends \PHPUnit_Framework_TestCase
{
Expand Down

0 comments on commit 7010c2f

Please sign in to comment.