Source for file config.php
Documentation is available at config.php
* General configuration (constants and variables)
* DO NOT MODIFY THIS FILE, USE 'local_config.php' TO TUNE PREFERENCES.
* @author Jean-Philippe Brunon <jp75018@free.fr>
* @copyright 2007-2009 Jean-Philippe Brunon
* @license http://www.opensource.org/licenses/gpl-license.php GPL
* @version $Id: config.php 68 2009-03-28 22:57:30Z jp75018 $
* 1. Constants : Should not be modified !
* Package name (as displayed)
define('PACKAGE_NAME', 'PHP-Endurance');
define('PACKAGE_VERSION', '1.0.4');
* Package full name (name version)
define('PACKAGE_FULLNAME', PACKAGE_NAME .
' v'.
PACKAGE_VERSION);
require_once ('conf/svn_release.php');
* Package full name + SVN release (name version SVN-release)
define('PACKAGE_FULLNAME_SVN',
PACKAGE_FULLNAME .
' (SVN release : ' .
SVN_VERSION .
')');
{ define('PACKAGE_FULLNAME_SVN', PACKAGE_FULLNAME); }
define('OFFICIAL_WEB', 'www.php-endurance.org');
* One calory in Joules, to compute energy in cal or Kcal
define('CALORY_2_JOULE', 4.184);
* Constant to convert VO2max (general) <--> MAS (running specific)
define('VO2MAX_VMA_RATIO', 3.50);
* Default rest heart rate if not in user files / database
* Default maximum heart rate if not in user files / database
* Maximum stride length (cm), in case of too high value
* Minimum difference of altitude (meters), to detect ascend
define('MIN_DELTA_ALTITUDE', 4);
* Gravitational constant (m/s-2), to compute optential energy
* Constant to compute body energy (energy consumed at resting HR, all sports)
define('PHYSIO_CST_REST', 0.850);
* Constant to compute physiological energy = F(HR) in Kcal (all sports)
define('PHYSIO_CST_POWER', 0.0000992);
* Average efficiency (fraction of physilogical energy transformed in
* mechanical energy, sport-specific)
* @todo Tune in [0-1], use scientific studies
define('AVG_RUNNING_EFFICIENCY', 0.25);
define('AVG_CYCLING_EFFICIENCY', 0.75);
* Constant to compute move energy in cal / meter, sport specific
define('MOVE_CST_ENERGY', 0.94810);
* Constant (c/speed) to compute ground friction in cal / meter, sport specific
define('GROUND_CST_ENERGY', 0.18483);
* Constant (c * speed^2) to compute air friction in cal / meter, sport specific
define('AIR_CST_ENERGY', 0.00205);
* Fraction of potential energy which is reused while descending, sport specific
define('POT_DOWN_USED_CST_ENERGY', 0.67);
* Width and heigth of small icons in pixels
define('ICON_SMALL_SIZE', 16);
* Width and heigth of medium icons in pixels
define('ICON_MEDIUM_SIZE', 22);
* Width and heigth of large icons in pixels
define('ICON_LARGE_SIZE', 32);
* 2. Variables : Can be modidied in local_config.php
* Sender of email for user registration / change password.
* You should set it to a value accepted by your ISP.
* If not set, default is : 'no-reply@<package-name>.org'
* @global string $GLOBALS['noreply_from']
* Webmaster email used as contact in HTML footer
* If empty string (default) : No contact displayed in footer
* @global string $GLOBALS['webmaster_email']
$GLOBALS['webmaster_email'] =
'';
* Site name used in emails and page titles
* If not set, default is : '<package-name>'
* @global string $GLOBALS['site_name']
* Site base url used in emails
* If not set, default is : 'http://<http_host>dirname(<request_uri>)'
* @global string $GLOBALS['site_url']
$GLOBALS['site_url'] =
'http://' .
$_SERVER['HTTP_HOST'];
if (($uri_dir_name =
dirname($_SERVER['REQUEST_URI'])) !=
'/')
{ $GLOBALS['site_url'] .=
$uri_dir_name; }
* File system block size (used to measure data files disk space)
* Value must be >= 1 and <= 65536.
* Set to 512 on a windows system ?
* @global integer $GLOBALS['fs_block_size']
$GLOBALS['fs_block_size'] =
4096;
* PHP session timeout in seconds
* Value must be >= 180 and <= 86400.
* @global integer $GLOBALS['session_gc_maxlifetime']
$GLOBALS['session_gc_maxlifetime'] =
3600;
* Temporary directory to store generated files (graphics). Must end with '/'.
* APACHE USER MUST HAVE READ / WRITE / EXECUTE ACCESS ON THIS DIRECTORY.
* IT MUST BE A PATH RELATIVE TO SERVER ROOT.
* @global string $GLOBALS['tmp_dir']
$GLOBALS['tmp_dir'] =
'tmp/';
* Cleanup files in $GLOBALS['tmp_dir'] which are older than
* $GLOBALS['tmp_files_duration'] seconds.
* Value must be >= 30 and <= 86400.
* @global integer $GLOBALS['tmp_files_duration']
$GLOBALS['tmp_files_duration'] =
180;
* Upload directory to store files uploaded by users before they are moved
* to data directory. Must end with '/'.
* APACHE USER MUST HAVE READ / WRITE / EXECUTE ACCESS ON THIS DIRECTORY.
* It can be either a path relative to server root or an absolute path.
* @global string $GLOBALS['upload_dir']
$GLOBALS['upload_dir'] =
'upload/';
* Cleanup files in $GLOBALS['upload_dir'] which are older than
* $GLOBALS['upload_files_duration'] seconds.
* Value must be >= 120 and <= 86400.
* @global integer $GLOBALS['upload_files_duration']
$GLOBALS['upload_files_duration'] =
3600;
* Data directory to store users data files. Must end with '/'.
* APACHE USER MUST HAVE READ / WRITE / EXECUTE ACCESS ON THIS DIRECTORY.
* It can be either a path relative to server root or an absolute path.
* @global string $GLOBALS['data_dir']
$GLOBALS['data_dir'] =
'data/';
* Garbage collector probility (percent) to del files from tmp and upload dirs.
* Value must be >= 1 and <= 100.
* @global integer $GLOBALS['garbage_collect_proba']
$GLOBALS['garbage_collect_proba'] =
1;
* Available languages for display, comma separated list.
* Languages will be listed in this order in language select.
* @global string $GLOBALS['all_lang']
$GLOBALS['all_lang'] =
'en,fr,ru';
* Default language for display (stored in $_SESSIONS['lang'])
* @global string $GLOBALS['def_lang']
$GLOBALS['def_lang'] =
'en';
* CSS file used by default for HTML pages, must be located in 'css' directory.
* @global string $GLOBALS['general_css_file']
$GLOBALS['css_default_file'] =
'phpendurance.css';
* Default browser width (if cannot be obtained through 'browser_width' cookie)
* Value must be >= 600 and <= 2000.
* @global integer $GLOBALS['browser_default_width']
$GLOBALS['browser_default_width'] =
800;
* Flag to show or not global counters (members and exercises) on home page
* @global boolean $GLOBALS['home_global_counters']
$GLOBALS['home_global_counters'] =
true;
* Maximum number of public members displayed in home page (most recent ones).
* Value must be >= 0. (0 means recent members are not displayed in home page)
* @global integer $GLOBALS['home_max_member_nb']
$GLOBALS['home_max_member_nb'] =
10;
* Do not display members older than <home_max_member_reg_age> days in home page
* @global integer $GLOBALS['home_max_member_reg_age']
$GLOBALS['home_max_member_reg_age'] =
365;
* Do not display members having less than <home_min_member_exe_nb> online exes
* in home page. Value must be >= 0 and <= 100.
* If value = 0, members with no data are also displayed.
* @global integer $GLOBALS['home_min_member_exe_nb']
$GLOBALS['home_min_member_exe_nb'] =
1;
* Flag to show or not exercises global statistics on home page
* @global boolean $GLOBALS['home_exe_stats_show']
$GLOBALS['home_exe_stats_show'] =
true;
* Maximum number of sports displayed in global statistics on home page
* If = 0, only total will be displed.
* @global integer $GLOBALS['home_exe_stats_max_sport']
$GLOBALS['home_exe_stats_max_sport'] =
4;
* Maximum number of exercises displayed in home page (most recent ones).
* Value must be >= 0. (0 means recent exercices are not displayed in home page)
* @global integer $GLOBALS['home_max_exe_nb']
$GLOBALS['home_max_exe_nb'] =
10;
* Do not display exercises older than <home_max_exe_age> days in home page
* @global integer $GLOBALS['home_max_exe_age']
$GLOBALS['home_max_exe_age'] =
30;
* Do not display exercises having duration < <home_min_exe_duration> minutes
* in home page. Value must be >= 0 and <= 180.
* @global integer $GLOBALS['home_min_exe_duration']
$GLOBALS['home_min_exe_duration'] =
5;
* Number of weeks displayed in calendar. Value must be >= 1.
* @global integer $GLOBALS['calendar_week_nb']
$GLOBALS['calendar_week_nb'] =
6;
* Number of weeks to go forward (>>) / backward (<<) in calendar.
* Value must be >= $GLOBALS['calendar_week_nb'] and <= 52.
* @global integer $GLOBALS['calendar_week_fwd_nb']
$GLOBALS['calendar_week_fwd_nb'] =
12;
* Maximum width in pixels for heart rate bar in calendar (longest duration).
* Value must be >= 32 and <= 256.
* @global integer $GLOBALS['calendar_hr_bar_max_width']
$GLOBALS['calendar_hr_bar_max_width'] =
128;
* Height in pixels for heart rate bars in calendar.
* Value must be >= 4 and <= 32.
* @global integer $GLOBALS['calendar_hr_bar_max_width']
$GLOBALS['calendar_hr_bar_height'] =
12;
* Maximum number of characters for notes in import tables (truncate if larger).
* Value must be >= 20 and <= 100.
* @global integer $GLOBALS['import_max_note_length']
$GLOBALS['import_max_note_length'] =
60;
* Include local settings (database connection, default language, ...)
require_once ('conf/local_config.php');
$GLOBALS['lang'] =
$GLOBALS['def_lang'];
// Check variable values and fix if needed
if ($GLOBALS['fs_block_size'] <
1)
{ $GLOBALS['fs_block_size'] =
1; }
if ($GLOBALS['fs_block_size'] >
65536)
{ $GLOBALS['fs_block_size'] =
65536; }
if ($GLOBALS['session_gc_maxlifetime'] <
180)
{ $GLOBALS['session_gc_maxlifetime'] =
180; }
if ($GLOBALS['session_gc_maxlifetime'] >
86400)
{ $GLOBALS['session_gc_maxlifetime'] =
86400; }
if ($GLOBALS['tmp_files_duration'] <
30)
{ $GLOBALS['tmp_files_duration'] =
30; }
if ($GLOBALS['tmp_files_duration'] >
86400)
{ $GLOBALS['tmp_files_duration'] =
86400; }
if ($GLOBALS['upload_files_duration'] <
120)
{ $GLOBALS['upload_files_duration'] =
120; }
if ($GLOBALS['upload_files_duration'] >
86400)
{ $GLOBALS['upload_files_duration'] =
86400; }
if ($GLOBALS['garbage_collect_proba'] <
1)
{ $GLOBALS['garbage_collect_proba'] =
1; }
if ($GLOBALS['garbage_collect_proba'] >
100)
{ $GLOBALS['garbage_collect_proba'] =
100; }
if ($GLOBALS['browser_default_width'] <
600)
{ $GLOBALS['browser_default_width'] =
600; }
if ($GLOBALS['browser_default_width'] >
2000)
{ $GLOBALS['browser_default_width'] =
2000; }
$GLOBALS['home_global_counters'] =
$GLOBALS['home_global_counters'] ?
true :
false;
if ($GLOBALS['home_max_member_nb'] <
0)
{ $GLOBALS['home_max_member_nb'] =
0; }
if ($GLOBALS['home_max_member_reg_age'] <
1)
{ $GLOBALS['home_max_member_reg_age'] =
1; }
if ($GLOBALS['home_min_member_exe_nb'] <
0)
{ $GLOBALS['home_min_member_exe_nb'] =
0; }
if ($GLOBALS['home_min_member_exe_nb'] >
100)
{ $GLOBALS['home_min_member_exe_nb'] =
100; }
$GLOBALS['home_exe_stats_show'] =
$GLOBALS['home_exe_stats_show'] ?
true :
false;
if ($GLOBALS['home_exe_stats_max_sport'] <
0)
{ $GLOBALS['home_exe_stats_max_sport'] =
0; }
if ($GLOBALS['home_max_exe_nb'] <
0)
{ $GLOBALS['home_max_exe_nb'] =
0; }
if ($GLOBALS['home_max_exe_age'] <
1)
{ $GLOBALS['home_max_exe_age'] =
1; }
if ($GLOBALS['home_min_exe_duration'] <
0)
{ $GLOBALS['home_min_exe_duration'] =
0; }
if ($GLOBALS['home_min_exe_duration'] >
180)
{ $GLOBALS['home_min_exe_duration'] =
180; }
if ($GLOBALS['calendar_week_nb'] <
1)
{ $GLOBALS['calendar_week_nb'] =
1; }
if ($GLOBALS['calendar_week_fwd_nb'] <
$GLOBALS['calendar_week_nb'])
{ $GLOBALS['calendar_week_fwd_nb'] =
$GLOBALS['calendar_week_nb']; }
if ($GLOBALS['calendar_week_fwd_nb'] >
52)
{ $GLOBALS['calendar_week_fwd_nb'] =
52; }
if ($GLOBALS['calendar_hr_bar_max_width'] <
32)
{ $GLOBALS['calendar_hr_bar_max_width'] =
32; }
if ($GLOBALS['calendar_hr_bar_max_width'] >
256)
{ $GLOBALS['calendar_hr_bar_max_width'] =
256; }
if ($GLOBALS['calendar_hr_bar_height'] <
4)
{ $GLOBALS['calendar_hr_bar_height'] =
4; }
if ($GLOBALS['calendar_hr_bar_height'] >
32)
{ $GLOBALS['calendar_hr_bar_height'] =
32; }
if ($GLOBALS['import_max_note_length'] <
20)
{ $GLOBALS['import_max_note_length'] =
20; }
if ($GLOBALS['import_max_note_length'] >
100)
{ $GLOBALS['import_max_note_length'] =
100; }
Documentation generated on Sat, 28 Mar 2009 23:15:17 +0000 by phpDocumentor 1.4.1