Development

From OmegaWiki

Jump to: navigation, search

So you want to become an OmegaWiki developer ...

You will need a reasonable understanding of PHP & MySQL web development, and version control with Subversion.

[edit] Setting up your environment

  1. Install Apache
  2. Install PHP 5.2+ with MySQL support/extension (don't forget to modify php.ini to activate the extension). Watch out: Some distributions are still using 5.1. Be sure to check! You can use this handy script: phpinfo.
  3. Install MySQL 5+
  4. Configure MySQL to use UTF-8:
    • Edit your my.cnf configuration file
    • Under [mysqld], add the following lines:
      • character-set-server=utf8
      • default-character-set=utf8
    • Under [mysql], add the following:
      • default-character-set=utf8
    • Restart MySQL. When you run the "status" command in the MySQL client, all "characterset" settings should be set to "utf8".
  5. Install SVN
  6. Download the following files:
  7. Checkout a copy of the latest "wikidata" branch of MediaWiki
  8. Checkout a copy of the latest "wikidata" extension
  9. You can rename these directories, though you will want to adapt LocalSettings.php if you do.
  10. Uncompress the dump omegawiki-latest.tgz you downloaded with tar, winrar or the program of your convenience, action that should create a omegawiki-latest.sql file.
  11. Create a database named 'omegawiki' (for example) and load the dump omegawiki-latest.sql into it.
    • mysql -h localhost -u root -ppass -e"CREATE DATABASE omegawiki;;"
    • mysql -h localhost -u root -ppass omegawiki < omegawiki-latest.sql
  12. Run rights.sql as root to create a user for the database (the user will be called 'omegawiki'), and user.sql file to create a user account. The user will be called 'Admin' with the password 'admin'. Login and change your password if this is a public webserver!
    • mysql -h localhost -u root -ppass -e"use omegawiki;; source rights.sql;; source user.sql;;"
  13. Copy the LocalSettings.sample into your wikidata folder in Apache's Documentroot as LocalSettings.php and edit it (see inline comments for help).
  14. Copy wikidata/extensions/Wikidata/LocalApp.php.sample to wikidata/extensions/Wikidata/LocalApp.php.
  15. If you are installing on a Windows version of Apache, you will have to change the path separators in line 11 of LocalSettings.php from colons (:) to semicolons (;):
    • UNIX: ini_set( "include_path", ".:$IP:$IP/includes:$IP/languages" );
    • Windows: ini_set( "include_path", ".;$IP;$IP/includes;$IP/languages" );
  16. To get the search box on the new main page to work, you will have to install the InputBox extension. If you have previously visited the main page on your local copy, you may have to load it once with the action=purge parameter to properly regenerate it (i.e., index.php?title=Meta:Main_Page&action=purge).
  17. Finishing touches: download omegawiki.png into your wikidata/images/ directory, or use your own logo instead!

Visit the wiki and you should have a working copy of OmegaWiki! You may have to restart your computer for PHP and mySQL to cooperate.

If omegawiki is not working after that, run php on index.php in wikidata folder from a command line to check error messages and correct your LocalSettings.php. You can also delete the file to verify that the enviroment is well set for MediaWiki. Accessing index.php from your browser should offer you to create a new wiki and run some tests.

[edit] Understanding the code

Documentation can use improvement. Help is especially needed in this department! Contact Erik (erik AT wikimedia DOT org) and he'll give you a whirlwind tour through the main things you understand. The documentation as it is can be found here.

A good place to start is the general MediaWiki documentation and the documentation for OmegaWiki itself.

[edit] Committing changes

Initially, you will be asked to submit patch files, such as those you can generate by using "svn diff" in the root directory of your installation. If your patches have been integrated a few times, contact Erik (erik AT wikimedia DOT org) to get Subversion commit access.

If you are a committer, please set Subversion auto-props as described here.

Personal tools
Toolbox