Requirements

Allikas: Juhised

In order to run the web system, the following requirements must be met:

Rewrite module[muuda]

This module is for creating for friendly URL-s and can be enabled with the following command:

sudo a2enmod rewrite

MDB2[muuda]

This is a PEAR's module and required for the interaction with the database. The names of the programs in Synaptic are php-mdb2 and php-mdb2-driver-mysql.

Mail[muuda]

This is a PEAR's module and required for sending emails from the system. The name of the program in Synaptic is php-mail.

HTML/Template/IT[muuda]

This is a PEAR's module and required for templating. Every visible part of the page will be built into a template. The name of the program in Synaptic is php-html-template-it.

Cache[muuda]

This is a PEAR's module and required for caching. The name of the program in Synaptic is php-cache.

We use a folder outside the web root directory for storing cache files:

mkdir cache
sudo chmod 777 cache/
sudo chown www-data:www-data cache/

Calendar[muuda]

This is a PEAR's module and required for the calendar. It can be installed like that:

sudo pear install Calendar-0.5.5

DB/NestedSet[muuda]

This is a PEAR's module and required for all the hierarchical data. The name of the program in Synaptic is php-db. Additional NestedSet can be installed like that:

sudo pear install --alldeps DB_NestedSet

Folders[muuda]

There must be a project folder. Through the system uploaded files will be stored in filesOfObjects:

mkdir filesOfObjects
chmod 777 filesOfObjects/
sudo chown www-data:www-data filesOfObjects/

Having those warrants, the system takes care of creating and removing the folders inside filesOfObjects.


The following folders are needed outside the web root folder:

mkdir originals_[the name of the web project]
sudo chmod 777 originals_[the name of the web project]/ -R

Database[muuda]

In the database, there must be the minimum data in. For the language support you have to copy the entire content of the Dialect table from another database. We need the option to translate the system strings:

INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'keeled_SystemString_systemStrings'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '1', '1876', 'system-strings'
);

Given that 1876 is English we go to the address system-strings and the page for translating the system strings will open.

We also need at least the translation in the English language for system components:

INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'keeled_SystemString_hierarchy'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '2', '1876', 'hierarchy'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'keeled_SystemString_pages'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '3', '1876', 'pages'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'keeled_SystemString_users'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '5', '1876', 'users'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'main_index_unknownFunction'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '6', '1876', 'The function "%1$s" is unknown.'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'index_unknownFunction'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '7', '1876', 'The function "%1$s" is not present.'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'SystemAliasController_clearCache'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '8', '1876', 'clear-cache'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_loginForm'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '9', '1876', 'login-form'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_userList'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '10', '1876', 'user-list'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_login'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '11', '1876', 'login'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_newsButtons'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '12', '1876', 'news-buttons'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'O_unknownIdOfSystemString'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '13', '1876', 'The system string "%1$s" is unknown.'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_menus'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '14', '1876', 'menus'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'O_descriptionOfSystemStrings'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '15', '1876', 'The system strings are reserved for the use by the system only.'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'O_keywordsOfSystemStrings'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '16', '1876', 'system strings, system use'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'O_titleOfSystemStrings'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '17', '1876', 'Strings used by the system only'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'O_unknownAddress'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '18', '1876', 'The alias "%1$s" is unknown.'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'errors_Error_error'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '19', '1876', 'error'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'keeled_SystemString_deletingSystemStringFailed'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '20', '1876', 'Removing the system string "%1$s" has failed.'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_systemString'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '20', '1876', 'system-string'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_languages'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '21', '1876', 'languages'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_loginFormButton'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '21', '1876', 'login-form-button'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_systemStringComponents'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '22', '1876', 'system-string-components'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_systemStringUpdate'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '23', '1876', 'update-system-string'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'keeled_Language_queryingLanguageFailed'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '24', '1876', 'The querying the language "%1$u" has failed.'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_page'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '25', '1876', 'leht'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'errors_Error_typeNotGetNorPost'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '26', '1876', 'The type must be either "_GET" or "_POST".'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'errors_Error_parameterNotSet'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '27', '1876', 'The parameter "%1$s" must exist.'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_formForUpload'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '28', '1876', 'upload-form'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_pageUpdate'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '29', '1876', 'update-page'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_pageButton'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '30', '1876', 'page-button'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'config_pageInsert'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '31', '1876', 'insert-page'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'lehed_Page_insertingPageNewsUnsuccessful'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '32', '1876', 'Inserting a page failed.'
);
 
INSERT INTO `SystemString` (
`idSystemString` ,
`id`
)
VALUES (
NULL , 'lehed_CommonPageView_unknownLocale'
);
 
