Config files

From PHPDevShell

Jump to: navigation, search

(written on July 15, 2009 for version 2.7.1)


When PHPDevShell starts, it reads various configuration files from the /config folder. These files holds configuration informations, some are required, some are optional. No files are mandatory (i.e. you can store the information in any of them), but without the mandatory parameters (such as database access), PHPDevShell will not be able to run.

The configuration files

  • host.config.php

This file is meant to store a list of config files which are not in the default list. For example:

$configuration['host'][$_SERVER['SERVER_NAME']] = 'default';

Note that you can add any configuration information there, also we advise you put them inside other configuration files.

  • default.config.php

This file contains all the default values for the required parameters. Make sure you have at least one file with values for all these parameters.

  • Three more files are loaded (if they exist): one with the content of $configuration['host'][$_SERVER['SERVER_NAME']], one with $_SERVER['SERVER_NAME'], and one with the content of the Apache variable named PHPDS_HOSTNAME (all with the suffix .config.php, in the /config folder).

NOTE 1: all theses files are tried in this order, so if a parameter is set twice, only the latter will be used.

NOTE 2: the server name comes from Apache web server, so if you use virtual hosting, you can have the same installation of PHPDS running on several hostnames with (partially of completly) different configuration.

The configuration parameters

/**
 * Database details.
 * MySQL database name.
 * @global string
 */
$configuration['database_name'] = 'phpdev';
/**
 * Database details.
 * MySQL database username.
 * @global string
 */
$configuration['database_user_name'] = 'root';
/**
 * Database details.
 * MySQL database password.
 * @global string
 */
$configuration['database_password'] = 'root';
////////////////////////////////////////////////////////////////////////////////////////////
// Extra Settings, these settings should be changed only when required. ////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
/**
 * Database details.
 * Where your MySQL server is located, (localhost).
 * @global string
 */
$configuration['server_address'] = 'localhost';
/**
 * Database details.
 * The prefix you use before your database table names.
 * @global string
 */
$configuration['database_prefix'] = 'pds_';
/**
 * Persistent database connections.
 * Use persistent connections to the database to avoid connection overhead.
 * @global boolean
 */
$configuration['persistent_db_connection'] = false;
/**
 * Cache type.
 * Currently PHPDevShell support two types of cache systems, 'memcache' and 'filecache'.
 * @global integer
 */
$configuration['cache_type'] = 'filecache';
/**
 * Cache refresh intervals in seconds.
 * Helps with overall performance of your system. The higher the value the less queries will be done, but your settings will be slower to update.
 * @global integer
 */
$configuration['cache_refresh_intervals'] = 120;
/**
 * Memcache server details.
 * Only complete this when you are using the memcache extention, this is not needed for file based caching.
 * Uncomment to use.
 * @global string
 */
$configuration['memcache_server'] = 'localhost';
/**
 * @global integer
 */
$configuration['memcache_port'] = 11211;
/**
 * @global integer
 */
$configuration['memcache_timeout'] = 120;
/**
 * @global integer
 */
$configuration['memcache_persistent'] = false;
/**
 * Login session life.
 * This is how long the session will be remembered with each new login.
 * @global integer
 */
$configuration['session_life'] = 1440;
/**
 * Sets the temp session data save path, false to use default.
 * (Needs to be writable)
 * @global string $configuration['session_path']
 */
$configuration['session_path'] = 'write/session/';
/**
 * Template Compile path.
 * (Needs to be writable)
 * @global string $configuration['compile_path']
 */
$configuration['compile_path'] = 'write/compile/';
/**
 * Cache path.
 * (Needs to be writable)
 * @global string $configuration['cache_path']
 */
$configuration['cache_path'] = 'write/cache/';
/**
 * Temporary writable folder path.
 * (Needs to be writable)
 * @global string $configuration['tmp_path']
 */
$configuration['tmp_path'] = 'write/tmp/';
/**
 * Files uploading folder path.
 * (Needs to be writable)
 * @global string $configuration['upload_path']
 */
$configuration['upload_path'] = 'write/upload/';
/**
 * Force system down bypass.
 * If your session expired while system was set to down/maintenance in the config gui, you can gain login access again by setting this option true.
 * @global boolean $configuration['system_down_bypass']
 */
$configuration['system_down_bypass'] = false;
/**
 * If true $lang variables will also be converted to constants.
 * @global boolean $configuration['constant_conversion']
 */
$configuration['constant_conversion'] = false;
/**
 * Select extra functions to load in engine. Functions in these files will always be available.
 * Example : utils.php
 * @global array
 */
$configuration['function_files'] = array();
////////////////////////////////////////////////////////////////////////////////////////////
// Debuggin Support. ///////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
/**
 * Enable Debugging.
 * @global boolean
 */
$configuration['debug']['enable'] = true;
/**
 * Debug level.
 * DEBUG = 4;
 * INFO = 3;
 * WARN = 2;
 * ERROR = 1;
 * LOG = 0;
 * @global integer
 */
$configuration['debug']['level'] = 4;
/**
 * Use FirePHP as debugging platform.
 * @global boolean
 */
$configuration['debug']['firebug'] = true;
/**
 * Do server debugging logs.
 * @global boolean
 */
$configuration['debug']['serverlog'] = true;
/**
 * Debug domains filter to include in debugging output, domains must be listed here before it will be included in firephp.
 * @global array
 */
$configuration['debug']['domains'] = array('core', 'db', 'navigation', 'security', 'template');
/**
 * To what file should critical errors be written to.
 * (Needs to be writable)
 * @global string
 */
$configuration['debug']['file_log_dir'] = 'write/logs/';
/**
 * To what email should critical errors be emailed to, make sure php can send mail, this does not use the PHPDevShell mailing engine.
 * @global string
 */
$configuration['debug']['email_critical'] = 'yourmail@phpdevshell.org';
/**
 * Should errors be shown onscreen in the web browser?
 * @global boolean
 */
$configuration['debug']['display_errors'] = true;
/**
 * Ignore notices?
 * @global boolean
 */
$configuration['debug']['ignore_notices'] = false;
/**
 * Ignore warnings?
 * @global boolean
 */
$configuration['debug']['ignore_warnings'] = false;