Version at: 07/04/2013, 13:45 vs. version at: 07/04/2013, 13:47
11NOTE: This is about installing the PHP version (i.e. current version) of Tatoeba.
22
33# Downloads
44
55## Required tools
66
77* Apache
88* PHP
99* MySQL
1010* SVN Client
1111
1212For those who are on Windows:
1313
1414* [XAMPP](http://www.apachefriends.org/en/xampp-windows.html) will do the trick for Apache/PHP/MySQL.
1515* [TortoiseSVN](http://tortoisesvn.net/downloads.html) for the SVN client
1616
1717## Source code
1818
1919The source code is hosted on a platform called Assembla:
2020[https://www.assembla.com/code/tatoeba2/subversion/nodes](https://www.assembla.com/code/tatoeba2/subversion/nodes)
2121
2222Repository URL:
2323[https://subversion.assembla.com/svn/tatoeba2/](https://subversion.assembla.com/svn/tatoeba2/)
2424
2525URL you'll want to checkout:
2626[https://subversion.assembla.com/svn/tatoeba2/trunk/](https://subversion.assembla.com/svn/tatoeba2/trunk/)
2727
2828
2929# Configuration
3030
3131## Virtual host
3232
3333You may set up a virtual host. I personally use http://tatoeba.dev/ as my local URL.
3434
3535**TODO** More details on how to do that.
3636
3737
3838## mod_rewrite
3939
4040You need to have mod_rewrite enabled, it's necessary for CakePHP.
4141
4242**TODO** More details on how to do that.
4343
4444
4545## app/core/config.php
4646
4747In the file app/core/config.php, put into comments the part about XCache.
4848
4949 /*
5050 Cache::config('default', array(
51    'engine' => 'Xcache', //[required]
52    'duration'=> 3600, //[optional]
53    'probability'=> 100, //[optional]
54    'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
55    'user' => 'user', //user from xcache.admin.user settings
51 'engine' => 'Xcache', //[required]
52 'duration'=> 3600, //[optional]
53 'probability'=> 100, //[optional]
54 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
55 'user' => 'user', //user from xcache.admin.user settings
5656 'password' => 'password', //plaintext password (xcache.admin.pass)
5757 ));
5858 Cache::config('_cake_core_', array(
59    'engine' => 'Xcache', //[required]
60    'duration'=> 3600, //[optional]
61    'probability'=> 100, //[optional]
62    'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
63    'user' => 'user', //user from xcache.admin.user settings
59 'engine' => 'Xcache', //[required]
60 'duration'=> 3600, //[optional]
61 'probability'=> 100, //[optional]
62 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
63 'user' => 'user', //user from xcache.admin.user settings
6464 'password' => 'password', //plaintext password (xcache.admin.pass)
6565 ));
6666 */
6767
6868And uncomment the line to use the "File" cache engine:
6969
7070`Cache::config('default', array('engine' => 'File'));`
7171
7272
7373
7474## app/core/database.php
7575
7676In the file app/core/database.php, set your login, password and database in the $default array.
7777
78`
79var $default = array(
80    'driver' => 'mysql',
81    'persistent' => false,
82    'host' => 'localhost',
83    'login' => 'root',
84    'password' => 'somepassword',
85    'database' => 'tatoeba',
86    'prefix' => '',
87    'encoding' => 'utf8'
88);
89`
78 var $default = array(
79 'driver' => 'mysql',
80 'persistent' => false,
81 'host' => 'localhost',
82 'login' => 'root',
83 'password' => 'somepassword',
84 'database' => 'tatoeba',
85 'prefix' => '',
86 'encoding' => 'utf8'
87 );
88
9089
9190## app/models/sentence.php
9291
9392Tatoeba uses some other external tools that you won't necessarily need. These tools are:
9493
9594* the search engine (Sphinx)
9695* the tools for romanization
9796
9897If 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).
9998
10099line 274: uncomment "return array(1)"
101`public function getSeveralRandomIds($lang = 'und', $numberOfIdWanted = 10)
102{
103 // Uncomment the line below if you don't have sphinx installed.
104 return array(1);`
100
101 public function getSeveralRandomIds($lang = 'und', $numberOfIdWanted = 10)
102 {
103 // Uncomment the line below if you don't have sphinx installed.
104 return array(1);`
105105
106106line 847: uncomment "return false"
107`public function generateMetas(&$sentenceArray)
108{
109 // Uncomment the line below you don't have the Chinese
110 // romanization tools installed.
111 return false;`
107
108 public function generateMetas(&$sentenceArray)
109 {
110 // Uncomment the line below you don't have the Chinese
111 // romanization tools installed.
112 return false;`
112113    
113114    
114115# Database
115116
116117Now you need to create the database, and import the necessary things.
117118
118119First, 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.
119120`CREATE DATABASE tatoeba`
120121`USE tatoeba`
121122
122123Then execute the following scripts.
123124
1241251. This will create all the tables (they will be empty).
125126`\. docs/database/database_20130406.sql`
126127
1271282. These will create a minimal user base (one user in each group), and the associated access rights for each user.
128129`\. docs/database/import/groups.sql
129130\. docs/database/import/users.sql
130131\. docs/database/import/acos.sql
131132\. docs/database/import/aros.sql
132133\. docs/database/import/aros_acos.sql`
133134
1341353. This will import the list of countries. It's used in profile.
135136`\. docs/database/import/countries.sql`
136137
137138**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.
138139
139140
140141# Logging in
141142
142143Now you should be able to go to your local Tatoeba URL (http://tatoeba.dev/ in my case), and be able to log in.
143144
144145The default usernames are:
145146
146147* admin
147148* corpus_maintainer
148149* advanced_contributor
149150* contributor
150151* inactive
151152* spammer
152153
153154The default password for each user is '123456'.
diff view generated by jsdifflib

Version at: 07/04/2013, 13:45

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:

* [XAMPP](http://www.apachefriends.org/en/xampp-windows.html) will do the trick for Apache/PHP/MySQL.
* [TortoiseSVN](http://tortoisesvn.net/downloads.html) for the SVN client

## Source code

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

Repository URL:
[https://subversion.assembla.com/svn/tatoeba2/](https://subversion.assembla.com/svn/tatoeba2/)

URL you'll want to checkout:
[https://subversion.assembla.com/svn/tatoeba2/trunk/](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'.

version at: 07/04/2013, 13:47

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:

* [XAMPP](http://www.apachefriends.org/en/xampp-windows.html) will do the trick for Apache/PHP/MySQL.
* [TortoiseSVN](http://tortoisesvn.net/downloads.html) for the SVN client

## Source code

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

Repository URL:
[https://subversion.assembla.com/svn/tatoeba2/](https://subversion.assembla.com/svn/tatoeba2/)

URL you'll want to checkout:
[https://subversion.assembla.com/svn/tatoeba2/trunk/](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'.

Note

The lines in green are the lines that have been added in the new version. The lines in red are those that have been removed.