定制 weavephp/weave 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

weavephp/weave

Composer 安装命令:

composer require weavephp/weave

包简介

Weave glue-framework Core

README 文档

README

Imagine being 7 years old again, with some friends, playing after school. You've got a huge box full of dressing up stuff and limitless imagination. You want to play super-heros? There's stuff for that. How about film stars? Or the Wild West? Or fantasy worlds with Orcs and Elves? It's all in the dressing up box. All the tops, trousers, dresses, shoes, hats, foam swords, plastic laser guns and sparkly amulets you'd ever want to bring your creations to life.

In the world of PHP, Packagist is packed to the hilt with the code equiv. of foam swords and hats - there are limitless combinations. But if you are trying to assemble a well known group of packages, such as for a micro-framework middleware stack, there's still a lot of work and boilerplate to stick all the bits together. So, to save others the effort, there are some party-costume packs of ready-grouped clothes and accessories you can just pick off the rack. Everything you need to achieve that space-pirate look.

But what if you want to be a space-pirate with a foam sword and a big hat NOT the space-pirate someone else decided you would want, with the plastic laser gun and the clear plastic space helmet? Unfortunately, in code, it's often not as easy as swapping swords with your best friend.

When it comes to PHP frameworks, it would be great to have the freedom to pick the bits you want from the dressing up box but without the effort of then having to tie it all together by hand.

Welcome to Weave.

Anatomy of a Micro-Framework

Whichever micro-framework you look at, they all have the same basic components (give or take):

  • Configuration
  • Error Handler
  • Dependency Injection Controller
  • Middleware Stack
  • Router
  • Resolve/Dispatch

In each case, you are expected to write your secret awesome extras as Middleware components, Controllers etc. and hang them from the framework in the spaces provided and in the order you want. In each case, you have little or no say as to which of the above components you get to use. Some micro-frameworks do attempt some choice, such as Zend Expressive, but it is limited.

But look on Packagist and you will find loads of different DICs, Middleware Stacks, Routers etc. and there's some great inovation out there.

This is where Weave is different. Weave doesn't come bundled with most of the components listed. Instead, you get to pick Adaptors - or write your own. Whatever suits you best.

Pick Your Own

Weave has Adaptors for the different Components it needs. You provide one of each Adaptor (or your own code) to create the microframework you want.

Component Adaptors Custom options
Configuration Zend Config Provide a single method in your App class that returns an array.
Error Handling Whoops Provide a single method in your App class.
DIC League, Aura.Di Provide a single method in your App Class that returns a callable.
Middleware Stack Relay, Middleman 2.x Implementation of the MiddlewareAdaptorInterface.
Router FastRoute, Aura.Router Implementation of the RouterAdaptorInterface.
Resolver Internal Implementation of the ResolveAdaptorInterface.
PSR7 Zend Diactoros Implementation of the PSR7 standard.

Where Interfaces are in use, you simply map them to concrete classes in your DIC.

Take a look at some of the examples at http://github.com/weavephp to see how this works in practice.

weavephp/weave 适用场景与选型建议

weavephp/weave 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21.66k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2017 年 11 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「framework」 「micro」 「weave」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 weavephp/weave 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 weavephp/weave 我们能提供哪些服务?
定制开发 / 二次开发

基于 weavephp/weave 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-11-04