Skip to content

Commit 6965f4a

Browse files
authored
Prepare v0.9.0 (#211)
1 parent 4ca5c0d commit 6965f4a

File tree

9 files changed

+78
-39
lines changed

9 files changed

+78
-39
lines changed

.github/actions/zts/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:zts
1+
FROM php:8.1-zts
22

33
WORKDIR /tmp
44

CHANGELOG.md

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

3+
## Version 0.9.0
4+
5+
- ci+docs: honour PHP_CONFIG & rebuild automatically when env vars change by @julius [#210]
6+
- chore: Update generated FFI bindings with bindgen 0.63 by @ptondereau [#211]
7+
8+
**BC changes**
9+
- feat: allows ZendStr to contain null bytes by @julius [#202]
10+
11+
**Migration**
12+
See: [#202]
13+
14+
[#202]: https://github.com/davidcole1340/ext-php-rs/pull/202
15+
[#210]: https://github.com/davidcole1340/ext-php-rs/pull/210
16+
[#211]: https://github.com/davidcole1340/ext-php-rs/pull/211
17+
18+
19+
## Version 0.8.3
20+
21+
- build: Check docs warnings in CI by @davidcole1340 in [#180]
22+
- fix: Fixes inifinte loop in ClassEntry::instance_of() by @ju1ius in [#188]
23+
- fix: Fix binary slice lifetimes by @davidcole1340 in [#181]
24+
- build: Fixes CI workflow configuration by @ju1ius in [#195]
25+
- feat: Add get_id() and hash() methods on ZendObject by @ju1ius in [#196]
26+
- docs: Describes restrictions on generic parameters for `php_class` by @ju1ius in [#194]
27+
- feat: Add instance_of() and get_class_entry() methods on ZendObject by @ju1ius in [#197]
28+
29+
[#180]: https://github.com/davidcole1340/ext-php-rs/pull/180
30+
[#188]: https://github.com/davidcole1340/ext-php-rs/pull/188
31+
[#181]: https://github.com/davidcole1340/ext-php-rs/pull/181
32+
[#195]: https://github.com/davidcole1340/ext-php-rs/pull/195
33+
[#196]: https://github.com/davidcole1340/ext-php-rs/pull/196
34+
[#194]: https://github.com/davidcole1340/ext-php-rs/pull/194
35+
[#197]: https://github.com/davidcole1340/ext-php-rs/pull/197
36+
337
## Version 0.8.2
438

539
- Update changelog for latest versions by @striezel in [#161]

Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repository = "https://github.com/davidcole1340/ext-php-rs"
55
homepage = "https://github.com/davidcole1340/ext-php-rs"
66
license = "MIT OR Apache-2.0"
77
keywords = ["php", "ffi", "zend"]
8-
version = "0.8.3"
8+
version = "0.9.0"
99
authors = ["David Cole <david.cole1340@gmail.com>"]
1010
edition = "2018"
1111
categories = ["api-bindings"]
@@ -17,15 +17,14 @@ parking_lot = "0.12.1"
1717
cfg-if = "1.0"
1818
once_cell = "1.8.0"
1919
anyhow = { version = "1", optional = true }
20-
ext-php-rs-derive = { version = "=0.8.2", path = "./crates/macros" }
20+
ext-php-rs-derive = { version = "=0.9.0", path = "./crates/macros" }
2121

2222
[dev-dependencies]
2323
skeptic = "0.13"
2424

2525
[build-dependencies]
2626
anyhow = "1"
27-
# bindgen = { version = "0.59" }
28-
bindgen = "0.60"
27+
bindgen = "0.63"
2928
cc = "1.0"
3029
skeptic = "0.13"
3130

build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ fn main() -> Result<()> {
232232
println!("cargo:rerun-if-env-changed={}", env_var);
233233
}
234234

235+
println!("cargo:rerun-if-changed=build.rs");
236+
235237
// docs.rs runners only have PHP 7.4 - use pre-generated bindings
236238
if env::var("DOCS_RS").is_ok() {
237239
println!("cargo:warning=docs.rs detected - using stub bindings");

crates/macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description = "Derive macros for ext-php-rs."
44
repository = "https://github.com/davidcole1340/ext-php-rs"
55
homepage = "https://github.com/davidcole1340/ext-php-rs"
66
license = "MIT OR Apache-2.0"
7-
version = "0.8.2"
7+
version = "0.9.0"
88
authors = ["David Cole <david.cole1340@gmail.com>"]
99
edition = "2018"
1010

docsrs_bindings.rs

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* automatically generated by rust-bindgen 0.60.1 */
1+
/* automatically generated by rust-bindgen 0.63.0 */
22

33
pub const ZEND_DEBUG: u32 = 1;
44
pub const _ZEND_TYPE_NAME_BIT: u32 = 16777216;
@@ -88,8 +88,11 @@ pub const CONST_CS: u32 = 0;
8888
pub const CONST_PERSISTENT: u32 = 1;
8989
pub const CONST_NO_FILE_CACHE: u32 = 2;
9090
pub const CONST_DEPRECATED: u32 = 4;
91-
pub type __darwin_size_t = ::std::os::raw::c_ulong;
92-
pub type size_t = __darwin_size_t;
91+
#[repr(C)]
92+
#[derive(Debug, Copy, Clone)]
93+
pub struct __sigset_t {
94+
pub __val: [::std::os::raw::c_ulong; 16usize],
95+
}
9396
pub type zend_long = i64;
9497
pub type zend_ulong = u64;
9598
pub type zend_uchar = ::std::os::raw::c_uchar;
@@ -200,7 +203,7 @@ pub struct _zend_refcounted {
200203
pub struct _zend_string {
201204
pub gc: zend_refcounted_h,
202205
pub h: zend_ulong,
203-
pub len: size_t,
206+
pub len: usize,
204207
pub val: [::std::os::raw::c_char; 1usize],
205208
}
206209
#[repr(C)]
@@ -282,7 +285,7 @@ pub struct _zend_ast_ref {
282285
}
283286
extern "C" {
284287
pub fn _emalloc(
285-
size: size_t,
288+
size: usize,
286289
__zend_filename: *const ::std::os::raw::c_char,
287290
__zend_lineno: u32,
288291
__zend_orig_filename: *const ::std::os::raw::c_char,
@@ -299,12 +302,12 @@ extern "C" {
299302
);
300303
}
301304
extern "C" {
302-
pub fn __zend_malloc(len: size_t) -> *mut ::std::os::raw::c_void;
305+
pub fn __zend_malloc(len: usize) -> *mut ::std::os::raw::c_void;
303306
}
304307
pub type zend_string_init_interned_func_t = ::std::option::Option<
305308
unsafe extern "C" fn(
306309
str_: *const ::std::os::raw::c_char,
307-
size: size_t,
310+
size: usize,
308311
permanent: bool,
309312
) -> *mut zend_string,
310313
>;
@@ -318,7 +321,7 @@ extern "C" {
318321
pub fn zend_hash_str_update(
319322
ht: *mut HashTable,
320323
key: *const ::std::os::raw::c_char,
321-
len: size_t,
324+
len: usize,
322325
pData: *mut zval,
323326
) -> *mut zval;
324327
}
@@ -333,7 +336,7 @@ extern "C" {
333336
pub fn zend_hash_str_del(
334337
ht: *mut HashTable,
335338
key: *const ::std::os::raw::c_char,
336-
len: size_t,
339+
len: usize,
337340
) -> zend_result;
338341
}
339342
extern "C" {
@@ -343,7 +346,7 @@ extern "C" {
343346
pub fn zend_hash_str_find(
344347
ht: *const HashTable,
345348
key: *const ::std::os::raw::c_char,
346-
len: size_t,
349+
len: usize,
347350
) -> *mut zval;
348351
}
349352
extern "C" {
@@ -546,7 +549,7 @@ pub struct _zend_class_entry {
546549
unsafe extern "C" fn(
547550
object: *mut zval,
548551
buffer: *mut *mut ::std::os::raw::c_uchar,
549-
buf_len: *mut size_t,
552+
buf_len: *mut usize,
550553
data: *mut zend_serialize_data,
551554
) -> ::std::os::raw::c_int,
552555
>,
@@ -555,7 +558,7 @@ pub struct _zend_class_entry {
555558
object: *mut zval,
556559
ce: *mut zend_class_entry,
557560
buf: *const ::std::os::raw::c_uchar,
558-
buf_len: size_t,
561+
buf_len: usize,
559562
data: *mut zend_unserialize_data,
560563
) -> ::std::os::raw::c_int,
561564
>,
@@ -980,7 +983,15 @@ pub struct _zend_execute_data {
980983
pub run_time_cache: *mut *mut ::std::os::raw::c_void,
981984
pub extra_named_params: *mut zend_array,
982985
}
983-
pub type sigjmp_buf = [::std::os::raw::c_int; 49usize];
986+
pub type __jmp_buf = [::std::os::raw::c_long; 8usize];
987+
#[repr(C)]
988+
#[derive(Debug, Copy, Clone)]
989+
pub struct __jmp_buf_tag {
990+
pub __jmpbuf: __jmp_buf,
991+
pub __mask_was_saved: ::std::os::raw::c_int,
992+
pub __saved_mask: __sigset_t,
993+
}
994+
pub type jmp_buf = [__jmp_buf_tag; 1usize];
984995
pub type zend_executor_globals = _zend_executor_globals;
985996
extern "C" {
986997
pub static mut executor_globals: zend_executor_globals;
@@ -1041,7 +1052,7 @@ pub struct _zend_executor_globals {
10411052
pub symtable_cache_ptr: *mut *mut zend_array,
10421053
pub symbol_table: zend_array,
10431054
pub included_files: HashTable,
1044-
pub bailout: *mut sigjmp_buf,
1055+
pub bailout: *mut jmp_buf,
10451056
pub error_reporting: ::std::os::raw::c_int,
10461057
pub exit_status: ::std::os::raw::c_int,
10471058
pub function_table: *mut HashTable,
@@ -1050,7 +1061,7 @@ pub struct _zend_executor_globals {
10501061
pub vm_stack_top: *mut zval,
10511062
pub vm_stack_end: *mut zval,
10521063
pub vm_stack: zend_vm_stack,
1053-
pub vm_stack_page_size: size_t,
1064+
pub vm_stack_page_size: usize,
10541065
pub current_execute_data: *mut _zend_execute_data,
10551066
pub fake_scope: *mut zend_class_entry,
10561067
pub jit_trace_num: u32,
@@ -1147,7 +1158,7 @@ pub struct _zend_module_entry {
11471158
>,
11481159
pub info_func: ::std::option::Option<unsafe extern "C" fn(zend_module: *mut zend_module_entry)>,
11491160
pub version: *const ::std::os::raw::c_char,
1150-
pub globals_size: size_t,
1161+
pub globals_size: usize,
11511162
pub globals_ptr: *mut ::std::os::raw::c_void,
11521163
pub globals_ctor:
11531164
::std::option::Option<unsafe extern "C" fn(global: *mut ::std::os::raw::c_void)>,
@@ -1209,7 +1220,7 @@ extern "C" {
12091220
pub fn zend_declare_property(
12101221
ce: *mut zend_class_entry,
12111222
name: *const ::std::os::raw::c_char,
1212-
name_length: size_t,
1223+
name_length: usize,
12131224
property: *mut zval,
12141225
access_type: ::std::os::raw::c_int,
12151226
);
@@ -1218,7 +1229,7 @@ extern "C" {
12181229
pub fn zend_declare_class_constant(
12191230
ce: *mut zend_class_entry,
12201231
name: *const ::std::os::raw::c_char,
1221-
name_length: size_t,
1232+
name_length: usize,
12221233
value: *mut zval,
12231234
);
12241235
}
@@ -1284,7 +1295,7 @@ extern "C" {
12841295
pub fn zend_wrong_parameters_count_error(min_num_args: u32, max_num_args: u32);
12851296
}
12861297
extern "C" {
1287-
pub fn php_printf(format: *const ::std::os::raw::c_char, ...) -> size_t;
1298+
pub fn php_printf(format: *const ::std::os::raw::c_char, ...) -> usize;
12881299
}
12891300
#[repr(C)]
12901301
#[derive(Debug, Copy, Clone)]
@@ -1316,7 +1327,7 @@ pub struct _zend_ini_entry {
13161327
extern "C" {
13171328
pub fn zend_register_bool_constant(
13181329
name: *const ::std::os::raw::c_char,
1319-
name_len: size_t,
1330+
name_len: usize,
13201331
bval: bool,
13211332
flags: ::std::os::raw::c_int,
13221333
module_number: ::std::os::raw::c_int,
@@ -1325,7 +1336,7 @@ extern "C" {
13251336
extern "C" {
13261337
pub fn zend_register_long_constant(
13271338
name: *const ::std::os::raw::c_char,
1328-
name_len: size_t,
1339+
name_len: usize,
13291340
lval: zend_long,
13301341
flags: ::std::os::raw::c_int,
13311342
module_number: ::std::os::raw::c_int,
@@ -1334,7 +1345,7 @@ extern "C" {
13341345
extern "C" {
13351346
pub fn zend_register_double_constant(
13361347
name: *const ::std::os::raw::c_char,
1337-
name_len: size_t,
1348+
name_len: usize,
13381349
dval: f64,
13391350
flags: ::std::os::raw::c_int,
13401351
module_number: ::std::os::raw::c_int,
@@ -1343,7 +1354,7 @@ extern "C" {
13431354
extern "C" {
13441355
pub fn zend_register_string_constant(
13451356
name: *const ::std::os::raw::c_char,
1346-
name_len: size_t,
1357+
name_len: usize,
13471358
strval: *const ::std::os::raw::c_char,
13481359
flags: ::std::os::raw::c_int,
13491360
module_number: ::std::os::raw::c_int,

guide/src/getting-started/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ cd php-src
5252
git checkout PHP-8.1
5353
./buildconf
5454
PREFIX="${HOME}/build/php"
55-
.configure --prefix="${PREFIX}" \
55+
./configure --prefix="${PREFIX}" \
5656
--enable-debug \
5757
--disable-all --disable-cgi
5858
make -j "$(nproc)"

src/builders/class.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ impl ClassBuilder {
284284
zend_declare_class_constant(
285285
class,
286286
CString::new(name.as_str())?.as_ptr(),
287-
name.len() as u64,
287+
name.len(),
288288
value,
289289
)
290290
};

src/types/array.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,7 @@ impl ZendHashTable {
312312
V: IntoZval,
313313
{
314314
let mut val = val.into_zval(false)?;
315-
unsafe {
316-
zend_hash_str_update(
317-
self,
318-
CString::new(key)?.as_ptr(),
319-
key.len() as u64,
320-
&mut val,
321-
)
322-
};
315+
unsafe { zend_hash_str_update(self, CString::new(key)?.as_ptr(), key.len(), &mut val) };
323316
val.release();
324317
Ok(())
325318
}

0 commit comments

Comments
 (0)