Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

iniset.php 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. +-----------------------------------------------------------------------+
  4. | program/include/iniset.php |
  5. | |
  6. | This file is part of the Roundcube Webmail client |
  7. | Copyright (C) 2008-2017, 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.3.6');
  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. /**
  55. * PHP5 autoloader routine for dynamic class loading
  56. */
  57. function rcmail_autoload($classname)
  58. {
  59. if (strpos($classname, 'rcmail') === 0) {
  60. $filepath = INSTALL_PATH . "program/include/$classname.php";
  61. if (is_readable($filepath)) {
  62. include_once $filepath;
  63. return true;
  64. }
  65. }
  66. return false;
  67. }