Skip to content

Commit

Permalink
Initial (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Vogel committed Sep 23, 2024
0 parents commit 3b0e9b5
Show file tree
Hide file tree
Showing 16 changed files with 5,919 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: basic-tests

on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: composer:2

- name: Install dependencies
run: composer update

- name: Run check coding conventions
run: composer test

- name: Run unit tests
run: composer unittest
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vendor/
workspace/
.phpunit.result.cache
dist/migrate-easyredmine-knowledgebase.phar
8 changes: 8 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
</rule>
<file>.</file>
<arg name="extensions" value="php"/>
<arg name="encoding" value="UTF-8"/>
</ruleset>
8 changes: 8 additions & 0 deletions .phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<phpunit bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="all">
<directory suffix="Test.php">./tests/phpunit</directory>
</testsuite>
</testsuites>
</phpunit>
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Migrate EasyRedmine Knowledgebase XML export to MediaWiki import data

This is a command line tool to convert the contents of a EasyRedmine Knowledgebase space into a MediaWiki import data format.

## Prerequisites
1. PHP >= 8.2 with the `xml` extension must be installed
2. `pandoc` >= 3.1.6. The `pandoc` tool must be installed and available in the `PATH` (https://pandoc.org/installing.html).

## Installation
1. Download `migrate-easyredmine-knowledgebase.phar` from https://github.com/hallowelt/migrate-easyredmine-knowledgebase/releases/tag/latest
2. Make sure the file is executable. E.g. by running `chmod +x migrate-easyredmine-knowledgebase.phar`
3. Move `migrate-easyredmine-knowledgebase.phar` to `/usr/local/bin/migrate-easyredmine-knowledgebase` (or somewhere else in the `PATH`)

## Workflow

TBD
38 changes: 38 additions & 0 deletions bin/migrate-easyredmine-knowledgebase
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env php
<?php

require __DIR__.'/../vendor/autoload.php';

use HalloWelt\MediaWiki\Lib\Migration\CliApp;
use HalloWelt\MigrateEasyRedmineKnowledgebase\Command\CheckResult;

$config = [
'file-extension-whitelist' => [ 'xml' ],
'analyzers' => [
'HalloWelt\MigrateEasyRedmineKnowledgebase\Analyzer\EasyRedmineKnowledgebaseAnalyzer::factory'
],
'extractors' => [
'HalloWelt\MigrateEasyRedmineKnowledgebase\Extractor\EasyRedmineKnowledgebaseExtractor::factory'
],
'converters' => [
'HalloWelt\MigrateEasyRedmineKnowledgebase\Converter\EasyRedmineKnowledgebaseConverter::factory'
],
'composers' => [
'HalloWelt\MigrateEasyRedmineKnowledgebase\Composer\EasyRedmineKnowledgebaseComposer::factory'
],
'@command-overrides' => [
'analyze' => [
'factory' => 'HalloWelt\MigrateEasyRedmineKnowledgebase\Command\Analyze::factory'
],
'extract' => [
'factory' => 'HalloWelt\MigrateEasyRedmineKnowledgebase\Command\Extract::factory'
],
'convert' => [
'factory' => 'HalloWelt\MigrateEasyRedmineKnowledgebase\Command\Convert::factory'
]
]
];

$application = new CliApp( $config );
$application->add( new CheckResult() );
$application->run();
17 changes: 17 additions & 0 deletions box.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"chmod": "0755",
"directories": [
"src"
],
"finder": [
{
"name": "*.php",
"exclude": ["tests", "dist"],
"in": "vendor"
}
],
"git-version": "package_version",
"main": "bin/migrate-easyredmine-knowledgebase",
"output": "dist/migrate-easyredmine-knowledgebase.phar",
"stub": true
}
66 changes: 66 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "hallowelt/migrate-easyredmine-knowledgebase",
"type": "project",
"description": "Tool to convert EasyRedmine Knowledgebase Export XML into MediaWiki import XML",
"keywords": [
"wiki",
"MediaWiki",
"EasyRedmine"
],
"license": "GPL-3.0-only",
"authors": [
{
"name": "Robert Vogel",
"email": "[email protected]"
}
],
"repositories": [{
"type": "composer",
"url": "https://packages.bluespice.com/"
}],
"require": {
"psr/log": "~3",
"hallowelt/mediawiki-lib-mediawikixml": "dev-UpdateDependencies",
"hallowelt/mediawiki-lib-commandline-tools": "dev-UpdateDependencies",
"hallowelt/mediawiki-lib-migration": "dev-UpdateDependencies",
"hallowelt/mediawiki-lib-wikitext": "dev-UpdateDependencies",
"ext-dom": "*",
"symfony/yaml": "~6"
},
"require-dev": {
"mediawiki/mediawiki-codesniffer": "44.0.0",
"mediawiki/mediawiki-phan-config": "0.14.0",
"mediawiki/minus-x": "1.1.3",
"php-parallel-lint/php-console-highlighter": "1.0.0",
"php-parallel-lint/php-parallel-lint": "1.4.0",
"phpunit/phpunit": "^10"
},
"autoload": {
"psr-4": {
"HalloWelt\\MigrateEasyRedmineKnowledgebase\\": "src/",
"HalloWelt\\MigrateEasyRedmineKnowledgebase\\Tests\\": "tests/phpunit/"
}
},
"scripts": {
"unittest": [
"vendor/phpunit/phpunit/phpunit --configuration .phpunit.xml"
],
"test": [
"parallel-lint . --exclude vendor --exclude node_modules",
"minus-x check .",
"phpcs -sp"
],
"fix": [
"minus-x fix .",
"phpcbf"
],
"lint": [
"phan --no-progress-bar -m text | sed 's, ,:,'"
]
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
Loading

0 comments on commit 3b0e9b5

Please sign in to comment.