Skip to content

Commit b50cbfe

Browse files
committed
Fix doc test.
1 parent 91721b4 commit b50cbfe

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A library that allows us to write PHP extensions using pure Rust and using safe
1818
**os**
1919

2020
- linux
21-
21+
2222
**php**
2323

2424
*version*
@@ -29,7 +29,7 @@ A library that allows us to write PHP extensions using pure Rust and using safe
2929
- 7.3
3030
- 7.4
3131
- 8.0
32-
32+
3333
*mode*
3434

3535
- nts
@@ -41,7 +41,7 @@ A library that allows us to write PHP extensions using pure Rust and using safe
4141
## Usage
4242

4343
1. Make sure `libclang` and `php` is installed.
44-
44+
4545
```bash
4646
# If you are using debian like linux system:
4747
sudo apt install libclang-10-dev php-cli
@@ -76,13 +76,15 @@ fn main() {
7676
5. Write you owned extension logic in `lib.rs`.
7777

7878
```rust
79+
use phper::{php_get_module, modules::Module};
80+
7981
#[php_get_module]
8082
pub fn get_module(module: &mut Module) {
8183
// set module metadata
8284
module.set_name(env!("CARGO_PKG_NAME"));
8385
module.set_version(env!("CARGO_PKG_VERSION"));
8486
module.set_author(env!("CARGO_PKG_AUTHORS"));
85-
87+
8688
// ...
8789
}
8890
```
@@ -110,8 +112,8 @@ extension = myapp
110112

111113
## examples
112114

113-
See [examples](examples).
115+
See [examples](https://github.com/jmjoy/phper/tree/master/examples).
114116

115117
## License
116118

117-
[Unlicense](LICENSE).
119+
[Unlicense](https://github.com/jmjoy/phper/blob/master/LICENSE).

phper/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ phper = "0.2"
6868
6969
4. Add these code to `main.rs`.
7070
71-
```rust
71+
```rust,no_run
7272
use phper::cmd::make;
7373
7474
fn main() {
@@ -79,6 +79,8 @@ fn main() {
7979
5. Write you owned extension logic in `lib.rs`.
8080
8181
```rust
82+
use phper::{php_get_module, modules::Module};
83+
8284
#[php_get_module]
8385
pub fn get_module(module: &mut Module) {
8486
// set module metadata

0 commit comments

Comments
 (0)