Skip to content

Commit

Permalink
fixups to enum support
Browse files Browse the repository at this point in the history
* closes #173
* fixes #171
  • Loading branch information
m6w6 committed Aug 19, 2024
1 parent 93fe730 commit 4ade6c3
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 24 deletions.
52 changes: 40 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,38 @@ jobs:
run: |
make -f scripts/ci/Makefile test
cur-none-0:
name: php-8.2-nodebug-nozts
cur-matrix-2:
name: php-8.2-debug-zts
env:
PHP: "8.2"
enable_debug: "yes"
enable_zts: "yes"
enable_session: "yes"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install
run: |
sudo apt-get install -y \
php-cli \
php-pear \
re2c
- name: Prepare
run: |
make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
- name: Build
run: |
make -f scripts/ci/Makefile ext PECL=msgpack
- name: Test
run: |
make -f scripts/ci/Makefile test
cur-none-0:
name: php-8.3-nodebug-nozts
env:
PHP: "8.3"
enable_session: "no"
runs-on: ubuntu-20.04
steps:
Expand All @@ -259,9 +287,9 @@ jobs:
make -f scripts/ci/Makefile test
cur-dbg-zts-0:
name: php-8.2-debug-zts
name: php-8.3-debug-zts
env:
PHP: "8.2"
PHP: "8.3"
enable_debug: "yes"
enable_zts: "yes"
enable_session: "yes"
Expand All @@ -287,9 +315,9 @@ jobs:
make -f scripts/ci/Makefile test
cur-dbg-zts-1:
name: php-8.2-nodebug-zts
name: php-8.3-nodebug-zts
env:
PHP: "8.2"
PHP: "8.3"
enable_debug: "no"
enable_zts: "yes"
enable_session: "yes"
Expand All @@ -315,9 +343,9 @@ jobs:
make -f scripts/ci/Makefile test
cur-dbg-zts-2:
name: php-8.2-debug-nozts
name: php-8.3-debug-nozts
env:
PHP: "8.2"
PHP: "8.3"
enable_debug: "yes"
enable_zts: "no"
enable_session: "yes"
Expand All @@ -343,9 +371,9 @@ jobs:
make -f scripts/ci/Makefile test
cur-dbg-zts-3:
name: php-8.2-nodebug-nozts
name: php-8.3-nodebug-nozts
env:
PHP: "8.2"
PHP: "8.3"
enable_debug: "no"
enable_zts: "no"
enable_session: "yes"
Expand All @@ -371,11 +399,11 @@ jobs:
make -f scripts/ci/Makefile test
cur-cov-0:
name: php-8.2-nodebug-nozts
name: php-8.3-nodebug-nozts
env:
CFLAGS: "-O0 -g --coverage"
CXXFLAGS: "-O0 -g --coverage"
PHP: "8.2"
PHP: "8.3"
enable_session: "yes"
runs-on: ubuntu-20.04
steps:
Expand Down
17 changes: 8 additions & 9 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,20 @@
<email>[email protected]</email>
<active>yes</active>
</lead>
<date>2023-06-02</date>
<date>2024-08-30</date>
<version>
<release>2.2.0</release>
<api>2.2.0</api>
<release>3.0.0</release>
<api>3.0.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license filesource="LICENSE">3-Clause-BSD</license>
<notes><![CDATA[
No changes from RC2.
* RC2:
* Fix PHP-8.2 compatibility (see gh issue #165)
* RC1:
* Fix PHP-8.1 compatibility (see gh issues #161, #157, and #156)
* Add support for ZEND_ACC_NOT_SERIALIZABLE and magic __{,un}serialize
* Add support for PHP-8.1 Enums
* merges #173
* fixes #171
]]></notes>
<contents>
<dir name="/">
Expand Down Expand Up @@ -191,6 +188,7 @@ No changes from RC2.
<file name="bug011.phpt" role="test" />
<file name="bug012.phpt" role="test" />
<file name="bug013.phpt" role="test" />
<file name="enum001.phpt" role="test" />
<file name="issue023.phpt" role="test" />
<file name="issue067.phpt" role="test" />
<file name="issue067_32bit.phpt" role="test" />
Expand All @@ -205,6 +203,7 @@ No changes from RC2.
<file name="issue139.phpt" role="test" />
<file name="issue149.phpt" role="test" />
<file name="issue149.ser.txt" role="test" />
<file name="issue171.phpt" role="test" />
</dir>
</dir>
</contents>
Expand Down
2 changes: 1 addition & 1 deletion php_msgpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "Zend/zend_smart_str.h" /* for smart_string */

#define PHP_MSGPACK_VERSION "2.2.0"
#define PHP_MSGPACK_VERSION "3.0.0"

extern zend_module_entry msgpack_module_entry;
#define phpext_msgpack_ptr &msgpack_module_entry
Expand Down
4 changes: 2 additions & 2 deletions scripts/gen_github_workflow_ci.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function jobname(string $id, array $env) : string {
return sprintf("php-%s-%s-%s", $env["PHP"], yesno($env, "debug"), yesno($env, "zts"));
}
$gen = include __DIR__ . "/ci/gen-matrix.php";
$cur = "8.2";
$cur = "8.3";
$job = $gen->github([
"old-matrix" => [
// most useful for all additional versions except current
Expand All @@ -42,7 +42,7 @@ function jobname(string $id, array $env) : string {
],
"cur-matrix" => [
// most useful for all additional versions except current
"PHP" => ["8.0", "8.1"],
"PHP" => ["8.0", "8.1", "8.2"],
"enable_debug" => "yes",
"enable_zts" => "yes",
"enable_session" => "yes",
Expand Down
19 changes: 19 additions & 0 deletions tests/enum001.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--TEST--
Enums
--FILE--
<?php
echo "Test\n";
enum Enum {
case A;
case B;
case C;
}
$a = [Enum::A,Enum::B,Enum::C];
$b = msgpack_unpack(msgpack_pack([Enum::A,Enum::B,Enum::C]));
var_dump($a == $b);
?>
DONE
--EXPECT--
Test
bool(true)
DONE

0 comments on commit 4ade6c3

Please sign in to comment.