Skip to content

Commit

Permalink
Convert uri to https.
Browse files Browse the repository at this point in the history
  • Loading branch information
twose committed Dec 3, 2018
1 parent 908f360 commit 760541d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ go(function () {
```php
echo SaberGM::list([
'uri' => [
'http://www.qq.com/',
'https://www.qq.com/',
'https://www.baidu.com/',
'https://www.swoole.com/',
'http://httpbin.org/'
Expand All @@ -377,7 +377,7 @@ echo SaberGM::list([

```php
// max_co is the max number of concurrency request once, it's very useful to prevent server-waf limit.
$requests = array_fill(0, 10, ['uri' => 'http://www.qq.com/']);
$requests = array_fill(0, 10, ['uri' => 'https://www.qq.com/']);
echo SaberGM::requests($requests, ['max_co' => 5])->time."\n";
echo SaberGM::requests($requests, ['max_co' => 1])->time."\n";
```
Expand Down
2 changes: 1 addition & 1 deletion examples/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
go(function () {
$res = SaberGM::list([
'uri' => [
'http://www.qq.com/',
'https://www.qq.com/',
'https://www.baidu.com/',
'https://www.swoole.com/',
'http://eu.httpbin.org/'
Expand Down
4 changes: 2 additions & 2 deletions examples/mark.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
go(function () {
//it's the way to bind some special request data to response.
$responses = SaberGM::requests([
['uri' => 'http://www.qq.com/', 'mark' => 'it is request one!'],
['uri' => 'http://www.qq.com']
['uri' => 'https://www.qq.com/', 'mark' => 'it is request one!'],
['uri' => 'https://www.qq.com']
]);
echo $responses[0]->getSpecialMark();
});
2 changes: 1 addition & 1 deletion examples/max-concurrency-control.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

go(function () {
// max_co is the max number of concurrency request once, it's very useful to prevent server-waf limit.
$requests = array_fill(0, 10, ['uri' => 'http://www.qq.com/']);
$requests = array_fill(0, 10, ['uri' => 'https://www.qq.com/']);
echo SaberGM::requests($requests, ['max_co' => 5])->time."\n";
echo SaberGM::requests($requests, ['max_co' => 1])->time."\n";
});
4 changes: 2 additions & 2 deletions examples/pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

go(function () {
$pool = Saber::create([
'base_uri' => 'http://www.qq.com',
'base_uri' => 'https://www.qq.com',
'use_pool' => true
]);
$start = microtime(true);
Expand All @@ -22,7 +22,7 @@
var_dump($pool_time);

$not_pool = Saber::create([
'base_uri' => 'http://www.qq.com',
'base_uri' => 'https://www.qq.com',
'use_pool' => false
]);
$start = microtime(true);
Expand Down
10 changes: 5 additions & 5 deletions tests/SaberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function testExceptions()
{
$saber = Saber::create(['exception_report' => true]);
$this->expectException(ConnectException::class);
$saber->get('http://www.qq.com', ['timeout' => 0.001]);
$saber->get('https://www.qq.com', ['timeout' => 0.001]);
$this->expectException(ConnectException::class);
$saber->get('http://foo.bar');
$this->expectException(ClientException::class);
Expand Down Expand Up @@ -164,15 +164,15 @@ public function testMark()
{
$mark = 'it is request one!';
$responses = SaberGM::requests([
['uri' => 'http://www.qq.com/', 'mark' => $mark],
['uri' => 'http://www.qq.com']
['uri' => 'https://www.qq.com/', 'mark' => $mark],
['uri' => 'https://www.qq.com']
]);
$this->assertEquals($mark, $responses[0]->getSpecialMark());
}

public function testInterceptor()
{
$target = 'http://www.qq.com/';
$target = 'https://www.qq.com/';
SaberGM::get($target, [
'before' => function (Saber\Request $request) use (&$uri) {
$uri = $request->getUri();
Expand All @@ -188,7 +188,7 @@ public function testInterceptor()
public function testList()
{
$uri_list = [
'http://www.qq.com/',
'https://www.qq.com/',
'https://www.baidu.com/',
'http://eu.httpbin.org/'
];
Expand Down

0 comments on commit 760541d

Please sign in to comment.