mintware-de/v8world 问题修复 & 功能扩展

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

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

mintware-de/v8world

最新稳定版本:v1.0.0

Composer 安装命令:

composer require mintware-de/v8world

包简介

A wrapper for the ext-v8js php extension.

README 文档

README

A wrapper for the v8js extension.

Why

Without V8 World

graph LR
  PHP-->|Typed|V8js-->|Untyped|JS
  JS-->|Typed|V8js-->|Rarely typed|PHP
Loading

With V8 World

graph LR
  PHP-->|Typed|V8World-->|Typed|V8js-->|Untyped|JS
  JS-->|Typed|V8js-->|Untyped|V8World-->|Fully Typed*|PHP
Loading

*: The real instance of objects is still an V8Object but the type hints will help you to reduce possible bugs.

How?

  1. The wrapper takes an instance of \V8Js + an $initialState1 class.
  2. The phpdoc tells your IDE that the wrapper is an instance of \V8Js&InitialState.
  3. Your IDE provides autocomplete features and your static analyzer should detect common typing problems.

Example

See _docs/example.md.

Important notes

This package is just a "band-aid for a bullet hole".

  • Since V8World::modify() will not create a new instance of the V8Js object, the old V8World is also affected
    • The IDE will not provide autocompletion for the old V8World object but for the new one.
  • Keep in mind that changing the stubs will not affect the underlying JS code - not even vice versa.
  • Don't trust the stubs if you're working with objects and functions.
    • If a method returns an object or a property holds an instance of an object, V8Js always return an \V8Object
    • If a method returns an function or a property holds an instance of an function, V8Js always return an \V8Function

Footnotes

  1. Usually this should be a stub interface

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固