Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mooeypoo/mwstew-builder
The backend PHP system to create mediawiki extensions
https://github.com/mooeypoo/mwstew-builder
boilerplate mediawiki mediawiki-extension
Last synced: 22 days ago
JSON representation
The backend PHP system to create mediawiki extensions
- Host: GitHub
- URL: https://github.com/mooeypoo/mwstew-builder
- Owner: mooeypoo
- License: gpl-2.0
- Created: 2018-12-26T00:34:08.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-03T13:29:03.000Z (about 5 years ago)
- Last Synced: 2024-07-10T13:08:09.722Z (4 months ago)
- Topics: boilerplate, mediawiki, mediawiki-extension
- Language: PHP
- Size: 160 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/mooeypoo/MWStew.svg?branch=master)](https://travis-ci.org/mooeypoo/MWStew-builder)
[![Coverage Status](https://coveralls.io/repos/github/mooeypoo/MWStew-builder/badge.svg?branch=master)](https://coveralls.io/github/mooeypoo/MWStew-builder?branch=master)
[![GitHub license](https://img.shields.io/badge/license-GPLv2-blue.svg?style=plastic)](https://raw.githubusercontent.com/mooeypoo/MWStew-builder/master/LICENSE)# MWStew-builder: A backend PHP library for building MediaWiki extension files
**Feel free to contribute!**
## Usage
This tool is available on packagist. Add it to your project with```
composer install mooeypoo/mwstew-builder
```To create MediaWiki extension files, you need to pass the required parameters to the `Generator`:
```php
// 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();
```
The builder does not write files to the file system, it only builds the structure and lets you handle the rest.### Expected data
To make an extension bundle, the generator expects data with expected keys. The 'name' key is mandatory, all others are optional:
```php
$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.
]
```
### Using the filesYou can then use the Zipper to add the files into a .zip file and output for download:
```php
$tempFolder = dirname( __DIR__ ) . '/temp';
$zip = new MWStew\Builder\Zipper( $tempFolder, 'someName' );
$zip->addFilesToZip( $generator->getFiles() );
$zip->download();
```Or you can create the fils on the file system yourself. To see an example of that, see [MWStew-CLI](https://github.com/mooeypoo/MWStew-CLI) for the command line tool.
## Contribute
This is fully open source tool. Pull requests are welcome! Please participate and help make this a great tool!If you have suggestions or bug reports, please [submit an issue](https://github.com/mooeypoo/MWStew-builder/issues).
If you want to contribute to the code, clone and initialize locally:
1. Clone the repo
2. Run `composer install`
3. Run `composer run test` to run tests* See [MWStew](https://github.com/mooeypoo/MWStew) for the graphical interface.
* See [MWStew-CLI](https://github.com/mooeypoo/MWStew-CLI) for the command line tool.## Changelog
See [CHANGELOG](CHANGELOG.md)## Authors
Moriel Schottlender (mooeypoo)