File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ A library that allows us to write PHP extensions using pure Rust and using safe
18
18
** os**
19
19
20
20
- linux
21
-
21
+
22
22
** php**
23
23
24
24
* version*
@@ -29,7 +29,7 @@ A library that allows us to write PHP extensions using pure Rust and using safe
29
29
- 7.3
30
30
- 7.4
31
31
- 8.0
32
-
32
+
33
33
* mode*
34
34
35
35
- nts
@@ -41,7 +41,7 @@ A library that allows us to write PHP extensions using pure Rust and using safe
41
41
## Usage
42
42
43
43
1 . Make sure ` libclang ` and ` php ` is installed.
44
-
44
+
45
45
``` bash
46
46
# If you are using debian like linux system:
47
47
sudo apt install libclang-10-dev php-cli
@@ -76,13 +76,15 @@ fn main() {
76
76
5 . Write you owned extension logic in ` lib.rs ` .
77
77
78
78
``` rust
79
+ use phper :: {php_get_module, modules :: Module };
80
+
79
81
#[php_get_module]
80
82
pub fn get_module (module : & mut Module ) {
81
83
// set module metadata
82
84
module . set_name (env! (" CARGO_PKG_NAME" ));
83
85
module . set_version (env! (" CARGO_PKG_VERSION" ));
84
86
module . set_author (env! (" CARGO_PKG_AUTHORS" ));
85
-
87
+
86
88
// ...
87
89
}
88
90
```
@@ -110,8 +112,8 @@ extension = myapp
110
112
111
113
## examples
112
114
113
- See [ examples] ( examples ) .
115
+ See [ examples] ( https://github.com/jmjoy/phper/tree/master/ examples) .
114
116
115
117
## License
116
118
117
- [ Unlicense] ( LICENSE ) .
119
+ [ Unlicense] ( https://github.com/jmjoy/phper/blob/master/ LICENSE) .
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ phper = "0.2"
68
68
69
69
4. Add these code to `main.rs`.
70
70
71
- ```rust
71
+ ```rust,no_run
72
72
use phper::cmd::make;
73
73
74
74
fn main() {
@@ -79,6 +79,8 @@ fn main() {
79
79
5. Write you owned extension logic in `lib.rs`.
80
80
81
81
```rust
82
+ use phper::{php_get_module, modules::Module};
83
+
82
84
#[php_get_module]
83
85
pub fn get_module(module: &mut Module) {
84
86
// set module metadata
You can’t perform that action at this time.
0 commit comments