Skip to content

Commit e57334b

Browse files
committed
Write documents.
1 parent de94e49 commit e57334b

File tree

13 files changed

+116
-24
lines changed

13 files changed

+116
-24
lines changed

examples/hello/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ cargo test --release
2626
```bash
2727
cargo run --release -- install
2828
```
29+
30+
## License
31+
32+
[Unlicense](https://github.com/jmjoy/phper/blob/master/LICENSE).

examples/log/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ cargo test --release
2626
```bash
2727
cargo run --release -- install
2828
```
29+
30+
## License
31+
32+
[Unlicense](https://github.com/jmjoy/phper/blob/master/LICENSE).

examples/log/tests/integration.rs

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
use phper_test::test_php_scripts_with_condition;
22
use std::{env, path::Path, str};
3+
use std::process::Output;
34

45
#[test]
56
fn test_php() {
7+
let base_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
8+
.join("tests")
9+
.join("php");
10+
611
test_php_scripts_with_condition(
712
env!("CARGO_BIN_EXE_log"),
813
&[
914
(
10-
&Path::new(env!("CARGO_MANIFEST_DIR"))
11-
.join("tests")
12-
.join("php")
13-
.join("test_php_say.php"),
15+
&base_dir.join("test_php_say.php"),
1416
&|output| {
1517
let stdout = str::from_utf8(&output.stdout).unwrap();
1618
stdout == "Hello, world!" && output.status.success()
1719
},
1820
),
1921
(
20-
&Path::new(env!("CARGO_MANIFEST_DIR"))
21-
.join("tests")
22-
.join("php")
23-
.join("test_php_notice.php"),
22+
&base_dir.join("test_php_notice.php"),
2423
&|output| {
2524
let stdout = str::from_utf8(&output.stdout).unwrap();
2625
stdout.contains("Notice:")
@@ -29,10 +28,7 @@ fn test_php() {
2928
},
3029
),
3130
(
32-
&Path::new(env!("CARGO_MANIFEST_DIR"))
33-
.join("tests")
34-
.join("php")
35-
.join("test_php_warning.php"),
31+
&base_dir.join("test_php_warning.php"),
3632
&|output| {
3733
let stdout = str::from_utf8(&output.stdout).unwrap();
3834
stdout.contains("Warning:")
@@ -41,21 +37,15 @@ fn test_php() {
4137
},
4238
),
4339
(
44-
&Path::new(env!("CARGO_MANIFEST_DIR"))
45-
.join("tests")
46-
.join("php")
47-
.join("test_php_error.php"),
40+
&base_dir.join("test_php_error.php"),
4841
&|output| {
4942
let stdout = str::from_utf8(&output.stdout).unwrap();
5043
stdout.contains("Fatal error:")
5144
&& stdout.contains("Something gone failed: just for test")
5245
},
5346
),
5447
(
55-
&Path::new(env!("CARGO_MANIFEST_DIR"))
56-
.join("tests")
57-
.join("php")
58-
.join("test_php_deprecated.php"),
48+
&base_dir.join("test_php_deprecated.php"),
5949
&|output| {
6050
let stdout = str::from_utf8(&output.stdout).unwrap();
6151
stdout.contains("Deprecated:")

phper-alloc/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# phper-alloc
22

3-
Alloc related items for phper crate.
3+
Alloc related items for [phper](https://crates.io/crates/phper).
4+
5+
## License
6+
7+
[Unlicense](https://github.com/jmjoy/phper/blob/master/LICENSE).

phper-alloc/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
#![warn(rust_2018_idioms, clippy::dbg_macro, clippy::print_stdout)]
2+
/*!
3+
Alloc related items for [phper](https://crates.io/crates/phper).
4+
5+
## License
6+
7+
[Unlicense](https://github.com/jmjoy/phper/blob/master/LICENSE).
8+
*/
29

310
/// The Box which use php `emalloc` and `efree` to manage memory.
411
///

phper-build/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# phper-build
22

3-
Generates stubs for project using phper.
3+
Generate stubs for project using [phper](https://crates.io/crates/phper).
4+
5+
Add this crate in your `[build-dependencies]` and using in `build.rs`.
6+
7+
## License
8+
9+
[Unlicense](https://github.com/jmjoy/phper/blob/master/LICENSE).

phper-build/src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
#![warn(rust_2018_idioms, clippy::dbg_macro, clippy::print_stdout)]
2+
3+
/*!
4+
Generate stubs for project using [phper](https://crates.io/crates/phper).
5+
6+
Add this crate in your `[build-dependencies]` and using in `build.rs`.
7+
8+
## License
9+
10+
[Unlicense](https://github.com/jmjoy/phper/blob/master/LICENSE).
11+
*/
12+
113
use phper_sys::{PHP_DEBUG, PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, USING_ZTS};
214

315
/// Register useful rust cfg for project using phper.

phper-macros/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# phper-macros
22

3-
The proc-macros for phper crate.
3+
The proc-macros for [phper](https://crates.io/crates/phper).
4+
5+
## License
6+
7+
[Unlicense](https://github.com/jmjoy/phper/blob/master/LICENSE).

phper-macros/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
#![warn(rust_2018_idioms, clippy::dbg_macro, clippy::print_stdout)]
2+
3+
/*!
4+
The proc-macros for [phper](https://crates.io/crates/phper).
5+
6+
## License
7+
8+
[Unlicense](https://github.com/jmjoy/phper/blob/master/LICENSE).
9+
*/
10+
111
mod alloc;
212
mod inner;
313
mod log;

phper-sys/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# phper-sys
22

33
Low level PHP binding for Rust.
4+
5+
The php-config is needed. You can set environment `PHP_CONFIG` to specify the path.
6+
7+
## License
8+
9+
[Unlicense](https://github.com/jmjoy/phper/blob/master/LICENSE).

0 commit comments

Comments
 (0)