自 1.7.14 起,支持安装插件。
安装准备|Installation preparation
在要安装插件的服务器上创建密钥(后面的邮箱随意):
Create the key on the server where you want to install the plugin (the email address after it is arbitrary).ssh-keygen -t ed25519 -C “[email protected]”
一路回车后,生成的密钥位于 ~/.ssh/id_ed25519.pub,将里面内容发给作者。联系作者创建服务平台账号密码,登录后自行添加 deploy key,Key 内容是刚才生成的 pub 文件的内容。
After a carriage return, the generated key is located at ~/.ssh/id_ed25519.pub, send the contents to the author.Contact the author to create a service platform account password, log in and add your own deploy key, the content of the key is the content of the pub file you just generated.
2024-04-04 更新:以上方案不再建议使用,不需要用户生成 ssh 密钥,作者发送 token,在项目根目录下执行:
composer config github-oauth.github.com YOUR_TOKEN
会在项目根目录生成 auth.json,里面包含类似以下的内容:
{
"github-oauth": {
"github.com": "token"
}
}
执行安装|Execute the installation
1、将仓库地址添加到 composer.json。本教程以点赞插件为例(repositories.xxx 后的 xxx 按插件名称自行修改,一个标识)。
1, add the repository address to composer.json. this tutorial takes the [post like] plugin as an example (xxx after repositories.xxx is modified by the plugin name itself, a logo).
composer config repositories.post-like git https://github.com/xiaomlove/nexusphp-post-like.git
2、require 进来(有询问输入 yes):
2, require in (enter yes if asked).composer require xiaomlove/nexusphp-post-like
3、执行安装命令:
3, Execute the installation command.php artisan plugin install xiaomlove/nexusphp-post-like
出现类似以下提示则表示安装成功:
A message similar to the following will indicate a successful installation…. install plugin: xiaomlove/nexusphp-post-like successfully !
至引安装完成。
The installation is now complete.
插件升级|Plugin Upgrade
当插件有升级时,执行以下两个命令:
When the plugin has an upgrade, execute the following two commands.
# 拉取新代码|pull the new code
composer update xiaomlove/nexusphp-post-like
# 执行安装命令完成迁移|Execute the install command to complete the migration
php artisan plugin install xiaomlove/nexusphp-post-like
注意有的更新需要主程序版本配合。如果你主程序版本不符合却更新了,插件将无效。
Note that some updates require the version of the main application to match. If your main program version does not match but is updated, the plugin will not work.
重新安装|Reinstall
注意:插件安装依赖 composer,升级主程序版本不要修改 composer.json 和 composer.lock,否则插件丢失!
Note: The plugin installation depends on composer, upgrade the main program version do not modify composer.json and composer.lock, otherwise the plugin will be lost!
一般情况下,更新主程序版本,依赖是不变的,即 composer.json 和 composer.lock 文件不会有变动,做文件覆盖时也就不需要覆盖这两个文件,否则安装的插件会丢失。
In general, update the main program version, the dependency is unchanged, that is, composer.json and composer.lock files will not change, do not need to overwrite these two files when doing file overwriting, otherwise the installed plug-ins will be lost.
但某些版本会变动依赖,这会在发版公告中明确说明。这时候有两个选择,1是升级 composer.json 和 composer.lock 到最新,覆盖更新完成后,重新安装插件,也即进行一遍上边 [执行安装] 的第1步、第2步。2是按照发版公告的说明添加或修改 composer.json,删除 composer.lock,重新执行 composer install。
However, some versions may change dependencies, which will be clearly stated in the release notes. In this case, you have two options: 1) update composer.json and composer.lock to the latest version, overwrite the update, and reinstall the plugin, i.e., do steps 1 and 2 of [perform installation] above. 2) add or modify composer.json, delete composer.lock, and re-install composer.lock according to the release notes. Execute composer install.
插件只是提供一些可有可无的边角功能,如果正合你意,可以找我购买,你的支持是我更新维护的最大动力!
Plugins only provide some optional side functions, if it is to your liking, you can find me to buy, your support is my greatest motivation to update maintenance!
目前有以下插件提供:
Currently the following plug-ins are available.