Skip to content

Commit 88db607

Browse files
authored
Bump to 0.5.1, with dependencies and document updated. (#46)
1 parent d6d9594 commit 88db607

File tree

14 files changed

+102
-50
lines changed

14 files changed

+102
-50
lines changed

.github/workflows/ci.yml

+34
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,23 @@ jobs:
8888
override: true
8989
components: clippy
9090

91+
- name: Cargo generate lockfile
92+
uses: actions-rs/cargo@v1
93+
with:
94+
toolchain: stable
95+
command: generate-lockfile
96+
97+
- name: Setup cargo cache
98+
uses: actions/cache@v3
99+
with:
100+
path: |
101+
~/.cargo/bin/
102+
~/.cargo/registry/index/
103+
~/.cargo/registry/cache/
104+
~/.cargo/git/db/
105+
target/
106+
key: ${{ matrix.os }}-ci-${{ matrix.php-version }}-${{ hashFiles('**/Cargo.lock') }}
107+
91108
- name: Cargo fmt
92109
uses: actions-rs/cargo@v1
93110
with:
@@ -159,6 +176,23 @@ jobs:
159176
toolchain: stable
160177
override: true
161178

179+
- name: Cargo generate lockfile
180+
uses: actions-rs/cargo@v1
181+
with:
182+
toolchain: stable
183+
command: generate-lockfile
184+
185+
- name: Setup cargo cache
186+
uses: actions/cache@v3
187+
with:
188+
path: |
189+
~/.cargo/bin/
190+
~/.cargo/registry/index/
191+
~/.cargo/registry/cache/
192+
~/.cargo/git/db/
193+
target/
194+
key: ${{ matrix.os }}-check-${{ matrix.php-version }}-${{ matrix.features }}-${{ hashFiles('**/Cargo.lock') }}
195+
162196
- name: Cargo check phper-sys
163197
uses: actions-rs/cargo@v1
164198
with:

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,18 @@ The framework that allows us to write PHP extensions using pure and safe Rust wh
7878
}
7979
```
8080

81+
1. Create the `build.rs` ( Adapting MacOS ).
82+
83+
```rust,no_run
84+
fn main() {
85+
#[cfg(target_os = "macos")]
86+
{
87+
println!("cargo:rustc-link-arg=-undefined");
88+
println!("cargo:rustc-link-arg=dynamic_lookup");
89+
}
90+
}
91+
```
92+
8193
1. Write you owned extension logic in `lib.rs`.
8294

8395
```rust
@@ -125,6 +137,10 @@ The framework that allows us to write PHP extensions using pure and safe Rust wh
125137

