Skip to content

Releases: swoole/phpy

1.0.11

05 Mar 10:00

Choose a tag to compare

  1. Added PyCore::raise() to throw exceptions to the Python layer.
  2. Added PyClass to convert PHP classes into Python classes.
  3. Introduced the PyNamedFn function, which converts PHP functions into Python functions, complete with annotations, parameters, and return type information.
  4. Added the PyEnum function to transform PHP classes containing only constants into Python Enums.
  5. Introduced the bin/phpy tool.
  6. Added the argument_as_object option.
  7. Fixed a bug in PyTuple::offsetExists where it returned false for negative input parameters.
  8. Only exact tuples, sets, lists, and dicts are converted to PyTuple, PySet, PyList, and PyDict subtypes; otherwise, they are treated as PyObject.
  9. Resolved the issue with --with-python-dir not working.
  10. Fixed PyObject::offsetExists to no longer use PyMapping::hasKey.
  11. Added a PyClass::__init() callback, which is invoked within the init method of Python classes.

1.0.6

21 Aug 08:11

Choose a tag to compare

  • 支持 PECL 安装

1.0.5

31 May 03:25

Choose a tag to compare

中文

  • 增加了 PyCore::fileno($fp) 用于获取 PHP Stream 的文件描述符,以转为 Python Socket 对象
  • 增加了 PyCore::setOptions 修改设置内部选项的值
  • 增加了 numeric_as_object 选项,可使对象调用返回值返回的数字类型,包括整数和浮点数作为 PyObject 对象
  • 修复了默认字符集与 python-cli 存在差异的问题
  • 修复了 PyFn 构造方法不可用的问题
  • 修复了被 Python 引用后的资源类型、引用类型对象在 php-fpm 未在请求结束后销毁的问题

English

  • Added PyCore::fileno($fp) to obtain the file descriptor of a PHP Stream for conversion to a Python Socket object
  • Added PyCore::setOptions to modify the value of internal options
  • Added numeric_as_object option, allowing numeric return types, including integers and floats, to be returned as PyObject objects
  • Fixed the issue with the default character set differing from python-cli
  • Fixed the issue where the PyFn constructor was not usable
  • Fixed the issue where resource and reference type objects referenced by Python were not destroyed after the request ended in php-fpm

v1.0.4

24 Jan 05:39

Choose a tag to compare

  • 支持 Linux Alpine 平台
  • 在 PyObject 基类中实现 ArrayAccess、Iterator、Countable 接口
  • PyCore::next() 可以返回任意类型
  • 修复 Python Enum 被错误地转为了 Int
  • 抛出异常代替打印错误
  • 增加 phpy_display_exception 环境变量设置,开启后不再抛出异常而是直接打印异常内容
  • Windows 二进制包增加了 mbstring 扩展

v1.0.3

10 Jan 08:01

Choose a tag to compare

Fix crash when dict/set has undefined behavior