* Allowlist types generated by bindgen
Tidied up build script as well, layout tests are no longer generated
unless `EXT_PHP_RS_TEST` env variable is set. Much quicker build times
and smaller output size.
* Fix build
* Override Rust toolchain when running CI
* Start work on returning new objects
Change `IntoZval` to consume `self`
* Add conversion from vector reference to PHP hashtable through clones
* `set_binary` now only takes `Vec`
Used to take `AsRef<[T]>` to allow users to pass arrays, however, this
causes the data to be cloned even if the user passes a `Vec`.
* Rename `as_zval` to `into_zval` to match Rust conventions
* Started work on closures
* Finish implementation of closures
* Document closures, add to prelude, feature gate
* Fixed closure example
The object memory is automatically deallocated, however, anything that
has been allocated on the heap (strings, vectors etc.) must be
deallocated while we are freeing the object.
* Panic instead of return result when adding property
This will almost always be unwrapped
* Remove unused `set_refcount` function
Wasn't valid either way
* Add ability to get and set properties on class objects
* Updated documentation adding properties
* Allow returning of object references
`TYPE` is now also on `IntoZval` which means `FromZval` does not need to
be implemented on return types
* Clippy lints
* Replace `ZendObjectOverride` derive macro with `#[php_class]`
* Updated guide with `#[php_class]` macro
* Panic rather than return error when implementing interface
It's gonna panic either way so might as well make it easier for the
builder
* Remove `libc` dependency
* Started work on guide, added types
* Rewrite argument parser to allow referencs
Primarly so that `&str` is a valid parameter type.
* Remove generic `Into<String>` conversion to exception
* Worked on guide, added macros
* Build guide when building docs
* Allow manual trigger of docs build
* `cargo fmt`
* Fix memory leaks with strings and zvals
Add PhpAllocator - not meant for usage, only for memory leak debugging.
* Replace `impl AsRef<str>` with `&str`
* Added `ZendString::as_str()`
* Tidy up
* Replace owned string parameters with `Into<String>`
* Remove backtrace feature, un-import allocator
* Remove uses of `unwrap`, improve library safety
* Started work on `#[php_function]` attribute
* Added `PhantomData` to `ZendHashTable`
Proper lifetimes for `HashTable` type
* `#[php_function]` now accepts `Vec<T>`
Refactored `ZendHashTable` iterators - there is now `Iter` and
`IntoIter` depending on whether it will consume the HashTable or not.
* Add support for nullable types
* Allow `optional` parameter on attribute
* Support primitive and `Option` return types
* Tidied and refactored attribute
* Added documentation for `#[php_function]`
Implemented `IntoZval` for `Option<T>` when `IntoZval` is also
implemented for `T`. `None` resolves to `null`.
* Added `#[php_method]` attribute
* Added `Callable` type, implemented `Drop` on `Zval`
While implementing `Drop`, the `Copy` derivation was removed, however,
this should not have been there in the first place (`Zval` is not valid
for `Copy` if it contains a string).
* Added some macro functions to example
* Add support for boolean arguments
* Added wrapper around binary data
Future support for binary arguments with `#[php_function]` macros.
Unpacking binary data is no longer unsafe. It was never really unsafe in
the beginning, as we were always reading valid memory, just the contents
of the data could not be trusted.
* Added `#[php_module]` attribute, added support for binary arguments
* Added defaults for functions
* Add defaults for methods
* Add startup function macro and prelude
* Refactored method adding
Now done through impl attribute
* Don't rename functions - generate another internal fn
Also hide all generated functions from docs
* Generate startup function when not already defined
* Add support for class and global constants
* Updated `skel` project
* Updated macro documentation, added executor globals
* Remove `Copy` bound for HashMap to Zval
* Updated documentation
* Add `FromZval` trait, updated docs
* Fixed clippy lints
* Fixed ZTS executor globals
* Fix clippy lint
Useful for when you want to throw a custom exception. Store the
reference to the class (which should extend one of the base exceptions)
in a static mutable variable, and then use `throw`.
We cannot implement `IntoIterator` for the `ZendHashTable` object as we
do not manage the memory, therefore we don't actually 'consume' the
object as the trait intends. Therefore, `IntoIterator` is implemented on
`&'a ZendHashTable`. This `ZendHashTable::iter` function simply forwards
the call.
* Object functions now return references to objects
Added ability to get object class name as well as hashtable of
properties
* Return mutable reference to objects
* Optimized `unwrap_or_else` calls
* Fixed adding properties to classes
* Removed unused function from wrapper header
* Moved property functions into `ZendObject`
* Introduced `ZendString` wrapper for raw pointer
* Set refcount of Zval to 0 when setting string properties
* Added ability to check if a property exists
Made some lifetimes explicit, check if property exists before attempting
to get.
* Removed unused file
* Removed unused lifetimes
Clippy was complaining, they were added to ensure that a `'static`
lifetime wasn't returned.