Skip to content

Commit

Permalink
update: rename package name to phppkg/http-client
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Dec 7, 2021
1 parent 75801bd commit bd4f256
Show file tree
Hide file tree
Showing 40 changed files with 206 additions and 196 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ on:

jobs:
test:
name: Test on php ${{ matrix.php}} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
name: Test on php ${{ matrix.php}}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
php: [7.3, 7.4, 8.0]
os: [ubuntu-latest, macOS-latest] # windows-latest,
php: [7.3, 7.4, 8.0, 8.1]
# os: [ubuntu-latest, macOS-latest] # windows-latest,
include:
- os: 'ubuntu-latest'
php: '7.2'
Expand Down Expand Up @@ -45,4 +45,4 @@ jobs:
# Docs: https://getcomposer.org/doc/articles/scripts.md

- name: Run test suite
run: phpunit -v --debug
run: phpunit --debug
24 changes: 17 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
release:
name: Test on php ${{ matrix.php}}
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
php: [7.3]
php: [8.0]

steps:
- name: Checkout
Expand All @@ -25,10 +25,20 @@ jobs:
echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
echo "RELEASE_NAME=$GITHUB_WORKFLOW" >> $GITHUB_ENV
- uses: meeDamian/[email protected]
# more see https://github.com/inhere/kite
- name: Generate changelog file
id: changelog
run: |
wget -c -q https://github.com/inhere/kite/releases/latest/download/kite.phar
php kite.phar git cl prev last --style gh-release --no-merges --fetch-tags --unshallow --file changelog.md
cat changelog.md
# https://github.com/softprops/action-gh-release
- name: Create release and upload assets
uses: softprops/action-gh-release@v1
with:
gzip: false
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.RELEASE_TAG }}
name: ${{ env.RELEASE_TAG }}
# files: kite-${{ env.RELEASE_TAG }}.phar
tag_name: ${{ env.RELEASE_TAG }}
body_path: changelog.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

$header = <<<'EOF'
This file is part of php-comp/http-client.
This file is part of phppkg/http-client.
@author https://github.com/inhere
@link https://github.com/php-comp/http-client
@link https://github.com/phppkg/http-client
@license MIT
EOF;

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# HTTP Client

