Download |
Bug Tracking |
Source |
Documentation |
Forum |
Latest Changes |
Home
Using the static method Pluf::f('configuration_key') you can access
the configuration keys defined in your configuration file.
This method accepts a second parameter to be used as default parameter. You must use it wisely to avoid the need of a configuration in the default case. For example:
$time_zone = Pluf::f('time_zone', 'Europe/Berlin');
This will default to 'Europe/Berlin' if not defined in the
configuration file. The default configuration keys of Pluf are
listed here. Your applications are free to add new ones, but if
possible always try to use the default configuration variables when
you can.
If your application uses the prefix MyApp for all its classes, by
convention, your specific configuration variables should have the
prefix myapp_.
The configuration file of an application is passed to the
Pluf::start method in the entry point (the index.php file) of your
application.
The file must return an associative array of configuration values. For readability, you should write it like that:
<?php
$cfg = array();
$cfg['debug'] = true;
$cfg['time_zone'] = 'Europe/Berlin';
return $cfg;
In all your PHP files, you should not include a trailing ?> at the
end of the file.
Enable debug information or not. Do not use it in production!
Time zone for the application, you can pick up another one using the list available on the PHP website.
You should not change it.
List of installed applications.
Function to get a DB connection resource, you can customize it to have per model connection.
The classes in PEAR are not all PHP5 compliant, by providing the path the error handler can ignore the non fatal errors coming from the PEAR classes.
The database engine used. This can be SQLite, MySQL or
PostgreSQL. The name is case sensitive.
The database server, not used for the SQLite engine.
The database, this is the full path to the database file in the case
of the SQLite engine.
When creating the SQLite database with the command line tools and then using it with Apache, you need to be sure that the database is writable for the Apache process.
The login to access the database server, not used for the SQLite
engine.
The password to access the database server, not used for the SQLite
engine.
If you want to have multiple installations within the same database, you can add a prefix for the créations of the tables.
For the moment, used only for the MySQL driver to handle the case of
the pre 4.1 versions which were not able to handle the UTF-8 encoding
correctly.
If you want to use row level permissions in the permission system. Most of the application require that but it as a small overhead when getting the permissions for a user (1 SQL query) and when dropping a user or a group (1 SQL query).
Default mime type for the answers.
Cookie path.
It will use the current domain.
Give access to the cookies only for a SSL link.
Create HTTP only cookies. By forcing HTTP only cookies, a range of XSS exploits can be avoided. Change that only if you know what you are doing.
Sessions are using a cookie, this is the name of the cookie.
The name of your login view.
Admins. Admins are notified by email when an error occures on a production server.
Example:
array(
array('Admin', 'admin@example.com'),
);
How to send the emails, by default using the builtin mail function
of PHP. Pluf is using the PEAR Mail package
in the background.
You can pass the parameters you want to the
Mail::factory()
method by setting the parameters as defined in the Mail::factory definition
with the addition of the mail_ prefix. This is to avoid a conflict with
the other configuration variables.
For example, if you are using the smtp backend and want to set the
timeout to 60 seconds, just add the following in your config file:
$cfg['mail_timeout'] = 60;
If you set to false, emails will not be sent, this can be practical during unit testing. You can also use fakemail for email testing.
This is critical configuration variable. You need to set it to a unique long string for each installation.
An array of path to folders where the template engine will find the templates. The order in the list matters, the engine will stop at the first template found.
Temporary folder where the compiled templates are stored together with all the dynamically cached data. This folder must be writeable by your Apache process.
List of extra template tags. For example:
$cfg['template_tags'] = array(
'hotkey' => 'IDF_Template_HotKey',
'issuetext' => 'IDF_Template_IssueComment',
);
This gives access to 2 new tags hotkey and issuetext in the templates.
List of extra template modifiers. For example:
$cfg['template_modifiers'] = array(
'size' => 'IDF_Views_Source_PrettySize',
'markdown' => 'IDF_Template_Markdown_filter',
);
Here you will be able to use for example {$file.size|size} in your
templates.
If you are using a request context object as a context for your templates, you can preprocess automatically the context to add variables.
If you are using the media tag, you can use a last update file which
modification timestamp will be used to happen a unique string at the
end of the file. This allows you, for example, to force user agent to
reload the latest version of your css style sheets.
Path to your simple test installation if you are using the unit testing framework (yes, you should perform unit tests!).
Report issues in the documentation
If you find errors or issues in the documentation, report a bug. We will update the documentation accordingly.
Pluf © 2005-2008 Loïc d'Anterroches, supported by Céondo Ltd.