Documentation
Installation
Table of Contents ▼
Prerequisite
To use Temma, you need web hosting using the PHP interpreter version 8.0 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
If you use Temma to create an API without HTML page generation, you won't need the Smarty templating engine. Otherwise, Temma needs Smarty version 4 or higher (if you are using PHP 8.1, you will need Smarty 4.1).
Please download the archive (ZIP or TAR.GZ format) of the latest version of Smarty.
Unpacking the archive, you will see a libs/ subdirectory. Rename it smarty4 and then move it inside your project's lib/ directory.
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
- Migration : How to upgrade from Temma 1.x to version 2
- Installation : Download Temma and install it to start your web project
- Configuration : All the configuration directives of the etc/temma.json file and the optional environment variables
- External libraries : How to use external function libraries
- Routing : Temma's default routing system, and advanced routing
- Log : Use of the log system, management by criticality levels
- Controllers : Essential parts of your web application
- Views : Smarty templates or JSON/CSV/RSS/iCal/INI exports
- Dependency injection : The backbone of your application developments
- Sessions : Extension of user sessions managed by PHP
- Data sources : Unified data access management
- Model : How to use DAOs to access databases
- Execution flow : How to manage the execution flow, between plugins and the controller
- Plugins : How to use plugins, and create your own plugins to modularize your code
- Attributes : How to filter access to controllers and actions
- Command-line interface : To create executable scripts on the command line, automatically initialized by Temma
- Helpers : Items offered by Temma to help you in various circumstances