Skip to content

Commit 88ba284

Browse files
authored
Merge branch 'master' into file-callback
2 parents 4555715 + 4b3a050 commit 88ba284

File tree

148 files changed

+39548
-1674
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+39548
-1674
lines changed

.pullapprove.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.travis.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
language: php
22

33
php:
4-
- 5.4
5-
- 5.5
6-
- 7.0
4+
- 5.6
5+
- 7.0
6+
- 7.1
7+
- 7.2
8+
- 7.3
9+
- 7.4
710

811
env:
9-
- LC_API_REGION=US LC_APP_ID=wnDg0lPt0wcYGJSiHRwHBhD4 LC_APP_KEY=u9ekx9HFSFFBErWwyWHFmPDy LC_APP_HOST=127.0.0.1 LC_APP_PORT=8081
12+
- LEANCLOUD_API_SERVER="https://us.avoscloud.com" LEANCLOUD_APP_ID=wnDg0lPt0wcYGJSiHRwHBhD4 LEANCLOUD_APP_KEY=u9ekx9HFSFFBErWwyWHFmPDy LEANCLOUD_REGION=US LEANCLOUD_APP_HOST="127.0.0.1" LEANCLOUD_APP_PORT=8081 LEANCLOUD_WILDCARD_DOMAIN="lncldglobal.com"
13+
14+
install:
15+
- composer install
1016

1117
script:
12-
- "make test_engine &"
13-
- phpunit --coverage-clover=coverage.xml test
18+
- "make test_engine &"
19+
- "php -r 'exit(PHP_VERSION_ID >= 70200 ? 0 : 1);' || vendor/bin/phpunit test/Php72ObjectDeprecated.php"
20+
- "./vendor/bin/phpunit --coverage-clover=coverage.xml test"
1421

