retrolux/omm-php-library

用于网页远程仓库的Open Mod Manager PHP库

v1.2.0 2024-02-27 13:44 UTC

This package is auto-updated.

Last update: 2024-09-23 09:06:47 UTC


README

这是一个用于管理Open Mod Manager远程仓库的PHP Web库。

特性

  • 基于文件夹结构排序的模包生成仓库XML
  • 能够通过命令行(cron任务等)发布仓库任务
  • 处理包和仓库对象,允许轻松扩展以集成到您的Web前端

要求

  • PHP 7.4+(使用PHP 8.1+将加速库的运行)
  • ImageMagick
  • DOM扩展
  • SimpleXML扩展
  • MBString扩展
  • Zip扩展
  • Fileinfo扩展

安装

Composer

使用Composer安装,只需要求此包的最新版本。如果您只想在命令行中使用,请将其安装为全局库。

composer global require retrolux/omm-php-library

命令行选项

generateFolderRepository

从包含模存档的文件夹结构生成网络仓库。

注意
需要在可以通过Web服务器访问的文件夹中调用,并且应位于要查找模存档的文件夹旁边。

使用选项

OMMTask generateFolderRepository <xmlName> <repositoryName> <packageRootPath> (<recursive>)
Arguments:
        xmlName                   : name and path of the repository xml
        repositoryName            : name for the repository
        packageRootPath           : root path where the mod packages are placed relative to repository xml location
        recursive                 : true if the sub folders should be processed as well (Default: true)

以下示例将生成存储在repository.xml中的Mod Download Repository,扫描位于mods文件夹和子目录中的包(相对于xml)。

OMMTask generateFolderRepository "repository.xml" "Mod Download Repository" "mods"

如何贡献

为了保持此库的最新状态或扩展它以添加新任务等,我将非常欢迎您向此仓库提交拉取请求。