Documentation

Installation

Prerequisite

To use Temma, you need web hosting using the PHP interpreter version 7.3 or higher.

Temma can use all the databases supported by the PDO extension, as well as the noSQL Redis database, and the Memcached cache server.

Download Temma

To download and use Temma, you can clone the GitHub repository:

$ git clone https://github.com/Amaury/Temma my_project

You can also download and unzip the archive: https://github.com/Amaury/Temma/archive/master.zip

Download Smarty

Unless you are using Temma to build an API without generating an HTML page, you will need the Smarty templating engine.

Smarty can optionally be installed through the package system of your operating system. If not, download the latest version of Smarty, then unzip the archive. Get the contents of the libs/ subdirectory, and place it in a folder named smarty3, which you will have created in the lib/ directory of your project.

Install Temma

Once the Git repository is cloned, set the permissions on the directories:

$ cd my_project; chmod 755 log tmp

Then, you have to know if you are using the Apache configuration or the configuration by .htaccess files.

.htaccess files

The .htaccess files are necessary in case of shared hosting.
If so, you don't have to do anything. The files are already present at the root and in the www/ directory.

Apache server

The Apache configuration is to be used if you have your own dedicated server.
You will find an example file in the etc/ directory, to adapt according to your needs.

You will also need to delete the existing .htaccess files:

$ cd my_project; rm -f .htaccess www/.htaccess

Project tree

Here is the content of a Temma project:

my_site/
        bin/
        controllers/
        etc/
           temma.json
           apache.conf
        lib/
           Temma/
           smarty/
           smarty-plugins/
        log/
           temma.log
        templates/
        tmp/
        var/
        views/
        www/
           index.php
  • bin: Contains your maintenance scripts.
  • controllers: Main directory for your controllers.
  • etc: Configuration directory
    • temma.json: Project configuration file.
    • apache.conf: "virtual host" configuration file, in the case of an Apache server.
  • lib: Base directory containing the external libraries, but also your business objects.
    • Temma: The framework code.
    • smarty: Smarty template engine.
    • smarty-plugins: Smarty plugins offered by Temma.
  • log: Directory containing the log files.
    • temma.log: Project log file.
  • templates: Directory containing the templates.
  • tmp: Directory of temporary files.
  • var: Optional directory, which can contain the data files of your application.
  • views: Optional directory, which can contain your own views.
  • www: Root directory of the website, containing all CSS, Javascript and images files.
    • index.php: Main PHP script, which starts the framework.
Previous: Migration
Next: Configuration

Table of Contents