Source for file config.php

Documentation is available at config.php

  1. <?php
  2. /**
  3.  * General configuration (constants and variables)
  4.  *
  5.  * DO NOT MODIFY THIS FILE, USE 'local_config.php' TO TUNE PREFERENCES.
  6.  *
  7.  * @author      Jean-Philippe Brunon <jp75018@free.fr>
  8.  * @copyright   2007-2009 Jean-Philippe Brunon
  9.  * @license     http://www.opensource.org/licenses/gpl-license.php GPL
  10.  * @package     php-endurance
  11.  * @version    $Id: config.php 68 2009-03-28 22:57:30Z jp75018 $
  12.  */
  13.  
  14. /*
  15.  * 1. Constants : Should not be modified !
  16.  */
  17.  
  18. /**
  19.  * Package name (as displayed)
  20.  */
  21. define('PACKAGE_NAME''PHP-Endurance');
  22. /**
  23.  * Package version
  24.  */
  25. define('PACKAGE_VERSION''1.0.4');
  26. /**
  27.  * Package full name (name version)
  28.  */
  29. define('PACKAGE_FULLNAME'PACKAGE_NAME ' v'PACKAGE_VERSION);
  30. if (file_exists('conf/svn_release.php'))
  31. {
  32.   require_once ('conf/svn_release.php');
  33. /**
  34.  * Package full name + SVN release (name version SVN-release)
  35.  */
  36.   define('PACKAGE_FULLNAME_SVN',
  37.     PACKAGE_FULLNAME ' (SVN release : ' SVN_VERSION ')');
  38. }
  39. else
  40. define('PACKAGE_FULLNAME_SVN'PACKAGE_FULLNAME)}
  41. /**
  42.  * Official web site
  43.  */
  44. define('OFFICIAL_WEB''www.php-endurance.org');
  45.  
  46. /**
  47.  * One calory in Joules, to compute energy in cal or Kcal
  48.  */
  49. define('CALORY_2_JOULE'4.184);
  50. /**
  51.  * Constant to convert VO2max (general) <--> MAS (running specific)
  52.  */
  53. define('VO2MAX_VMA_RATIO'3.50);
  54. /**
  55.  * Default rest heart rate if not in user files / database
  56.  */
  57. define('DEF_REST_HR'60);
  58. /**
  59.  * Default maximum heart rate if not in user files / database
  60.  */
  61. define('DEF_MAX_HR'180);
  62. /**
  63.  * Maximum stride length (cm), in case of too high value
  64.  */
  65. define('STRIDE_MAX'400);
  66. /**
  67.  * Minimum difference of altitude (meters), to detect ascend
  68.  */
  69. define('MIN_DELTA_ALTITUDE'4);
  70. /**
  71.  * Gravitational constant (m/s-2), to compute optential energy
  72.  */
  73. define('GRAVI_CST'9.810);
  74. /**
  75.  * Constant to compute body energy (energy consumed at resting HR, all sports)
  76.  */
  77. define('PHYSIO_CST_REST'0.850);
  78. /**
  79.  * Constant to compute physiological energy = F(HR) in Kcal (all sports)
  80.  */
  81. define('PHYSIO_CST_POWER'0.0000992);
  82. /**
  83.  * Average efficiency (fraction of physilogical energy transformed in
  84.  * mechanical energy, sport-specific)
  85.  * @todo    Tune in [0-1], use scientific studies
  86.  */
  87. define('AVG_RUNNING_EFFICIENCY'0.25);
  88. define('AVG_CYCLING_EFFICIENCY'0.75);
  89. /**
  90.  * Constant to compute move energy in cal / meter, sport specific
  91.  */
  92. define('MOVE_CST_ENERGY'0.94810);
  93. /**
  94.  * Constant (c/speed) to compute ground friction in cal / meter, sport specific
  95.  */
  96. define('GROUND_CST_ENERGY'0.18483);
  97. /**
  98.  * Constant (c * speed^2) to compute air friction in cal / meter, sport specific
  99.  */
  100. define('AIR_CST_ENERGY'0.00205);
  101. /**
  102.  * Fraction of potential energy which is reused while descending, sport specific
  103.  */
  104. define('POT_DOWN_USED_CST_ENERGY'0.67);
  105.  
  106. /**
  107.  * Width and heigth of small icons in pixels
  108.  */
  109. define('ICON_SMALL_SIZE'16);
  110. /**
  111.  * Width and heigth of medium icons in pixels
  112.  */
  113. define('ICON_MEDIUM_SIZE'22);
  114. /**
  115.  * Width and heigth of large icons in pixels
  116.  */
  117. define('ICON_LARGE_SIZE'32);
  118.  
  119.  
  120. /*
  121.  * 2. Variables : Can be modidied in local_config.php
  122.  */
  123.  
  124. /**
  125.  * Sender of email for user registration / change password.
  126.  * You should set it to a value accepted by your ISP.
  127.  * If not set, default is : 'no-reply@<package-name>.org'
  128.  * @global string $GLOBALS['noreply_from'] 
  129.  */
  130. $GLOBALS['noreply_from'sprintf("no-reply@%s.org"strtolower(PACKAGE_NAME));
  131. /**
  132.  * Webmaster email used as contact in HTML footer
  133.  * If empty string (default) : No contact displayed in footer
  134.  * @global string $GLOBALS['webmaster_email'] 
  135.  */
  136. $GLOBALS['webmaster_email''';
  137. /**
  138.  * Site name used in emails and page titles
  139.  * If not set, default is : '<package-name>'
  140.  * @global string $GLOBALS['site_name'] 
  141.  */
  142. $GLOBALS['site_name'PACKAGE_NAME;
  143. /**
  144.  * Site base url used in emails
  145.  * If not set, default is : 'http://<http_host>dirname(<request_uri>)'
  146.  * @global string $GLOBALS['site_url'] 
  147.  */
  148. $GLOBALS['site_url''http://' $_SERVER['HTTP_HOST'];
  149. if (($uri_dir_name dirname($_SERVER['REQUEST_URI'])) != '/')
  150. $GLOBALS['site_url'.= $uri_dir_name}
  151.  
  152. /**
  153.  * File system block size (used to measure data files disk space)
  154.  * Value must be >= 1 and <= 65536.
  155.  * Set to 512 on a windows system ?
  156.  * @global integer $GLOBALS['fs_block_size'] 
  157.  */
  158. $GLOBALS['fs_block_size'4096;
  159. /**
  160.  * PHP session timeout in seconds
  161.  * Value must be >= 180 and <= 86400.
  162.  * @global integer $GLOBALS['session_gc_maxlifetime'] 
  163.  */
  164. $GLOBALS['session_gc_maxlifetime'3600;
  165. /**
  166.  * Temporary directory to store generated files (graphics). Must end with '/'.
  167.  * APACHE USER MUST HAVE READ / WRITE / EXECUTE ACCESS ON THIS DIRECTORY.
  168.  * IT MUST BE A PATH RELATIVE TO SERVER ROOT.
  169.  * @global string $GLOBALS['tmp_dir'] 
  170.  */
  171. $GLOBALS['tmp_dir''tmp/';
  172. /**
  173.  * Cleanup files in $GLOBALS['tmp_dir'] which are older than
  174.  * $GLOBALS['tmp_files_duration'] seconds.
  175.  * Value must be >= 30 and <= 86400.
  176.  * @global integer $GLOBALS['tmp_files_duration'] 
  177.  */
  178. $GLOBALS['tmp_files_duration'180;
  179. /**
  180.  * Upload directory to store files uploaded by users before they are moved
  181.  * to data directory. Must end with '/'.
  182.  * APACHE USER MUST HAVE READ / WRITE / EXECUTE ACCESS ON THIS DIRECTORY.
  183.  * It can be either a path relative to server root or an absolute path.
  184.  * @global string $GLOBALS['upload_dir'] 
  185.  */
  186. $GLOBALS['upload_dir''upload/';
  187. /**
  188.  * Cleanup files in $GLOBALS['upload_dir'] which are older than
  189.  * $GLOBALS['upload_files_duration'] seconds.
  190.  * Value must be >= 120 and <= 86400.
  191.  * @global integer $GLOBALS['upload_files_duration'] 
  192.  */
  193. $GLOBALS['upload_files_duration'3600;
  194. /**
  195.  * Data directory to store users data files. Must end with '/'.
  196.  * APACHE USER MUST HAVE READ / WRITE / EXECUTE ACCESS ON THIS DIRECTORY.
  197.  * It can be either a path relative to server root or an absolute path.
  198.  * @global string $GLOBALS['data_dir'] 
  199.  */
  200. $GLOBALS['data_dir''data/';
  201. /**
  202.  * Garbage collector probility (percent) to del files from tmp and upload dirs.
  203.  * Value must be >= 1 and <= 100.
  204.  * @global integer $GLOBALS['garbage_collect_proba'] 
  205.  */
  206. $GLOBALS['garbage_collect_proba'1;
  207.  
  208. /**
  209.  * Available languages for display, comma separated list.
  210.  * Languages will be listed in this order in language select.
  211.  * @global string $GLOBALS['all_lang'] 
  212.  */ 
  213. $GLOBALS['all_lang''en,fr,ru';
  214. /**
  215.  * Default language for display (stored in $_SESSIONS['lang'])
  216.  * @global string $GLOBALS['def_lang'] 
  217.  */ 
  218. $GLOBALS['def_lang''en';
  219. /**
  220.  * CSS file used by default for HTML pages, must be located in 'css' directory.
  221.  * @global string $GLOBALS['general_css_file'] 
  222.  */ 
  223. $GLOBALS['css_default_file''phpendurance.css';
  224. /**
  225.  * Default browser width (if cannot be obtained through 'browser_width' cookie)
  226.  * Value must be >= 600 and <= 2000.
  227.  * @global integer $GLOBALS['browser_default_width'] 
  228.  */ 
  229. $GLOBALS['browser_default_width'800;
  230.  
  231. /**
  232.  * Flag to show or not global counters (members and exercises) on home page
  233.  * @global boolean $GLOBALS['home_global_counters'] 
  234.  */ 
  235. $GLOBALS['home_global_counters'true;
  236. /**
  237.  * Maximum number of public members displayed in home page (most recent ones).
  238.  * Value must be >= 0. (0 means recent members are not displayed in home page)
  239.  * @global integer $GLOBALS['home_max_member_nb'] 
  240.  */ 
  241. $GLOBALS['home_max_member_nb'10;
  242. /**
  243.  * Do not display members older than <home_max_member_reg_age> days in home page
  244.  * Value must be >= 1.
  245.  * @global integer $GLOBALS['home_max_member_reg_age'] 
  246.  */ 
  247. $GLOBALS['home_max_member_reg_age'365;
  248. /**
  249.  * Do not display members having less than <home_min_member_exe_nb> online exes
  250.  * in home page. Value must be >= 0 and <= 100.
  251.  * If value = 0, members with no data are also displayed.
  252.  * @global integer $GLOBALS['home_min_member_exe_nb'] 
  253.  */ 
  254. $GLOBALS['home_min_member_exe_nb'1;
  255. /**
  256.  * Flag to show or not exercises global statistics on home page
  257.  * @global boolean $GLOBALS['home_exe_stats_show'] 
  258.  */ 
  259. $GLOBALS['home_exe_stats_show'true;
  260. /**
  261.  * Maximum number of sports displayed in global statistics on home page
  262.  * If = 0, only total will be displed.
  263.  * Value must be >= 0.
  264.  * @global integer $GLOBALS['home_exe_stats_max_sport'] 
  265.  */ 
  266. $GLOBALS['home_exe_stats_max_sport'4;
  267. /**
  268.  * Maximum number of exercises displayed in home page (most recent ones).
  269.  * Value must be >= 0. (0 means recent exercices are not displayed in home page)
  270.  * @global integer $GLOBALS['home_max_exe_nb'] 
  271.  */ 
  272. $GLOBALS['home_max_exe_nb'10;
  273. /**
  274.  * Do not display exercises older than <home_max_exe_age> days in home page
  275.  * Value must be >= 1.
  276.  * @global integer $GLOBALS['home_max_exe_age'] 
  277.  */ 
  278. $GLOBALS['home_max_exe_age'30;
  279. /**
  280.  * Do not display exercises having duration < <home_min_exe_duration> minutes
  281.  * in home page. Value must be >= 0 and <= 180.
  282.  * @global integer $GLOBALS['home_min_exe_duration'] 
  283.  */ 
  284. $GLOBALS['home_min_exe_duration'5;
  285.  
  286. /**
  287.  * Number of weeks displayed in calendar. Value must be >= 1.
  288.  * @global integer $GLOBALS['calendar_week_nb'] 
  289.  */
  290. $GLOBALS['calendar_week_nb'6;
  291. /**
  292.  * Number of weeks to go forward (>>) / backward (<<) in calendar.
  293.  * Value must be >= $GLOBALS['calendar_week_nb'] and <= 52.
  294.  * @global integer $GLOBALS['calendar_week_fwd_nb'] 
  295.  */
  296. $GLOBALS['calendar_week_fwd_nb'12;
  297. /**
  298.  * Maximum width in pixels for heart rate bar in calendar (longest duration).
  299.  * Value must be >= 32 and <= 256.
  300.  * @global integer $GLOBALS['calendar_hr_bar_max_width'] 
  301.  */
  302. $GLOBALS['calendar_hr_bar_max_width'128;
  303. /**
  304.  * Height in pixels for heart rate bars in calendar.
  305.  * Value must be >= 4 and <= 32.
  306.  * @global integer $GLOBALS['calendar_hr_bar_max_width'] 
  307.  */
  308. $GLOBALS['calendar_hr_bar_height'12;
  309.  
  310. /**
  311.  * Maximum number of characters for notes in import tables (truncate if larger).
  312.  * Value must be >= 20 and <= 100.
  313.  * @global integer $GLOBALS['import_max_note_length'] 
  314.  */
  315. $GLOBALS['import_max_note_length'60;
  316.  
  317. /**
  318.  * Include local settings (database connection, default language, ...)
  319.  */
  320. require_once ('conf/local_config.php');
  321. $GLOBALS['lang'$GLOBALS['def_lang'];
  322.  
  323. // Check variable values and fix if needed
  324.  
  325. if ($GLOBALS['fs_block_size'1)
  326. $GLOBALS['fs_block_size'1}
  327. if ($GLOBALS['fs_block_size'65536)
  328. $GLOBALS['fs_block_size'65536}
  329. if ($GLOBALS['session_gc_maxlifetime'180)
  330. $GLOBALS['session_gc_maxlifetime'180}
  331. if ($GLOBALS['session_gc_maxlifetime'86400)
  332. $GLOBALS['session_gc_maxlifetime'86400}
  333. if ($GLOBALS['tmp_files_duration'30)
  334. $GLOBALS['tmp_files_duration'30}
  335. if ($GLOBALS['tmp_files_duration'86400)
  336. $GLOBALS['tmp_files_duration'86400}
  337. if ($GLOBALS['upload_files_duration'120)
  338. $GLOBALS['upload_files_duration'120}
  339. if ($GLOBALS['upload_files_duration'86400)
  340. $GLOBALS['upload_files_duration'86400}
  341. if ($GLOBALS['garbage_collect_proba'1)
  342. $GLOBALS['garbage_collect_proba'1}
  343. if ($GLOBALS['garbage_collect_proba'100)
  344. $GLOBALS['garbage_collect_proba'100}
  345.  
  346. if ($GLOBALS['browser_default_width'600)
  347. $GLOBALS['browser_default_width'600}
  348. if ($GLOBALS['browser_default_width'2000)
  349. $GLOBALS['browser_default_width'2000}
  350.  
  351. $GLOBALS['home_global_counters'=
  352.   $GLOBALS['home_global_counters'true false;
  353. if ($GLOBALS['home_max_member_nb'0)
  354. $GLOBALS['home_max_member_nb'0}
  355. if ($GLOBALS['home_max_member_reg_age'1)
  356. $GLOBALS['home_max_member_reg_age'1}
  357. if ($GLOBALS['home_min_member_exe_nb'0)
  358. $GLOBALS['home_min_member_exe_nb'0}
  359. if ($GLOBALS['home_min_member_exe_nb'100)
  360. $GLOBALS['home_min_member_exe_nb'100}
  361. $GLOBALS['home_exe_stats_show'=
  362.   $GLOBALS['home_exe_stats_show'true false;
  363. if ($GLOBALS['home_exe_stats_max_sport'0)
  364. $GLOBALS['home_exe_stats_max_sport'0}
  365. if ($GLOBALS['home_max_exe_nb'0)
  366. $GLOBALS['home_max_exe_nb'0}
  367. if ($GLOBALS['home_max_exe_age'1)
  368. $GLOBALS['home_max_exe_age'1}
  369. if ($GLOBALS['home_min_exe_duration'0)
  370. $GLOBALS['home_min_exe_duration'0}
  371. if ($GLOBALS['home_min_exe_duration'180)
  372. $GLOBALS['home_min_exe_duration'180}
  373.  
  374. if ($GLOBALS['calendar_week_nb'1)
  375. $GLOBALS['calendar_week_nb'1}
  376. if ($GLOBALS['calendar_week_fwd_nb'$GLOBALS['calendar_week_nb'])
  377. $GLOBALS['calendar_week_fwd_nb'$GLOBALS['calendar_week_nb']}
  378. if ($GLOBALS['calendar_week_fwd_nb'52)
  379. $GLOBALS['calendar_week_fwd_nb'52}
  380. if ($GLOBALS['calendar_hr_bar_max_width'32)
  381. $GLOBALS['calendar_hr_bar_max_width'32}
  382. if ($GLOBALS['calendar_hr_bar_max_width'256)
  383. $GLOBALS['calendar_hr_bar_max_width'256}
  384. if ($GLOBALS['calendar_hr_bar_height'4)
  385. $GLOBALS['calendar_hr_bar_height'4}
  386. if ($GLOBALS['calendar_hr_bar_height'32)
  387. $GLOBALS['calendar_hr_bar_height'32}
  388.  
  389. if ($GLOBALS['import_max_note_length'20)
  390. $GLOBALS['import_max_note_length'20}
  391. if ($GLOBALS['import_max_note_length'100)
  392. $GLOBALS['import_max_note_length'100}
  393. ?>

Documentation generated on Sat, 28 Mar 2009 23:15:17 +0000 by phpDocumentor 1.4.1