terablaze/serializable-closure 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

terablaze/serializable-closure

Composer 安装命令:

composer require terablaze/serializable-closure

包简介

Terablaze Serializable Closure provides an easy and secure way to serialize closures in PHP.

README 文档

README

Build Status License

Introduction

This project is a fork laravel/serializable-closure package, which is a fork of the excellent opis/closure: 3.x package.

Terablaze Serializable Closure provides an easy and secure way to serialize closures in PHP.

Official Documentation

Installation

Requires PHP 7.4+

First, install Terablaze Serializable Closure via the Composer package manager:

composer require terablaze/serializable-closure

Usage

You may serialize a closure this way:

use Terablaze\SerializableClosure\SerializableClosure;

$closure = fn () => 'james';

// Recommended
SerializableClosure::setSecretKey('secret');

$serialized = serialize(new SerializableClosure($closure));
$closure = unserialize($serialized)->getClosure();

echo $closure(); // james;

Caveats

  1. Creating anonymous classes within closures is not supported.
  2. Using attributes within closures is not supported.
  3. Serializing closures on REPL environments such as Terablaze Repl is not supported.

License

Serializable Closure is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 47
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固