Skip to content

Commit 466c165

Browse files
Refactor module paths (#101)
* Refactor module layout * Fixed documentation tests * Removed skel, moved macro crate * Ignore folders for crate publish * Fix builder for zts * Add `rustfmt.toml`, wrap all comments #96 * Fixed up documentation links, tidied up * Add `Zend` prefix to callable and hashtable * Updated guide types * Updated changelog
1 parent f8b5727 commit 466c165

Some content is hidden

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

93 files changed

+4253
-3514
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## Version 0.6.0
4+
5+
- Reorganized project. [#101]
6+
- Changed (almost all) module paths. Too many changes to list them all, check
7+
out the docs.
8+
- Removed `skel` project.
9+
10+
[#101]: https://github.com/davidcole1340/ext-php-rs/pull/101
11+
312
## Version 0.5.3
413

514
- Fixed docs.rs PHP bindings file.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ version = "0.5.3"
99
authors = ["David Cole <[email protected]>"]
1010
edition = "2018"
1111
categories = ["api-bindings"]
12+
exclude = ["/.github", "/.crates", "/guide"]
1213

1314
[dependencies]
1415
bitflags = "1.2.1"
1516
parking_lot = "0.11.2"
16-
ext-php-rs-derive = { version = "=0.5.2", path = "./ext-php-rs-derive" }
17+
ext-php-rs-derive = { version = "=0.5.2", path = "./crates/macros" }
1718

1819
[build-dependencies]
1920
bindgen = { version = "0.59" }
@@ -25,8 +26,7 @@ closure = []
2526

2627
[workspace]
2728
members = [
28-
"ext-php-rs-derive",
29-
"example/skel"
29+
"crates/macros",
3030
]
3131

3232
[package.metadata.docs.rs]

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ easily), structs have to be hard coded in.
8585

8686
Check out one of the example projects:
8787

88-
- [ext-skel](example/skel) - Testbed for testing the library. Check out previous
89-
commits as well to see what else is possible.
9088
- [anonaddy-sequoia](https://gitlab.com/willbrowning/anonaddy-sequoia) - Sequoia
9189
encryption PHP extension.
9290
- [opus-php](https://github.com/davidcole1340/opus-php/tree/rewrite_rs) -

build.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const MAX_PHP_API_VER: u32 = 20200930;
1212

1313
fn main() {
1414
// rerun if wrapper header is changed
15-
println!("cargo:rerun-if-changed=src/wrapper/wrapper.h");
16-
println!("cargo:rerun-if-changed=src/wrapper/wrapper.c");
15+
println!("cargo:rerun-if-changed=src/wrapper.h");
16+
println!("cargo:rerun-if-changed=src/wrapper.c");
1717

1818
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("bindings.rs");
1919

@@ -40,8 +40,8 @@ fn main() {
4040
}
4141

4242
// Ensure the PHP API version is supported.
43-
// We could easily use grep and sed here but eventually we want to support Windows,
44-
// so it's easier to just use regex.
43+
// We could easily use grep and sed here but eventually we want to support
44+
// Windows, so it's easier to just use regex.
4545
let php_i_cmd = Command::new("php")
4646
.arg("-i")
4747
.output()
@@ -71,7 +71,7 @@ fn main() {
7171

7272
// Build `wrapper.c` and link to Rust.
7373
cc::Build::new()
74-
.file("src/wrapper/wrapper.c")
74+
.file("src/wrapper.c")
7575
.includes(
7676
str::replace(includes.as_ref(), "-I", "")
7777
.split(' ')
@@ -80,7 +80,7 @@ fn main() {
8080
.compile("wrapper");
8181

8282
let mut bindgen = bindgen::Builder::default()
83-
.header("src/wrapper/wrapper.h")
83+
.header("src/wrapper.h")
8484
.clang_args(includes.split(' '))
8585
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
8686
.rustfmt_bindings(true)
@@ -143,8 +143,9 @@ impl Configure {
143143
}
144144
}
145145

146-
/// Array of functions/types used in `ext-php-rs` - used to allowlist when generating
147-
/// bindings, as we don't want to generate bindings for everything (i.e. stdlib headers).
146+
/// Array of functions/types used in `ext-php-rs` - used to allowlist when
147+
/// generating bindings, as we don't want to generate bindings for everything
148+
/// (i.e. stdlib headers).
148149
const ALLOWED_BINDINGS: &[&str] = &[
149150
"HashTable",
150151
"_Bucket",

crates/macros/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../.gitignore
File renamed without changes.

crates/macros/LICENSE_APACHE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE_APACHE

crates/macros/LICENSE_MIT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE_MIT

crates/macros/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../README.md

ext-php-rs-derive/src/class.rs renamed to crates/macros/src/class.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl Property {
199199
PropertyType::Field { field_name } => {
200200
let field_name = Ident::new(field_name, Span::call_site());
201201
quote! {
202-
(#name, ::ext_php_rs::php::types::props::Property::field(|obj: &mut Self| &mut obj.#field_name)),
202+
(#name, ::ext_php_rs::props::Property::field(|obj: &mut Self| &mut obj.#field_name)),
203203
}
204204
}
205205
PropertyType::Method { getter, setter } => {
@@ -216,7 +216,7 @@ impl Property {
216216
quote! { None }
217217
};
218218
quote! {
219-
(#name, ::ext_php_rs::php::types::props::Property::method(#getter, #setter)),
219+
(#name, ::ext_php_rs::props::Property::method(#getter, #setter)),
220220
}
221221
}
222222
}

0 commit comments

Comments
 (0)