Commit Graph

28 Commits

Author SHA1 Message Date
Pierre Tondereau
1a8211c392
chore: Bump Bindgen to 0.68.1 (#271) 2023-10-20 14:44:47 +02:00
eff7b0195f
Merge pull request #225 from davidcole1340/ini-definitions
Support registering ini definitions for modules
2023-10-10 15:32:00 +02:00
e820b2458a Fix 2023-10-10 14:55:40 +03:00
e1672beb98 Update bindings 2023-10-10 12:43:22 +03:00
f669891931
Merge remote-tracking branch 'origin/master' 2023-08-27 16:58:22 +02:00
Joe Hoyle
7b47b46cfb Merge branch 'master' into ini-definitions 2023-07-19 15:00:59 +02:00
Joe Hoyle
42ef04a8ae
Add function type_() method (#254) 2023-07-19 13:15:36 +02:00
Joe Hoyle
3e378f8cdf
Add function for requesting VM interrupt (#257) 2023-07-19 13:12:35 +02:00
Joe Hoyle
a9dffe08f5
Add ability to show PHP warnings (etc) (#231)
* Add ability to show PHP warnings (etc)

I don't believe there's a way for extensions to trigger PHP notices or warnings currently. This is done using the `php_error_docref` function. I've placed a function in `ext_php_rs::php_error()` however, there might be a better place?

* Remove uneeded empty value

* Fix url
2023-07-18 22:40:24 +02:00
Joe Hoyle
a7780753dc Support registering ini definitions for modules
PHP extensions that want to provide ini settings can do so using `IniEntryDef::register()`; values can then be fetched via `GlobalExecutor::ini_values()`.
2023-07-13 14:42:08 +02:00
751d4f4d04
Refactoring 2023-06-22 13:31:56 +02:00
Pierre Tondereau
63a76846d2
chore: Update bindgen to 0.65.1 (#241) 2023-05-16 22:49:57 +02:00
Joe Hoyle
1f9946f105
Switch to use zend apis for array iteration (#240) 2023-05-16 22:33:45 +02:00
Christian Rades
87ac43d05e
Add is_identical for zvals (#217) 2023-01-19 12:40:24 +01:00
Pierre Tondereau
11e0998bc4
feat: Add support for PHP 8.2 (#212)
## Small Fixes due to PHP8.2 upgrade:
- Internal PHP `ZendHashmap` changed the way that we access to the bucket ([commit](90b7bde615 (diff-dca4782c62f10b418ea7193e4641e688ffd7a9c97869f2b1a3a96e28da5653aaL371)))
- Internal PHP `ArrayIterator` doesn't support parent `get_iterator` ([commit](15bbf6f337 (diff-bc002b59b592b4d44c13d898f9dc3ca60b1b1c8505a51a2a3557dfde51dfeb61L273)))
2022-12-20 17:11:35 +01:00
Pierre Tondereau
6965f4a198
Prepare v0.9.0 (#211) 2022-12-11 22:10:25 +01:00
Niklas Mollenhauer
24d703d955
Add some standard zend interfaces (#164)
* Add some standard zend interfaces

The zend API also has some standard interfaces it exposes:
c8c09b4aae/Zend/zend_interfaces.h (L27-L33)
```
extern ZEND_API zend_class_entry *zend_ce_traversable;
extern ZEND_API zend_class_entry *zend_ce_aggregate;
extern ZEND_API zend_class_entry *zend_ce_iterator;
extern ZEND_API zend_class_entry *zend_ce_arrayaccess;
extern ZEND_API zend_class_entry *zend_ce_serializable;
extern ZEND_API zend_class_entry *zend_ce_countable;
extern ZEND_API zend_class_entry *zend_ce_stringable;
```

This surfaced in #163 and should make it possible to implement these interfaces.

* Add some links to the php documentation

* update docs.rs bindings

Co-authored-by: David Cole <david.cole1340@gmail.com>
2022-10-16 13:13:09 +13:00
David Cole
6a598ded3d
fix building docs on docs.rs (#165)
* fix building docs on docs.rs

accidentally removed the docs.rs stub bindings feature in
664981f4fb. docs.rs only has php 7.4 and
therefore cannot build ext-php-rs, so stub bindings are generated prior.

* update docs.rs stub bindings
2022-10-16 12:49:02 +13:00
David Cole
75ea32346c
Fix CI on macOS (#126)
* Attempt to fix CI on macOS by not installing LLVM

* Download LLVM even on macOS

* Only set LIBCLANG_PATH on non-macOS

* Fix yaml

* Try to set SDK path for macOS

* Multi-line run

* Clippy lint

* Only check docs on PHP 8.1

* When running with docs stub, use PHP 8.1

* Only build docs on Ubuntu

* Remove `macos-ci` branch from actions

* Trigger actions
2022-03-06 16:01:27 +13:00
David Cole
8a1fecd431 Updated docs.rs bindings 2022-02-24 22:47:56 +13:00
David Cole
a776d3eaae Fix CI on macOS + docs stubs 2022-02-22 11:24:39 +13:00
David Cole
88b84b9a17
Disable serialization and unserialization on classes (#105)
* Disable serialization and unserialization on classes

Classes that have associated Rust types cannot be serialized for
obvious reasons so these need to be disabled. Disabling these actions
changes in PHP 8.1 to use a flag, so that will need to be solved with
PHP 8.1 support. Closes #97

* update docs stubs
2021-10-19 02:10:02 +13:00
David Cole
7812b7ff1e Test docs.rs stub file in lint build 2021-10-10 22:57:38 +13:00
David Cole
50b70c28cc Fix doc bindings 2021-10-07 04:22:50 +13:00
David
1e41b50100
Prepared for v0.5.0 release (#79)
- Bumped versions
- Updated changelog
- Updated docs.rs bindings
- Updated documentation about rename methods
2021-09-28 01:31:55 +13:00
David
afdac8e4b3
Add support for field and method properties (#69)
* Rough implementation of struct properties

* Store properties hashtable once

* Tidy up handler functions with exceptions

* Add stub `get_properties` function for codegen structs

* Remove nightly features

* Revert storing properties

Technically, the zend object _could_ move in memory, leaving dangling
references in the properties hashtable. We will just build the hashtable
when required.

* Added `#[prop]` attribute

* Add pointer type to zval, tidy up zend string

* Add support for method properties

* Add `#[getter]` and `#[setter]` attributes

* Update documentation with method properties

* Tidy up macros code

* Remove string gc checks (done on PHP side)

* Move `RegisteredClass` implementation to module, update docs

* Fix read property `rv` segfault

* Fixed doctests
2021-09-28 00:54:23 +13:00
David
f506a41b3c
Pass class object type to PHP when taking object parameter (#64)
* Pass class object type to PHP when taking object parameter

* Fix test

* Update docs.rs stub bindings
2021-09-08 22:21:21 +12:00
David Cole
356c1fdd97 Add support for docs.rs (hopefully) 2021-09-05 18:18:09 +12:00