To use Temma, you need web hosting using the PHP interpreter version 8.0 or higher.
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
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.
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.
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.
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
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.
- index.php: Main PHP script, which starts the framework.