-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Robert Vogel
committed
Sep 23, 2024
0 parents
commit 3b0e9b5
Showing
16 changed files
with
5,919 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
vendor/ | ||
workspace/ | ||
.phpunit.result.cache | ||
dist/migrate-easyredmine-knowledgebase.phar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
Oops, something went wrong.