Skip to content

Commit fa05703

Browse files
committed
Release v0.7.0
1 parent 6df362b commit fa05703

File tree

5 files changed

+60
-5
lines changed

5 files changed

+60
-5
lines changed

CHANGELOG.md

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

3+
## Version 0.7.0
4+
5+
- Disabled serialization and unserialization of Rust structs exported as PHP
6+
classes. [#105]
7+
- You can't serialize an associated Rust struct so this would have never
8+
worked, but disabling them fixes crashes when running in an environment like
9+
psysh.
10+
- Replaced boxed module inside `ModuleBuilder` with in-struct module.
11+
- Fixed builds failing on Linux AArch64 systems. [#106]
12+
- Added `cargo-php` for creating stubs, installing and uninstalling extensions.
13+
[#107]
14+
- Check out the guide for more information on this.
15+
16+
[#105]: https://github.com/davidcole1340/ext-php-rs/pull/105
17+
[#106]: https://github.com/davidcole1340/ext-php-rs/pull/106
18+
[#107]: https://github.com/davidcole1340/ext-php-rs/pull/107
19+
320
## Version 0.6.0
421

522
- Reorganized project. [#101]

Cargo.toml

Lines changed: 2 additions & 2 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.6.0"
8+
version = "0.7.0"
99
authors = ["David Cole <david.cole1340@gmail.com>"]
1010
edition = "2018"
1111
categories = ["api-bindings"]
@@ -14,7 +14,7 @@ exclude = ["/.github", "/.crates", "/guide"]
1414
[dependencies]
1515
bitflags = "1.2.1"
1616
parking_lot = "0.11.2"
17-
ext-php-rs-derive = { version = "=0.6.0", path = "./crates/macros" }
17+
ext-php-rs-derive = { version = "=0.7.0", path = "./crates/macros" }
1818

1919
[build-dependencies]
2020
bindgen = { version = "0.59" }

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ Export a simple function `function hello_world(string $name): string` to PHP:
1212
```rust
1313
use ext_php_rs::prelude::*;
1414

15+
/// Gives you a nice greeting!
16+
///
17+
/// @param string $name Your name.
18+
///
19+
/// @return string Nice greeting!
1520
#[php_function]
1621
pub fn hello_world(name: String) -> String {
1722
format!("Hello, {}!", name)
@@ -24,6 +29,37 @@ pub fn module(module: ModuleBuilder) -> ModuleBuilder {
2429
}
2530
```
2631

32+
Use [`cargo-php`] to build IDE stubs and install the extension:
33+
34+
```text
35+
$ cargo install cargo-php
36+
Installing cargo-php v0.1.0
37+
$ cargo php stubs --stdout
38+
Compiling example-ext v0.1.0
39+
Finished dev [unoptimized + debuginfo] target(s) in 3.57s
40+
<?php
41+
42+
// Stubs for example-ext
43+
44+
/**
45+
* Gives you a nice greeting!
46+
*
47+
* @param string $name Your name.
48+
*
49+
* @return string Nice greeting!
50+
*/
51+
function hello_world(string $name): string {}
52+
$ cargo php install --release
53+
Compiling example-ext v0.1.0
54+
Finished release [optimized] target(s) in 1.68s
55+
Are you sure you want to install the extension `example-ext`? yes
56+
$ php -m
57+
[PHP Modules]
58+
// ...
59+
example-ext
60+
// ...
61+
```
62+
2763
Calling the function from PHP:
2864

2965
```php
@@ -33,6 +69,8 @@ var_dump(hello_world("David")); // string(13) "Hello, David!"
3369
For more examples read the library
3470
[guide](https://davidcole1340.github.io/ext-php-rs/guide).
3571

72+
[`cargo-php`]: https://crates.io/crates/cargo-php
73+
3674
## Features
3775

3876
- **Easy to use:** The built-in macros can abstract away the need to interact

crates/cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ edition = "2018"
1111
categories = ["api-bindings", "command-line-interface"]
1212

1313
[dependencies]
14-
ext-php-rs = { version = "0.6", path = "../../" }
14+
ext-php-rs = { version = "0.7", path = "../../" }
1515

1616
clap = "3.0.0-beta.5"
1717
anyhow = "1"
1818
dialoguer = "0.9"
1919
libloading = "0.7"
20-
cargo_metadata = "0.14"
20+
cargo_metadata = "0.14"

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.6.0"
7+
version = "0.7.0"
88
authors = ["David Cole <david.cole1340@gmail.com>"]
99
edition = "2018"
1010

0 commit comments

Comments
 (0)