mooeypoo / mwstew-builder
创建 mediawiki 扩展文件的 PHP 后端
v1.1.1
2019-01-21 00:11 UTC
Requires
- respect/validation: ^1.1
- twig/twig: ^2.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.1
- phpunit/phpunit: ^7.5
README
MWStew-builder:用于构建 MediaWiki 扩展文件的 PHP 库后端
欢迎贡献!
使用方法
此工具可在 Packagist 上找到。将其添加到您的项目中使用以下命令
composer install mooeypoo/mwstew-builder
要创建 MediaWiki 扩展文件,您需要将所需参数传递给 Generator
// Send $data with the definition of required values for the extension $generator = new MWStew\Builder\Generator( $data ); // The file structure is available by request $generator->getFiles();
构建器不会将文件写入文件系统,它只构建结构,并让您处理其余部分。
预期数据
要制作扩展包,生成器期望具有预期键的数据。'name' 键是必需的,其余都是可选的
$data = [ 'name' => (string) Extension name; English only, no spaces (Mandatory) 'title' => (string) Extension title or display name 'author' => (string) Extension author 'version' => (string|number) Extension version 'description' => (string) A short description for the extension. 'url' => (string) A URL for the extension 'license' => (string) License code for the extension. Expected a valid value to be used in composer.json and package.json 'dev_php' => (bool) Whether the extension should have the base files needed for a PHP development environment. 'dev_js' => (bool) Whether the extension should have the base files needed for a JavaScript development environment. 'specialpage_name' => (string) A name for a sepcial page. Must use valid characters for MediaWiki title. 'specialpage_title' => (string) A title for the special page. 'specialpage_intro' => (string) A short description or introduction text for the special page. This will appear at the top of the new special page that is created. 'hooks' => (array) An array of strings representing hooks to be added to the system. ]
使用文件
然后您可以使用打包工具将文件添加到 .zip 文件中并输出以供下载
$tempFolder = dirname( __DIR__ ) . '/temp'; $zip = new MWStew\Builder\Zipper( $tempFolder, 'someName' ); $zip->addFilesToZip( $generator->getFiles() ); $zip->download();
或者您可以自己创建文件系统中的文件。要查看示例,请参阅MWStew-CLI中的命令行工具。
贡献
这是一个完全开源的工具。欢迎提交拉取请求!请参与并帮助将其打造为优秀的工具!
如果您有建议或错误报告,请提交问题。
如果您想为代码做出贡献,请本地克隆并初始化
- 克隆仓库
- 运行
composer install
- 运行
composer run test
以运行测试
- 有关图形界面的信息,请参阅 MWStew
- 有关命令行工具的信息,请参阅 MWStew-CLI
变更日志
请参阅 CHANGELOG
作者
Moriel Schottlender (mooeypoo)