1522
after_success:
16-
- bash <(curl -s https://codecov.io/bash)
17-
18-
notifications:
19-
webhooks: https://hook.bearychat.com/=bw52Y/travis/6e26f4422b2871c20a5b2d40e1d49f73
20-
23+
- bash <(curl -s https://codecov.io/bash)

Changelog.md

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,90 @@
11

2+
0.12.0 发布日期:2019-12-30
3+
----
4+
5+
* 支持平滑推送(`flow_control`
6+
* 支持即使通讯服务的 `_rtmClientSign` hook
7+
* 支持 PHP 7.4
8+
9+
0.11.0 发布日期:2019-10-25
10+
----
11+
12+
* 支持即时通讯服务新增的 `_clientOnline``_clientOffline` 这两个 hook。
13+
* 支持 PHP 7.3。
14+
15+
0.10.3 发布日期:2019-08-30
16+
----
17+
18+
* 优化云引擎错误处理
19+
* 处理中间件中的异常,避免返回 500 内部错误。比如 sessionToken 不合法的异常。
20+
* 在云引擎错误栈中,打印请求到 API 的 method, url
21+
22+
0.10.2 发布日期:2019-06-24
23+
----
24+
25+
* 修复 signUpOrLoginByMobilePhone 登录问题
26+
27+
0.10.1 发布日期:2019-06-24
28+
----
29+
30+
* 修复 signUpOrLoginByMobilePhone 登录问题
31+
32+
0.10.0 发布日期:2019-06-24
33+
----
34+
35+
- 添加 `User::signUpOrLoginByMobilePhone` 支持手机注册或登录
36+
37+
0.9.0 发布日期:2019-05-23
38+
----
39+
40+
- 添加 `Cloud::start` 函数,更便捷地初始化云函数服务
41+
- 添加 `User::logInWithEmail` 函数,支持邮箱密码登录功能
42+
43+
0.8.1 发布日期:2018-09-25
44+
----
45+
46+
- 修复 `Client::useRegion`
47+
48+
0.8.0 发布日期:2018-06-21
49+
----
50+
51+
- `Object` 类更名为了 `LeanObject`,兼容 PHP 7.2
52+
53+
当 SDK 运行在 PHP 7.2 以下版本时,会为 `LeanObject` 创建一个别名,继续支持之前使用 `Object` 类的代码,这两个名字实际上指向同一个类,两个类名也可以混用。我们会在 PHP 7.2 以下继续支持 `Object` 一段时间,希望开发者尽快将代码中的 `Object` 改为 `LeanObject`
54+
55+
0.7.0 发布日期:2018-03-19
56+
----
57+
58+
* 添加 `Client::setServerUrl` 接口
59+
* 非云引擎环境下支持 app-router
60+
61+
0.6.0 发布日期:2017-09-06
62+
----
63+
64+
* 更新 `LEANCLOUD_*` 环境变量
65+
* 根据环境变量设置是否以生产环境请求
66+
67+
0.5.6 发布日期:2017-04-13
68+
----
69+
70+
* 修复: 用户定义的 class hook 不需要返回对象,
71+
而是由中间件来返回被修改的对象
72+
73+
0.5.5 发布日期:2017-04-12
74+
----
75+
76+
* 云引擎中输出错误栈
77+
78+
0.5.4 发布日期:2017-02-27
79+
----
80+
81+
* 修复推送请求中的格式不兼容问题
82+
83+
0.5.3 发布日期:2017-02-13
84+
----
85+
86+
* 支持小写的 region
87+
288
0.5.2 发布日期:2017-01-22
389
----
490

@@ -99,4 +185,3 @@ LeanQuery LeanRelation LeanRole LeanUser
99185

100186
0.1.0 发布日期: 2015-10-30
101187
----
102-

Hacking.md

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,45 @@
1-
Hacking
2-
----
1+
# Hacking
2+
3+
## Pull Request
34

45
* Get and install [composer](https://getcomposer.org)
56
* Fork the SDK from leancloud/php-sdk
67
* Run `composer install` to get dependencies
78
* Setup app credential in env variables:
89

9-
```
10-
export LC_APP_ID=...
11-
export LC_APP_KEY=...
12-
export LC_APP_MASTER_KEY=...
13-
export LC_API_REGION=US
14-
```
10+
```sh
11+
export LC_APP_ID=...
12+
export LC_APP_KEY=...
13+
export LC_APP_MASTER_KEY=...
14+
export LC_API_REGION=US
15+
export LEANCLOUD_APP_HOST="127.0.0.1"
16+
export LEANCLOUD_APP_PORT=8081
17+
export LEANCLOUD_WILDCARD_DOMAIN="lncldglobal.com"
18+
```
19+
20+
* Run tests:
21+
22+
```sh
23+
make test_engine &
24+
make test
25+
```
1526

16-
* `make test` to run test
17-
* `make doc` to build documentation
27+
* `make doc` to build documentation (should running on PHP < 7.2)
28+
29+
* Send a pull request at leancloud/php-sdk
1830

1931
Thanks for your contribution!
32+
33+
## Prepare a Release
34+
35+
Make sure all tests are passed.
36+
37+
Run `make doc` and commit auto generated api doc.
38+
39+
Run `make release V=MAJOR.MINOR.PATCH` (e.g. `make release V=0.11.0`),
40+
and edit `Changelog.md` (git log subjects are for reference only, do not leave them unchanged).
41+
42+
Commit changes and send a pull request at leancloud/php-sdk.
43+
44+
If everything is O.K., the maintainer will merge the pull request, push a new tag, and publish a new release at GitHub.
45+
Then a new version will be published at Packagist automatically.

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
test:
22
vendor/bin/phpunit test
3+
php -r 'exit(PHP_VERSION_ID >= 70200 ? 0 : 1);' || vendor/bin/phpunit test/Php72ObjectDeprecated.php
34

45
release:
56
./release.sh $V
7+
make doc
68

79
doc:
8-
vendor/bin/apigen generate --source src --destination docs
10+
@rm -r docs
11+
@php5.6 vendor/bin/apigen generate --source src --destination docs
912

1013
test_engine:
11-
php -S ${LC_APP_HOST}:${LC_APP_PORT} test/engine/index.php
14+
php -S ${LEANCLOUD_APP_HOST}:${LEANCLOUD_APP_PORT} test/engine/index.php
1215

1316
.PHONY: test doc test_engine

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ PHP SDK 提供了对数据存储,用户管理等模块的 PHP 实现及接口
1515
安装
1616
----
1717

18-
运行环境要求 PHP 5.3 及以上版本,以及
18+
运行环境要求 PHP 5.6 及以上版本,以及
1919
[cURL](http://php.net/manual/zh/book.curl.php)
2020

2121
#### composer 安装
@@ -104,10 +104,10 @@ User::logInWith("weibo", array("openid" => "..."));
104104
#### 对象存储
105105

106106
```php
107-
use LeanCloud\Object;
107+
use LeanCloud\LeanObject;
108108
use LeanCloud\CloudException;
109109

110-
$obj = new Object("TestObject");
110+
$obj = new LeanObject("TestObject");
111111
$obj->set("name", "alice");
112112
$obj->set("height", 60.0);
113113
$obj->set("weight", 4.5);
@@ -142,7 +142,7 @@ $obj->destroy();
142142
我们同样支持子类继承,子类中需要定义静态变量 `$className` ,并注册到存储类:
143143

144144
```php
145-
class TestObject extends Object {
145+
class TestObject extends LeanObject {
146146
protected static $className = "TestObject";
147147
public setName($name) {
148148
$this->set("name", $name);
@@ -235,4 +235,3 @@ try {
235235
----
236236

237237
See Hacking.md if you'd like to contribute.
238-

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
}
1212
],
1313
"require": {
14+
"php": ">=5.6",
1415
"ext-curl": "*"
1516
},
1617
"require-dev": {
17-
"phpunit/phpunit": "^4.8",
18-
"apigen/apigen": "^4.1"
18+
"phpunit/phpunit": "^5.7",
19+
"apigen/apigen": "^4.1",
20+
"doctrine/instantiator": "<1.1.0"
1921
},
2022
"autoload": {
2123
"psr-4": {"LeanCloud\\": "src/LeanCloud"}

0 commit comments

Comments
 (0)