Configuration
Tequila configuration is made using a configuration file, while Tequila provides easy storage and access to configuration information in database we believe is normally easier for users to just modify a text file.
Location
Configuration file can be found in your site structure under:
yoursite/includes/config.php
Notice. This file shouldn't be part of the Tequila source folder as the configuration is per site.
Sections
Database connection
Tequila framework location
MVC configuration: Your application configuration
JavaScript minimization
Look and feel
Includes
Locale dates and times
Debugging
Security
Uploading
Email settings
Database connection
dbhost
The name of your database server or ip, this is normally localhost an IP or in some cases your hosting will provide you a URL for the db
dbuname
username of the database
dbpass
password to connect to db
dbname
Name of the database or catalog to use
dbtype
The database that your are using in the application, it must match one of the options in the db folder (tequila_fwk/includes/db/*), currently the supported types are:
mysql4
mysql
mssql
oracle
adodb
sqlite
msaccess
postgres7
This database layer files are modified versions from phpbb group release. You can add more database libraries in a very easy way, learn more about this in the data page
Adodbtype
ado Is a special library that relies on MS ADO DB components therefore it can be used with any database supported by them, therefore this library requires a subtype that is set in the parameter:
$adodbtype = "any MS ADODB supported type";
Tequila framework location
Versions 3 support using one single copy of the framework for many sites without the sites being inside the same directory structure. This is done by providing the path to the framework using the parameter
$f3path = "";
* Don't forget to escape the escape char like: D:\\
MVC configuration
General information used by the application and by the MVC class (dispatcher)
$appname
The name of the application, this setting is used to complete the ldap name of every class and call. i.e.
system.$appname.tasks.yourclass
$defaultpage
Page to call by default when no page is called,
i.e. yourapplication/index.php
This page is normally the login page or the home page of your application.
$showheadersondefault
Controls the inclusion of headers in the default page, i.e.
if you display the login page you might want to hide the header and footer (logo, menus, etc).
$mainpage
Indicates which is the application main page, normally this is the page you go to after login is successful, i.e.
Main, dashboard
$notauthorized
The page to show when a task is not authorized, not authorized tasks actually follow this behaviour:
Security check fails
User NOT logged in ----- go to ----->> Login page
User logged in ------------ go to ----->> not authorized page
JavaScript minimization
$js_safeloading
Tequila offers you the possibility of compressing and integrating all your JavaScript source into a single file on the fly, this approach have many advantages as it reduces the points of failure in your scripts, reduce the size of your scripts and reduce the amount of files to download which affect speed you can find more about it on the web.
Tequila do this using a combination of JavaScript, the PHP JSMin implementation made by Douglas Crockford, some extra code add for caching and the general mechanism built in Tequila to handle JS files.
Please notice that minimization requires your JS code to be very well written, without missing semicolons or blocks not marked with {}
You can enable / disable this behavior using the parameter:
$js_blocktillcomplete
Additionally Tequila can block the execution on the client side by adding a layer that covers the page and displays a loading symbol until all JS resources have been successfully loaded.
$js_retry
While normally all download work without issues, in certain environments with connectivity issues we have experienced failure to download files randomly (This is the case when something fails to load you press F5 and all works).
This parameter will set how many times the JS library will try to download the JS file before showing an error message
$js_cachedir
As minimization is a very expensive process we discover it couldn't be done on the fly without serious delays, so we added caching. This allows you to modify at any time your JS source without worrying that the final minimized version matches your changes. Tequila takes care it does.
This parameter will set the location to store minimized cache files, please be sure this directory have writing permits
Look and feel
$style
Defines the template to use, we understand some applications allow every user to use his own template to view a site, but for enterprise systems we think is more professional to use a single standard style so here you can set it.
imgpath
As all files are run from root the images location (images/) cannot be properly referred, therefore Tequila requires you to replace this path for imgpath in all templates, not very beautiful indeed but working. You don't need to modify this parameter unless you name the directory different or place the images in a different location.
Includes
You can define in this place the resources shared by the whole system, CSS, Javascript files to be included in every page.
$inc is an array with 3 values:
JS
Any JS file you want to include, use comma to separate the names (no spaces)
CSS
CSS files to include
jsvars
Use to set JavaScript variables, i.e. Messages, paths, data.
* Notice. Includes are only added for page calls, in other calls they are removed to keep a clean output, please check RRT for more information
Locale dates and times
$language
Tequila uses 2 different language settings
Application setting
User setting
Config file takes care of the application setting, this one is used whenever the user language is unknown, tequila will not try to guess or use the default browser language as default. To set the language for a user you can either:
Login,
Add a language selector somewhere on your page
$dateformat
After years developing applications and living in 2552 (thai year) we come to don't trust any date format, we only like canonical date and all information moving across Tequila should use it for better portability. But we understand user wants to see their own date style, so you can set here the view style following PHP standards.
Charset
HTML and XML charset to use can be defined here, normally you will be on the safe side using UTF-8. This parameter is applied to every HTML and XML (ajax) response.
We are currently considering moving this information somewhere in languages, so a different language can use a different charset. Please let us know if you require this.
Debugging
Tequila offers simple debugging capabilities using the functions:
myecho and mytoggle (See debugging for more)
$debug
Allow you to enable debugging for everyone
$debug_code
You can also enable debugging per call on demand using a special code
$debug_code = "xxxxx";
* Be sure to modify this parameter or anyone with bad intentions (or just curious) will be able to see your debugging messages
To see debugging information add to the URL:
&debug=xxxxx
Security
Tequila is a fully secured framework, every call made to your application passes trough the security layer, you can also add calls to modify the behavior depending on security settings. (See security for more)
$secKeysCache
Tequila security uses a session cache to optimize its execution, you can fine tune this cache by modifying this parameter.
$strictSec
Defines the nature of the system and establishes the last level of security, if no specific security setting exist at any level, the security engine will return !$strictSec.
False: Open system; Security is not strict, if not denied is authorized
True: Closed system; Security is strict, if not approved is denied
Uploading
Define here the maximum size for uploads, this setting does not alter the PHP default setting or anything other, it simply add this value on forms that have a file upload control in a hidden control. This is according to HTML-Browser behavior
Email settings
Setting for phpmailer.
from_name : Appears as the sender
from_email : Account to use to send email
smtp_mode : enabled (use smtp) / disabled (use php-server default)
smtp_host : email host that accept forwarding from_email account
smtp_port : Port to use to send email (25 default)
smtp_username : Username to login to from_email account
(anonymous normally not working nowadays)
smtp_password : Password of from_email account