... | ... | @@ -201,7 +201,26 @@ $dbw->delete( |
|
|
Details see https://www.mediawiki.org/wiki/Manual:Database_access
|
|
|
|
|
|
|
|
|
## How to alter source before save
|
|
|
|
|
|
# Vagrant MediaWiki
|
|
|
|
|
|
## Fixing the VisualEditor problem
|
|
|
```
|
|
|
vagrant roles enable parsoid
|
|
|
vagrant ssh
|
|
|
cd /vagrant/srv/restbase/
|
|
|
rm -rf node_modules/
|
|
|
npm install
|
|
|
npm init --yes
|
|
|
npm install restbase-mod-table-sqlite --no-bin-links
|
|
|
npm install npmlog
|
|
|
tail -f /vagrant/logs/restbase.log # check if no other module is missing
|
|
|
```
|
|
|
|
|
|
|
|
|
# some MediaWiki hooks
|
|
|
|
|
|
## Alter the source before save
|
|
|
|
|
|
see https://stackoverflow.com/questions/32375120/automatically-add-text-content-to-mediawiki-short-pages
|
|
|
|
... | ... | @@ -225,23 +244,7 @@ public static function onPageContentSave(WikiPage &$wikiPage, User &$user, Conte |
|
|
}
|
|
|
```
|
|
|
|
|
|
# Vagrant MediaWiki
|
|
|
|
|
|
## Fixing the VisualEditor problem
|
|
|
```
|
|
|
vagrant roles enable parsoid
|
|
|
vagrant ssh
|
|
|
cd /vagrant/srv/restbase/
|
|
|
rm -rf node_modules/
|
|
|
npm install
|
|
|
npm init --yes
|
|
|
npm install restbase-mod-table-sqlite --no-bin-links
|
|
|
npm install npmlog
|
|
|
tail -f /vagrant/logs/restbase.log # check if no other module is missing
|
|
|
```
|
|
|
|
|
|
|
|
|
# some MediaWiki hooks
|
|
|
## before editing existing page
|
|
|
* **EditFormInitialText**: Allows modifying the edit form when editing existing pages
|
|
|
* $editPage: EditPage object
|
... | ... | |