Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

iniset.php 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. +-----------------------------------------------------------------------+
  4. | program/include/iniset.php |
  5. | |
  6. | This file is part of the Roundcube Webmail client |
  7. | Copyright (C) 2008-2016, The Roundcube Dev Team |
  8. | |
  9. | Licensed under the GNU General Public License version 3 or |
  10. | any later version with exceptions for skins & plugins. |
  11. | See the README file for a full license statement. |
  12. | |
  13. | PURPOSE: |
  14. | Setup the application environment required to process |
  15. | any request. |
  16. +-----------------------------------------------------------------------+
  17. | Author: Till Klampaeckel <till@php.net> |
  18. | Thomas Bruederli <roundcube@gmail.com> |
  19. +-----------------------------------------------------------------------+
  20. */
  21. // application constants
  22. define('RCMAIL_VERSION', '1.2.2');
  23. define('RCMAIL_START', microtime(true));
  24. if (!defined('INSTALL_PATH')) {
  25. define('INSTALL_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/');
  26. }
  27. if (!defined('RCMAIL_CONFIG_DIR')) {
  28. define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config');
  29. }
  30. if (!defined('RCUBE_LOCALIZATION_DIR')) {
  31. define('RCUBE_LOCALIZATION_DIR', INSTALL_PATH . 'program/localization/');
  32. }
  33. define('RCUBE_INSTALL_PATH', INSTALL_PATH);
  34. define('RCUBE_CONFIG_DIR', RCMAIL_CONFIG_DIR.'/');
  35. // RC include folders MUST be included FIRST to avoid other
  36. // possible not compatible libraries (i.e PEAR) to be included
  37. // instead the ones provided by RC
  38. $include_path = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR;
  39. $include_path.= ini_get('include_path');
  40. if (set_include_path($include_path) === false) {
  41. die("Fatal error: ini_set/set_include_path does not work.");
  42. }
  43. // increase maximum execution time for php scripts
  44. // (does not work in safe mode)
  45. @set_time_limit(120);
  46. // include composer autoloader (if available)
  47. if (@file_exists(INSTALL_PATH . 'vendor/autoload.php')) {
  48. require INSTALL_PATH . 'vendor/autoload.php';
  49. }
  50. // include Roundcube Framework
  51. require_once 'Roundcube/bootstrap.php';
  52. // register autoloader for rcmail app classes
  53. spl_autoload_register('rcmail_autoload');
  54. // backward compatybility (to be removed in version 1.2.0)
  55. require_once INSTALL_PATH . 'program/include/bc.php';
  56. /**
  57. * PHP5 autoloader routine for dynamic class loading
  58. */
  59. function rcmail_autoload($classname)
  60. {
  61. if (strpos($classname, 'rcmail') === 0) {
  62. $filepath = INSTALL_PATH . "program/include/$classname.php";
  63. if (is_readable($filepath)) {
  64. include_once $filepath;
  65. return true;
  66. }
  67. }
  68. return false;
  69. }