INSERT INTO `TranslationOfSystemString` (
`idTranslationOfSystemString` ,
`idSystemString` ,
`idDialect` ,
`translation`
)
VALUES (
NULL , '33', '1876', 'No locale found for "%1$s".'
);

A main administrator:

INSERT INTO `Human` ( `idHuman` , `username` , `passWord_2` , `regdate` , `email` , `firstName` , `lastName` , `phoneNo`, `isMainAdministrator`)
VALUES ( 1, 'kalmer', '9be492913aeedbbadc12ffe9730b193c', '0000-00-00 00:00:00', 'kalmer@tennis24.ee', 'Kalmer', 'Piiskop', '5620 4556', '1') ;

At least the main page must be in:

INSERT INTO `Page` (
`idPage` ,
`idHuman` ,
`isPublic`
)
VALUES (
'1', '1', '1'
);
 
INSERT INTO `TranslationOfPage` (
`idTranslationOfPage` ,
`idHuman` ,
`idDialect` ,
`idPage` ,
`title` ,
`keywords` ,
`description` ,
`content`
)
VALUES (
NULL , '1', '1876', '1', 'O', 'O, CMS', 'O - the CMS based on real needs.', NULL
);

The first node is the root node (lines 1 - 2). The second node is for menus (lines 3 - 4) and the third node for the menu that will be showed only if logged in (lines 5 - 6). The further three nodws are for menu elements in the logged-in-menu (lines 7 - 12):

  1. INSERT INTO `EA` ( `lft` , `rgt` )
  2. VALUES ( 1, 12 ) ;
  3. INSERT INTO `EA` ( `lft` , `rgt` )
  4. VALUES ( 2, 11 ) ;
  5. INSERT INTO `EA` ( `lft` , `rgt` )
  6. VALUES ( 3, 10 ) ;
  7. INSERT INTO `EA` ( `lft` , `rgt` )
  8. VALUES ( 4, 5 ) ;
  9. INSERT INTO `EA` ( `lft` , `rgt` )
  10. VALUES ( 6, 7 ) ;
  11. INSERT INTO `EA` ( `lft` , `rgt` )
  12. VALUES ( 8, 9 ) ;

The main menu elements that are needed for the administration:

INSERT INTO `SystemMenuItem` ( `idSystemString` , `idEA` )
VALUES ( 1, 4 );
INSERT INTO `SystemMenuItem` (
`idSystemMenuItem` ,
`idSystemString` ,
`idRequisites` ,
`idPage` ,
`idPageNews` ,
`idEA` ,
`viide` ,
`title`
)
VALUES (
NULL , '2', NULL , NULL , NULL , '5', NULL , ''
);

The requisites:

INSERT INTO `Requisite` ( `idRequisites`)
VALUES (1) ;
 
INSERT INTO `TranslationOfRequisites` ( `idDialect` , `idRequisites` , `content` , `keywords` , `description` , `title` )
VALUES ( 1876, 1, ' <p>MTÜ Eesti Kõrgkoolitennise Liit<br/>registrikood 80272698</p><p>Instituudi tee 3-27<br/>EE76902 Harku<br/>Harku<br/>Harju</p><p>+372 5620 4556<br/></p><p>LHV Pank (LHVBEE22): EE467700771001140735</p>', 'requisites', 'The requisites.', 'Requisites' )

.htaccess[muuda]

In this file, the links to error files must be updated.

config.php[muuda]

These files are in many places. The file that is currently in use resides in the root folder. This is the copy of the current developer's work computer's subfolder in the folder config. In the latter folder, there are configuration files for other systems: testing, live etc.

The file must be required once at the beginning of every controller because it makes some procedures needed to be done before everything else goes on.

The configuration file is divided into blocks. In order to make the system work, there must be done some configuration.

There shall be a Facebook app. There must be enabled Website with Facebook Login. In the block FB:

define('FB_API_KEY', '[App ID]');
define('FB_SECRET', '[App Secret]');

In the block nested set ID's:

define('NESTED_SET_MENU_FOR_LOGGED_IN', 3);

This is the menu for the logged-in-user.

build.xml[muuda]

For the first upload, the row

				<exclude name="assets/js/jscalendar-1.0/**"/>

must be commented out. Later it must be commented in again because there is a huge amount of files that we do not need to upload over and over again - they are from a third-party and we never modify them.

SVN[muuda]

This part is very important in order to save you from troubles later! Please mark the folders cache and filesOfObjects as well as the file config.php in the root folder to be ignored by SVN. Otherwise you have to revert them and delete from the repository in order to be able to mark again.