Extension's folder structure


Saurus CMS Extension consists of system folders and files having reserved names and any number of additional folders and files created by developer.
Reserved folders and files are processed during the quick install of extensions, also called as synchronisation routine.

 

Extension's folder name

Extension's folder name ("my_extension" in the sample image) is unique idenitifier of the extension.  The name is displayed in the Extension Manager and used to refer to particular extension in the Saurus API code.
NB! The folder name may not contain any spaces or special characters.

Reserved files and folders


Folder / File name
 Description
extension.config.php Extension's configuration file. Contains information about the extension (name, author, version, etc) and included system files (templates, admin-pages, etc).
admin/ Contains CMS admin-pages scripts.
install/ Contains installation/upgrade files - SQL files executed during extension's quick install or upgrade. SQL files must have file extension ".sql".
lang/ Contains language files imported during extension's quick install. Language files must be located in the folders with character encoding name, eg "UTF-8", "ISO-8859-1", etc.

Additional files and folders

Extension's folder can have any folder structure (except reserved names), below are suggestions for more frequently needed file and folder names.

Folder / File name
Description
logo.gif
Image file containing extension's logo displayed in the Extension Manager. File name and location is defined in the extension's configuration file.
readme.html
README file in HTML format containing general information about particular extension (description, system requirements, installation guide, version history, etc)
content_templates/ Contains CMS content templates written in Saurus API code
object_templates/ Contains CMS object templates written in Saurus API code
page_templates/Contains CMS page templates written in Saurus API code
css/Contains CSS files
js/Contains Javascript files
images/Contains graphic files

Security issues

To avoid direct URL access of some extension's files we suggest to use .htaccess directives. It's good practice to restrict access to folders containing:
  • PHP scripts, code libraries - all included PHP scripts
  • CMS templates - all CMS template folders written in Saurus API code
  • cron job scripts - periodically executed PHP scripts
  • .. any folder that should not be directly accessed from URL
Place following .htaccess file to the folder with restricted access:
<Files *>
    deny from all
</Files>

Extensions

Overview of Extensions / Extension's folder structure / Extension's configuration file / Extension's configuration file variables / Default extension "Saurus4" / Creating a new extension / Synchronisation / Smarty plugins / Smarty pre-, post- and outputfilters / PHP and Saurus CMS / Creating custom admin-pages / Creating custom Site Log entries / Using Saurus database API