[![License](https://img.shields.io/packagist/l/php-comp/http-client.svg?style=flat-square)](LICENSE)
[![Php Version](https://img.shields.io/badge/php-%3E=7.1-brightgreen.svg?maxAge=2592000)](https://packagist.org/packages/php-comp/http-client)
[![Latest Stable Version](http://img.shields.io/packagist/v/php-comp/http-client.svg)](https://packagist.org/packages/php-comp/http-client)
[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/php-comp/http-client)](https://github.com/php-comp/http-client)
[![Github Actions Status](https://github.com/php-comp/http-client/workflows/Unit-tests/badge.svg)](https://github.com/php-comp/http-client/actions)
[![License](https://img.shields.io/packagist/l/phppkg/http-client.svg?style=flat-square)](LICENSE)
[![Php Version](https://img.shields.io/badge/php-%3E=7.2-brightgreen.svg?maxAge=2592000)](https://packagist.org/packages/phppkg/http-client)
[![Latest Stable Version](http://img.shields.io/packagist/v/phppkg/http-client.svg)](https://packagist.org/packages/phppkg/http-client)
[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/phppkg/http-client)](https://github.com/phppkg/http-client)
[![Github Actions Status](https://github.com/phppkg/http-client/workflows/Unit-tests/badge.svg)](https://github.com/phppkg/http-client/actions)

PHP HTTP client library.

Expand All @@ -16,15 +16,15 @@ PHP HTTP client library.
## 安装

```bash
composer require php-comp/http-client
composer require phppkg/http-client
```

## 使用

### 创建客户端实例

```php
use PhpComp\Http\Client\Client;
use PhpPkg\Http\Client\Client;

// use factory
$client = Client::factory([
Expand All @@ -48,7 +48,7 @@ $client = CoClient::create($options);
### 基本使用

```php
use PhpComp\Http\Client\Client;
use PhpPkg\Http\Client\Client;

$client = Client::factory([]);

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "php-comp/http-client",
"name": "phppkg/http-client",
"type": "library",
"description": "simple http client library of the php",
"keywords": [
Expand All @@ -9,13 +9,13 @@
"fopen",
"curl"
],
"homepage": "https://github.com/php-comp/http-client",
"homepage": "https://github.com/phppkg/http-client",
"license": "MIT",
"authors": [
{
"name": "inhere",
"email": "[email protected]",
"homepage": "http://www.yzone.net/"
"homepage": "https://github.com/inhere"
}
],
"require": {
Expand All @@ -25,10 +25,10 @@
},
"autoload": {
"psr-4": {
"PhpComp\\Http\\Client\\": "src/"
"PhpPkg\\Http\\Client\\": "src/"
}
},
"suggest": {
"php-comp/http-message": "Very lightweight PSR-7 implements http message component"
"phppkg/http-message": "Very lightweight PSR-7 implements http message component"
}
}
6 changes: 3 additions & 3 deletions example/coreq.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

use PhpComp\Http\Client\Client;
use PhpComp\Http\Client\ClientConst;
use PhpComp\Http\Client\Swoole\CoClient;
use PhpPkg\Http\Client\Client;
use PhpPkg\Http\Client\ClientConst;
use PhpPkg\Http\Client\Swoole\CoClient;

require dirname(__DIR__) . '/test/bootstrap.php';

Expand Down
4 changes: 2 additions & 2 deletions example/demo.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use PhpComp\Http\Client\Client;
use PhpComp\Http\Client\ClientConst;
use PhpPkg\Http\Client\Client;
use PhpPkg\Http\Client\ClientConst;

require dirname(__DIR__) . '/test/bootstrap.php';

Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
stopOnFailure="false"
>
<testsuites>
<testsuite name="php-comp http-client Test Suite">
<testsuite name="phppkg http-client Test Suite">
<directory>test</directory>
</testsuite>
</testsuites>
Expand Down
8 changes: 4 additions & 4 deletions src/AbstractClient.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php declare(strict_types=1);
/**
* This file is part of php-comp/http-client.
* This file is part of phppkg/http-client.
*
* @author https://github.com/inhere
* @link https://github.com/php-comp/http-client
* @link https://github.com/phppkg/http-client
* @license MIT
*/

namespace PhpComp\Http\Client;
namespace PhpPkg\Http\Client;

use Closure;
use InvalidArgumentException;
Expand Down Expand Up @@ -35,7 +35,7 @@
/**
* Class AbstractClient
*
* @package PhpComp\Http\Client
* @package PhpPkg\Http\Client
*/
abstract class AbstractClient implements ClientInterface
{
Expand Down
14 changes: 7 additions & 7 deletions src/Client.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<?php declare(strict_types=1);
/**
* This file is part of php-comp/http-client.
* This file is part of phppkg/http-client.
*
* @author https://github.com/inhere
* @link https://github.com/php-comp/http-client
* @link https://github.com/phppkg/http-client
* @license MIT
*/

namespace PhpComp\Http\Client;
namespace PhpPkg\Http\Client;

use InvalidArgumentException;
use PhpComp\Http\Client\Curl\CurlClient;
use PhpComp\Http\Client\Swoole\CoClient;
use PhpComp\Http\Client\Swoole\CoClient2;
use PhpPkg\Http\Client\Curl\CurlClient;
use PhpPkg\Http\Client\Swoole\CoClient;
use PhpPkg\Http\Client\Swoole\CoClient2;
use RuntimeException;
use function method_exists;

/**
* Class Client
*
* @package PhpComp\Http\Client
* @package PhpPkg\Http\Client
*
* @method static ClientInterface get(string $url, $params = null, array $headers = [], array $options = [])
* @method static ClientInterface delete(string $url, $params = null, array $headers = [], array $options = [])
Expand Down
4 changes: 2 additions & 2 deletions src/ClientConst.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php declare(strict_types=1);

namespace PhpComp\Http\Client;
namespace PhpPkg\Http\Client;

/**
* Class ClientConst
*
* @package PhpComp\Http\Client
* @package PhpPkg\Http\Client
*/
class ClientConst
{
Expand Down
8 changes: 4 additions & 4 deletions src/ClientInterface.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?php declare(strict_types=1);
/**
* This file is part of php-comp/http-client.
* This file is part of phppkg/http-client.
*
* @author https://github.com/inhere
* @link https://github.com/php-comp/http-client
* @link https://github.com/phppkg/http-client
* @license MIT
*/

namespace PhpComp\Http\Client;
namespace PhpPkg\Http\Client;

use Closure;

/**
* Interface ClientInterface
*
* @package PhpComp\Http\Client
* @package PhpPkg\Http\Client
*/
interface ClientInterface extends \Psr\Http\Client\ClientInterface
{
Expand Down
10 changes: 5 additions & 5 deletions src/ClientUtil.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php declare(strict_types=1);
/**
* This file is part of php-comp/http-client.
* This file is part of phppkg/http-client.
*
* @author https://github.com/inhere
* @link https://github.com/php-comp/http-client
* @link https://github.com/phppkg/http-client
* @license MIT
*/

namespace PhpComp\Http\Client;
namespace PhpPkg\Http\Client;

use InvalidArgumentException;
use PhpComp\Http\Client\Exception\ClientException;
use PhpPkg\Http\Client\Exception\ClientException;
use Toolkit\Stdlib\Arr\ArrayHelper;
use Toolkit\Stdlib\Helper\JsonHelper;
use Toolkit\Stdlib\Str\UrlHelper;
Expand All @@ -31,7 +31,7 @@
/**
* Class ClientUtil
*
* @package PhpComp\Http\Client
* @package PhpPkg\Http\Client
*/
class ClientUtil
{
Expand Down
20 changes: 10 additions & 10 deletions src/Curl/CurlClient.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?php declare(strict_types=1);
/**
* This file is part of php-comp/http-client.
* This file is part of phppkg/http-client.
*
* @author https://github.com/inhere
* @link https://github.com/php-comp/http-client
* @link https://github.com/phppkg/http-client
* @license MIT
*/

namespace PhpComp\Http\Client\Curl;
namespace PhpPkg\Http\Client\Curl;

use InvalidArgumentException;
use PhpComp\Http\Client\AbstractClient;
use PhpComp\Http\Client\ClientConst;
use PhpComp\Http\Client\ClientInterface;
use PhpComp\Http\Client\ClientUtil;
use PhpComp\Http\Client\Exception\ClientException;
use PhpComp\Http\Client\Traits\ParseRawResponseTrait;
use PhpPkg\Http\Client\AbstractClient;
use PhpPkg\Http\Client\ClientConst;
use PhpPkg\Http\Client\ClientInterface;
use PhpPkg\Http\Client\ClientUtil;
use PhpPkg\Http\Client\Exception\ClientException;
use PhpPkg\Http\Client\Traits\ParseRawResponseTrait;
use Toolkit\Stdlib\Arr\ArrayHelper;
use Toolkit\Stdlib\Str\UrlHelper;
use function array_merge;
Expand Down Expand Up @@ -82,7 +82,7 @@
/**
* Class Curl
*
* @package PhpComp\Http\Client\Curl
* @package PhpPkg\Http\Client\Curl
*
* ```
* $curl = CurlClient::make([
Expand Down
8 changes: 4 additions & 4 deletions src/Curl/CurlClientInterface.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php declare(strict_types=1);
/**
* This file is part of php-comp/http-client.
* This file is part of phppkg/http-client.
*
* @author https://github.com/inhere
* @link https://github.com/php-comp/http-client
* @link https://github.com/phppkg/http-client
* @license MIT
*/

namespace PhpComp\Http\Client\Curl;
namespace PhpPkg\Http\Client\Curl;

/**
* Class CurlExtraInterface
*
* @package PhpComp\Http\Client\Curl
* @package PhpPkg\Http\Client\Curl
*/
interface CurlClientInterface
{
Expand Down
Loading

0 comments on commit bd4f256

Please sign in to comment.