<?php //利用反射机制,简单的实现PHP插件模式 # 假设,我们有一款开源产品,所有开发者都必须在我定制的需求之上,进行二次开发, # 而开发完成后的新模块,就是一个不一样的新插件,可以放在特定的位置进行自动加载 #这是我们的开源产品 interface Demo{ # 所有插件都必须实现这个方法 public function msg(); } #这是小明开发的插件-1 class xiaoming implements Demo{ public function msg(){ echo
背景 有时候,我们也希望VuePress构建的文档中心能支持离线访问,这时候我们需要给他添加渐进式Web应用(PWA,Progressive Web App)的支持,根据官方文档指引,我们可以借助插件vuepress/plugin-pwa来添加PWA的支持. PWA(Progressive Web Apps,渐进式 Web 应用)运用现代的 Web API 以及传统的渐进式增强策略来创建跨平台 Web 应用程序.这些应用无处不在.功能丰富,使其具有与原生应用相同的用户体验优势. 安装 npm i