定制 quadlayers/wp-autoload 二次开发

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

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

quadlayers/wp-autoload

最新稳定版本:1.2.6

Composer 安装命令:

composer require quadlayers/wp-autoload

包简介

Composer package with autoload for WordPress.

README 文档

README

Latest Version on Packagist

This composer plugin allows you to autoload WordPress files via Composer based on the Wordpress Coding Standards

This package is intended to be used as a dev package. It will help you in the development stage, avoiding the need to run the dump-autoload command every time a file is included in the repo.

This composer plugin should be used in conjunction with the classmap autolad. This will be used to create the optimized autoload in production.

The use of classmap will prevent any validation issues in packagist that using unrecognized autoload creates.

In brief, the idea is to use the autolad of the plugin in development and the classmap in production.

Installation

You can install the package via composer:

composer require quadlayers/wp-autoload --dev

Usage

{
	"config": {
		"allow-plugins": {
			"quadlayers/wp-autoload": true
		}
	},
	"autoload": {
		"classmap": [
			"src/",
			"lib/"
		]
	},
	"autoload-dev": {
		"exclude-from-classmap": [
			"src/",
			"lib/"
		]
	},
	"extra": {
		"quadlayers/wp-autoload": {
			"My_Plugin_Namespace": "src/",
			"My_Plugin_Namespace_2": "lib/"
		}
	}
}

Development

Run the composer install command to install all dev dependencies. All classes will be loaded via quadlayers/wp-autoload package.

Use the composer dump-autoload or composer dump-autoload -o commands. This will use the autoload-dev settings to exclude classmap autoload because all files will be loaded via quadlayers/wp-autoload package.

Production

Run the composer install --no-dev command to remove the dev dependencies. The quadlayers/wp-autoload wont be installed and all your files will be loaded with the classmap composer autoload.

You can also run the composer dump-autoload --no-dev or composer dump-autoload -o --no-dev commands, to exclude the classmap autoload.

Todo

Create optimized files and remove the need to use autoload classmap.

Credits

This plugin have been based on Jetpack Autoloader and Composer WordPress Autoloader .

Contribute

Thats it! develop with WordPress naming conventions, run autoload command, and forget about us... I'm kidding; smush the stars button and contribute with this project. :D

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2023-01-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固