Notice

This page show a previous version of the article

NOTE: This is about installing the PHP version (i.e. current version) of Tatoeba.

Downloads

Required tools

  • Apache
  • PHP
  • MySQL
  • SVN Client

For those who are on Windows:

Source code

The source code is hosted on a platform called Assembla: https://www.assembla.com/code/tatoeba2/subversion/nodes

Repository URL: https://subversion.assembla.com/svn/tatoeba2/

URL you'll want to checkout: https://subversion.assembla.com/svn/tatoeba2/trunk/

Configuration

Virtual host

You may set up a virtual host. I personally use http://tatoeba.dev/ as my local URL.

TODO More details on how to do that.

mod_rewrite

You need to have mod_rewrite enabled, it's necessary for CakePHP.

TODO More details on how to do that.

app/core/config.php

In the file app/core/config.php, put into comments the part about XCache. /* Cache::config('default', array( 'engine' => 'Xcache', //[required] 'duration'=> 3600, //[optional] 'probability'=> 100, //[optional] 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string 'user' => 'user', //user from xcache.admin.user settings 'password' => 'password', //plaintext password (xcache.admin.pass) )); Cache::config('_cake_core_', array( 'engine' => 'Xcache', //[required] 'duration'=> 3600, //[optional] 'probability'=> 100, //[optional] 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string 'user' => 'user', //user from xcache.admin.user settings 'password' => 'password', //plaintext password (xcache.admin.pass) )); */

And uncomment the line to use the "File" cache engine:

Cache::config('default', array('engine' => 'File'));

app/core/database.php

In the file app/core/database.php, set your login, password and database in the $default array. var $default = array( 'driver' => 'mysql', 'persistent' => false, 'host' => 'localhost', 'login' => 'root', 'password' => 'somepassword', 'database' => 'tatoeba', 'prefix' => '', 'encoding' => 'utf8' );

app/models/sentence.php

Tatoeba uses some other external tools that you won't necessarily need. These tools are:

  • the search engine (Sphinx)
  • the tools for romanization

If you're not going to work on the search or on the romanization and don't want to install these tools, you will have to uncomment a few things in the Sentence model (app/models/sentence.php).

line 274: uncomment "return array(1)" public function getSeveralRandomIds($lang = 'und', $numberOfIdWanted = 10) { // Uncomment the line below if you don't have sphinx installed. return array(1);

line 847: uncomment "return false" public function generateMetas(&$sentenceArray) { // Uncomment the line below you don't have the Chinese // romanization tools installed. return false;

Database

Now you need to create the database, and import the necessary things.

First, create the database. Make sure the name you use here is the name you've set in app/core/database.php. I'll name it tateoba. CREATE DATABASE tatoeba USE tatoeba

Then execute the following scripts.

  1. This will create all the tables (they will be empty). \. docs/database/database_20130406.sql

  2. These will create a minimal user base (one user in each group), and the associated access rights for each user. \. docs/database/import/groups.sql \. docs/database/import/users.sql \. docs/database/import/acos.sql \. docs/database/import/aros.sql \. docs/database/import/aros_acos.sql

  3. This will import the list of countries. It's used in profile. \. docs/database/import/countries.sql

TODO Would probably be nice to have some data for sentences, comments, wall messages as well. Although they can be created manually once logged in.

Logging in

Now you should be able to go to your local Tatoeba URL (http://tatoeba.dev/ in my case), and be able to log in.

The default usernames are:

  • admin
  • corpus_maintainer
  • advanced_contributor
  • contributor
  • inactive
  • spammer

The default password for each user is '123456'.