Skip to content

Code Customization

christinerogers edited this page Jul 28, 2016 · 16 revisions

The project/ directory

The project/ directory is created by the install script, which installs a config.xml file there as well as an empty substructure of directories to house project-specific code such as instruments. The project directory and all contents should be committed to a separate private repo (excepting any data).

Tracking changes

It is highly recommended to keep a Readme file under the project/ directory tracking all your project's customizations. This practice will help developers and also be useful at Release upgrade time, when merging any module updates in the codebase with your custom code.

Modifying and overriding code under the project/ directory

The project/ directory is designed to house project-specific code and some data such as documents.
This includes instruments forms (.linst or php), instrument table schemas, and any customizations to other pages or modules in the Loris codebase.

Code stored under project/modules/ and project/libraries/ and project/templates/ will override the file of the same name found in the same path under Loris root

  • /var/www/loris/project/libraries/filename.class.inc will override /var/www/loris/libraries/filename.class.inc)

Module override

For projects wishing to customize modules, the recommended best practice is to copy all module code from $lorisroot/modules/$targetmodule/* to a new project/modules/ subdirectory (project/modules/$targetmodule/* ) and modify code there.
This will use the project/ override functionality of Loris. These changes should be added and committed to your project-specific private repo.

Clone this wiki locally