MediaWiki/Presentation: Difference between revisions

revert edits to fix search where character encoding was a problem
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight"
 
Line 166: Line 166:
| type = restricted
| type = restricted
| text = You can remove the database configuration lines into it's own file and then include that file from LocalSettings so that you now can commit LocalSettings to your version control repository without revealing the db credentials.}}
| text = You can remove the database configuration lines into it's own file and then include that file from LocalSettings so that you now can commit LocalSettings to your version control repository without revealing the db credentials.}}
<source lang="php">
<syntaxhighlight lang="php">
## Database settings
## Database settings
## moved to a separate file so that we can track changes to the general config in version control, without checking in our db credentials
## moved to a separate file so that we can track changes to the general config in version control, without checking in our db credentials
require_once( "$IP/DatabaseSettings.php" );
require_once( "$IP/DatabaseSettings.php" );
</source>
</syntaxhighlight>


One good practice is to have some sort of text version or other backup of your wiki in case the machine, webserver, or database that the system depends on is down.  As an administrator, you can use the dumpBackup.php script found in the <code>maintenance</code> directory of you MediaWiki installation.  Something like the following in a system [[cron]] would be good:
One good practice is to have some sort of text version or other backup of your wiki in case the machine, webserver, or database that the system depends on is down.  As an administrator, you can use the dumpBackup.php script found in the <code>maintenance</code> directory of you MediaWiki installation.  Something like the following in a system [[cron]] would be good:
<source lang="bash">
<syntaxhighlight lang="bash">
/usr/bin/php /var/www/phase3/maintenance/dumpBackup.php --current --output=file:/var/backups/example.com/`date +%F`-wiki.text.export.txt
/usr/bin/php /var/www/phase3/maintenance/dumpBackup.php --current --output=file:/var/backups/example.com/`date +%F`-wiki.text.export.txt
</source>
</syntaxhighlight>


As a user, one tool that can come in handy is [[Special:Wiki2XML]] <ref>http://tools.wikimedia.de/~magnus/wiki2xml/README, see also [[Format_conversion]]</ref>
As a user, one tool that can come in handy is [[Special:Wiki2XML]] <ref>http://tools.wikimedia.de/~magnus/wiki2xml/README, see also [[Format_conversion]]</ref>


Another useful tool to the Administrator is the bulk image importer.  To import all the screenshots that I used at the start of this presentation, I did the following:
Another useful tool to the Administrator is the bulk image importer.  To import all the screenshots that I used at the start of this presentation, I did the following:
<source lang="bash">
<syntaxhighlight lang="bash">
php importImages.php --user=Freephile --comment='Set of screenshots of sites using MediaWiki ' ~/Desktop/mediawiki/snaps/
php importImages.php --user=Freephile --comment='Set of screenshots of sites using MediaWiki ' ~/Desktop/mediawiki/snaps/
</source>
</syntaxhighlight>
Note how using a Category tag in the comment will automatically place the images in the Category specified.
Note how using a Category tag in the comment will automatically place the images in the Category specified.