126138
See [examples](https://github.com/phper-framework/phper/tree/master/examples).
127139

140+
## The projects using PHPER
141+
142+
- [apache/skywalking-php](https://github.com/apache/skywalking-php) - The PHP Agent for Apache SkyWalking, which provides the native tracing abilities for PHP project.
143+
128144
## License
129145

130146
[MulanPSL-2.0](https://github.com/phper-framework/phper/blob/master/LICENSE).

examples/hello/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ path = "src/_reexport.rs"
2929
crate-type = ["cdylib"]
3030

3131
[dependencies]
32-
phper = { version = "0.5.0", path = "../../phper" }
32+
phper = { version = "0.5.1", path = "../../phper" }
3333

3434
[dev-dependencies]
35-
phper-test = { version = "0.5.0", path = "../../phper-test" }
35+
phper-test = { version = "0.5.1", path = "../../phper-test" }
3636

3737
[build-dependencies]
38-
phper-build = { version = "0.5.0", path = "../../phper-build" }
38+
phper-build = { version = "0.5.1", path = "../../phper-build" }

examples/http-client/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ crate-type = ["cdylib"]
3232
anyhow = "1.0.58"
3333
bytes = "1.1.0"
3434
indexmap = "1.9.1"
35-
phper = { version = "0.5.0", path = "../../phper" }
35+
phper = { version = "0.5.1", path = "../../phper" }
3636
reqwest = { version = "0.11.11", features = ["blocking", "cookies"] }
3737
thiserror = "1.0.31"
3838

3939
[dev-dependencies]
40-
phper-test = { version = "0.5.0", path = "../../phper-test" }
40+
phper-test = { version = "0.5.1", path = "../../phper-test" }

examples/http-server/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ crate-type = ["cdylib"]
3030

3131
[dependencies]
3232
hyper = { version = "0.14.20", features = ["http1", "runtime", "server"] }
33-
phper = { version = "0.5.0", path = "../../phper" }
33+
phper = { version = "0.5.1", path = "../../phper" }
3434
thiserror = "1.0.31"
3535
tokio = { version = "1.19.2", features = ["full"] }
3636

3737
[dev-dependencies]
38-
phper-test = { version = "0.5.0", path = "../../phper-test" }
38+
phper-test = { version = "0.5.1", path = "../../phper-test" }
3939
reqwest = "0.11.11"

examples/logging/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ crate-type = ["cdylib"]
3030

3131
[dependencies]
3232
anyhow = "1.0.58"
33-
phper = { version = "0.5.0", path = "../../phper" }
33+
phper = { version = "0.5.1", path = "../../phper" }
3434

3535
[dev-dependencies]
36-
phper-test = { version = "0.5.0", path = "../../phper-test" }
36+
phper-test = { version = "0.5.1", path = "../../phper-test" }
3737

3838
[build-dependencies]
39-
phper-build = { version = "0.5.0", path = "../../phper-build" }
39+
phper-build = { version = "0.5.1", path = "../../phper-build" }

phper-alloc/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
[package]
1212
name = "phper-alloc"
13-
version = "0.5.0"
13+
version = "0.5.1"
1414
authors = ["PHPER Framework Team", "jmjoy <[email protected]>"]
1515
edition = "2021"
1616
rust-version = "1.56"
@@ -22,7 +22,7 @@ keywords = ["php", "alloc"]
2222
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
2323

2424
[dependencies]
25-
phper-sys = { version = "0.5.0", path = "../phper-sys" }
25+
phper-sys = { version = "0.5.1", path = "../phper-sys" }
2626

2727
[build-dependencies]
28-
phper-build = { version = "0.5.0", path = "../phper-build" }
28+
phper-build = { version = "0.5.1", path = "../phper-build" }

phper-build/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
[package]
1212
name = "phper-build"
13-
version = "0.5.0"
13+
version = "0.5.1"
1414
authors = ["PHPER Framework Team", "jmjoy <[email protected]>"]
1515
edition = "2021"
1616
rust-version = "1.56"
@@ -22,4 +22,4 @@ keywords = ["php", "binding"]
2222
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
2323

2424
[dependencies]
25-
phper-sys = { version = "0.5.0", path = "../phper-sys" }
25+
phper-sys = { version = "0.5.1", path = "../phper-sys" }

phper-macros/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
[package]
1212
name = "phper-macros"
13-
version = "0.5.0"
13+
version = "0.5.1"
1414
authors = ["PHPER Framework Team", "jmjoy <[email protected]>"]
1515
edition = "2021"
1616
rust-version = "1.56"

phper-sys/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
[package]
1212
name = "phper-sys"
13-
version = "0.5.0"
13+
version = "0.5.1"
1414
authors = ["PHPER Framework Team", "jmjoy <[email protected]>"]
1515
edition = "2021"
1616
rust-version = "1.56"

phper-test/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
[package]
1212
name = "phper-test"
13-
version = "0.5.0"
13+
version = "0.5.1"
1414
authors = ["PHPER Framework Team", "jmjoy <[email protected]>"]
1515
edition = "2021"
1616
rust-version = "1.56"
@@ -25,10 +25,10 @@ keywords = ["php", "binding"]
2525
fpm = ["fastcgi-client", "tokio/full"]
2626

2727
[dependencies]
28-
fastcgi-client = { version = "0.7.0", optional = true }
28+
fastcgi-client = { version = "0.8.0", optional = true }
2929
libc = "0.2.126"
3030
once_cell = "1.13.0"
31-
phper-macros = { version = "0.5.0", path = "../phper-macros" }
31+
phper-macros = { version = "0.5.1", path = "../phper-macros" }
3232
tempfile = "3.3.0"
3333
tokio = { version = "1.19.2", optional = true }
3434

phper-test/src/fpm.rs

+23-21
Original file line numberDiff line numberDiff line change
@@ -125,40 +125,42 @@ pub fn test_fpm_request(
125125
let local_addr = stream.local_addr().unwrap();
126126
let peer_addr = stream.peer_addr().unwrap();
127127
let local_ip = local_addr.ip().to_string();
128-
let local_addr = local_addr.port().to_string();
128+
let local_port = local_addr.port();
129129
let peer_ip = peer_addr.ip().to_string();
130-
let peer_port = peer_addr.port().to_string();
130+
let peer_port = peer_addr.port();
131131

132-
let mut client = Client::new(stream, false);
132+
let client = Client::new(stream);
133133
let mut params = Params::default()
134-
.set_request_method(method)
135-
.set_script_name(request_uri)
136-
.set_script_filename(script_filename)
137-
.set_request_uri(request_uri)
138-
.set_document_uri(script_name)
139-
.set_remote_addr(&local_ip)
140-
.set_remote_port(&local_addr)
141-
.set_server_addr(&peer_ip)
142-
.set_server_port(&peer_port)
143-
.set_server_name("phper-test");
134+
.request_method(method)
135+
.script_name(request_uri)
136+
.script_filename(script_filename)
137+
.request_uri(request_uri)
138+
.document_uri(script_name)
139+
.remote_addr(&local_ip)
140+
.remote_port(local_port)
141+
.server_addr(&peer_ip)
142+
.server_port(peer_port)
143+
.server_name("phper-test");
144144
if let Some(content_type) = &content_type {
145-
params = params.set_content_type(content_type);
145+
params = params.content_type(content_type);
146146
}
147-
let mut len = String::new();
148147
if let Some(body) = &body {
149-
len += &body.len().to_string();
150-
params = params.set_content_length(&len);
148+
params = params.content_length(body.len());
151149
}
152150

153151
let response = if let Some(body) = body {
154-
client.execute(Request::new(params, body.as_ref())).await
152+
client
153+
.execute_once(Request::new(params, body.as_ref()))
154+
.await
155155
} else {
156-
client.execute(Request::new(params, &mut io::empty())).await
156+
client
157+
.execute_once(Request::new(params, &mut io::empty()))
158+
.await
157159
};
158160

159161
let output = response.unwrap();
160-
let stdout = output.get_stdout().unwrap_or_default();
161-
let stderr = output.get_stderr().unwrap_or_default();
162+
let stdout = output.stdout.unwrap_or_default();
163+
let stderr = output.stderr.unwrap_or_default();
162164

163165
let no_error = stderr.is_empty();
164166

phper/Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010

1111
[package]
1212
name = "phper"
13-
version = "0.5.0"
13+
version = "0.5.1"
1414
authors = ["PHPER Framework Team", "jmjoy <[email protected]>"]
1515
edition = "2021"
1616
rust-version = "1.56"
1717
description = "The framework that allows us to write PHP extensions using pure and safe Rust whenever possible."
1818
repository = "https://github.com/jmjoy/phper.git"
1919
documentation = "https://docs.rs/phper"
2020
license = "MulanPSL-2.0"
21-
readme = "../README.md"
21+
readme = "README.md"
2222
keywords = ["php", "binding", "extension", "module"]
2323

2424
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -30,11 +30,11 @@ dashmap = "5.3.4"
3030
derive_more = "0.99.17"
3131
indexmap = "1.9.1"
3232
once_cell = "1.13.0"
33-
phper-alloc = { version = "0.5.0", path = "../phper-alloc" }
34-
phper-macros = { version = "0.5.0", path = "../phper-macros" }
35-
phper-sys = { version = "0.5.0", path = "../phper-sys" }
33+
phper-alloc = { version = "0.5.1", path = "../phper-alloc" }
34+
phper-macros = { version = "0.5.1", path = "../phper-macros" }
35+
phper-sys = { version = "0.5.1", path = "../phper-sys" }
3636
thiserror = "1.0.31"
3737

3838
[build-dependencies]
39-
phper-build = { version = "0.5.0", path = "../phper-build" }
40-
phper-sys = { version = "0.5.0", path = "../phper-sys" }
39+
phper-build = { version = "0.5.1", path = "../phper-build" }
40+
phper-sys = { version = "0.5.1", path = "../phper-sys" }

tests/integration/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ crate-type = ["cdylib"]
2828

2929
[dependencies]
3030
indexmap = "1.9.1"
31-
phper = { version = "0.5.0", path = "../../phper" }
31+
phper = { version = "0.5.1", path = "../../phper" }
3232

3333
[dev-dependencies]
34-
phper-test = { version = "0.5.0", path = "../../phper-test", features = ["fpm"] }
34+
phper-test = { version = "0.5.1", path = "../../phper-test", features = ["fpm"] }

0 commit comments

Comments
 (0)