PagePort
Installable MediaWiki pages
PX
COMPATIBLE
READY
GitHub
Repeated efforts
Packages
We recreate the same elements to deliver the same feature to many projects:
What if we can make our work reusable across projects?
Implementation
>�1.30
REQUIRED
MediaWiki
�ZIP
OPTIONAL
PHP
PagePort provides a maintenance script to export and import a collection of wiki pages.
PX
JSON
GIT-BOOK
Exporting to git-book format
From a category
From a list
From the entire wiki
php maintenance/exportPages.php --category Test --out ~/export/
php maintenance/exportPages.php --pagelist pages.txt --out ~/export/
php maintenance/exportPages.php --full --out ~/export/
--zip ~/full.zip
ZIP
READY
GitHub
Git-book Directory Structure
PagePort creates a directory for each namespace and adds a file for each page.
File naming follows a pagename.mediawiki convention and the namespace is the directory name :
Exporting a PageExchange JSON
From a category
From a list
If omitted, the filename will be autogenerated based on the time() function
php maintenance/exportPages.php --category Test --out ~/export/
php maintenance/exportPages.php --pagelist pages.txt --out ~/export/
test.json --json
list.json --json
PX
COMPATIBLE
php maintenance/exportPages.php --category Test --json
Exporting a PageExchange JSON
Rewrite pages URLs to point them to a GitHub repository at "some/Git-BookRepo":
php maintenance/exportPages.php --category Test \
--out ~/export/test.json --json --github "some/Git-BookRepo"
PX
COMPATIBLE
READY
GitHub
Exporting a PageExchange JSON
Package metadata can be added right here:
PX
COMPATIBLE
php maintenance/exportPages.php --category Test --out ~/export/test.json --json \
--version 1.0 --package "MyPackage" --desc "My description" \
--extensions "SemanticMediaWiki,PageForms" \
--dependencies "OtherPackage,AlienPackage"
Other nifty stuff
--clean
PagePort will clean up its working directory before exporting a new collection
Other nifty stuff
PagePort can even delete pages from the wiki based on a gitbook structure
php maintenance/deletePages.php --source "~/export"
Development automation
Internal
PX compatibility and dependencies check.
INCLUDED
CI
TESTS
Integrity
In many aspects PagePort acts as a real package manager
PACK
REMOVE
INSTALL
Integrity
In many aspects PagePort acts as a real package manager
CHECK DEPENDENCIES
PACKAGES
EXTENSIONS
PagePort
RATINGS PACKAGE
REQUIRES
EXAMPLE
Ratings
autoedit
average
PF
SMW
custom NS
MW
PAGEID/USERNAME
Installation
Clone the repo:
Navigate to the MediaWiki root directory:
Import the pages:
git clone https://github.com/WikiTeq/mediawiki-ratings.git ~/mediawiki-ratings
cd /mediawiki
php extensions/PagePort/maintenance/importPages.php --source ~/mediawiki-ratings
We only need to explain where our page code resides
PageExchange
by YARON KOREN
We only need to explain where our page code resides
Point to the JSON location in LocalSettings.php:
$wgPageExchangePackageFiles[] = 'https://raw.githubusercontent.com/WikiTeq/mediawiki-ratings/master/page-exchange.json';
PX
COMPATIBLE
--github
Remember our JSON
is aware of our repo
Package Management GUI
PX
Special:Packages
Our first attempt
has failed …
Package Management GUI
PX
Special:Packages
CAN INSTALL
Package Management GUI
PX
Special:Packages
INSTALL
Package Management GUI
PX
Special:Packages
JOB QUEUE
Package Management GUI
+
PX
Special:Packages
UPDATE DB
JOB QUEUE
Package Management CLI
PagePort
Clean up the working directory and clone again /
update existing local repo
git pull
--clean / git clone
php extensions/PagePort/maintenance/importPages.php --source ~/mediawiki-ratings
Package Management CLI
PagePort
deletePages.php
Delete pages from wiki based on a git-book structure
php maintenance/deletePages.php --source ~/mediawiki-ratings
Thank You!
Ike Hecht + WikiTeq