
內容簡介
將 Composer 依賴管理工具添加到 WP CLI 中。讓您可以遞歸地安裝/更新 Composer 套件在您所有的 WordPress 外掛程式和佈景主題之中。
這是使用什麼工具?
這個套件使用了一款名為 WP-CLI 的優秀軟體。該軟體為 WordPress 管理提供了一個命令行介面。我們提供了一個在 WP CLI 內進行 Composer 管理的外掛程式。
Composer 是什麼?
Composer 是自 GIF、陰影和跳舞貓咪以來發生在 Web 上最棒的事情。Composer 是一個簡單易懂的基於 JSON 的 PHP 套件管理器。欲知詳情,請查看 http:/ /getcomposer.org/ 。
所以這是完整的 Composer 支援嗎?
不是,不完全支援!遺憾的是,我們正在構建 WP-CLI 和 Composer 集成,並力求做出獨特的結合方式。但是,目前我們只支援一些指令:
安裝
更新
診斷
幫助
狀態
如果您想幫忙,請隨時提供幫助!編寫一個拉取請求,讓我們一起寫程式!
如何在我的外掛程式中構建 Composer 管理?
非常簡單!您只需要像任何 Composer 專案一樣創建一個簡單的 composer.json 文件。然後,wp-composer 將與具有 Composer 支援的每個外掛程式和佈景主題進行接口,還會生成自動載入檔案!
只需在您的主要外掛程式文件中添加以下內容即可:
require(__DIR__.'/vendor/autoload.php');
就這麼簡單。
外掛標籤
開發者團隊
原文外掛簡介
Adding Composer dependency management to WP CLI. Allows you to recursivly install/update composer packages inside of all of your WordPress plugins and themes.
What is this using?
This package uses a great piece of software called WP-CLI. It provides a command line interface for WordPress management. We are a plugin providing Composer management inside of WP CLI.
What’s Composer?
It’s the greatest thing to happen to the web since GIFs, Drop Shadows and dancing cats. Composer is a dead simple JSON-based dependency manager for PHP. For more information, check out http://getcomposer.org/.
So this is complete Composer support?
No, not exactly! Sadly, I’m building this out and I’m trying to make some sweet WP-CLI and Composer integration. But for now, we only support a few command:
install
update
diagnose
help
status
If you’d love to help out, please help! Make a pull request and let’s get coding!
How do I build Composer Management inside of my plugin?
Simple really! You just create a simple composer.json file like you would with any Composer project. From there, wp-composer will interface with each plugin/theme that has composer support and it will generate the autoload files, too!
Just include something like this inside your main plugin file:
require(__DIR__.'/vendor/autoload.php');
It’s that simple.
