/installer_bak/config/constants.php

https://github.com/ekoisa/pyrocms · PHP · 105 lines · 34 code · 16 blank · 55 comment · 7 complexity · 9811b8afd5785aaf20dffcb46941795c MD5 · raw file

  1. <?php defined('BASEPATH') OR exit('No direct script access allowed');
  2. /*
  3. |--------------------------------------------------------------------------
  4. | File and Directory Modes
  5. |--------------------------------------------------------------------------
  6. |
  7. | These prefs are used when checking and setting modes when working
  8. | with the file system. The defaults are fine on servers with proper
  9. | security, but you may wish (or even need) to change the values in
  10. | certain environments (Apache running a separate process for each
  11. | user, PHP under CGI with Apache suEXEC, etc.). Octal values should
  12. | always be used to set the mode correctly.
  13. |
  14. */
  15. define('FILE_READ_MODE', 0644);
  16. define('FILE_WRITE_MODE', 0666);
  17. define('DIR_READ_MODE', 0755);
  18. define('DIR_WRITE_MODE', 0777);
  19. /*
  20. |--------------------------------------------------------------------------
  21. | File Stream Modes
  22. |--------------------------------------------------------------------------
  23. |
  24. | These modes are used when working with fopen()/popen()
  25. |
  26. */
  27. define('FOPEN_READ', 'rb');
  28. define('FOPEN_READ_WRITE', 'r+b');
  29. define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
  30. define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
  31. define('FOPEN_WRITE_CREATE', 'ab');
  32. define('FOPEN_READ_WRITE_CREATE', 'a+b');
  33. define('FOPEN_WRITE_CREATE_STRICT', 'xb');
  34. define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
  35. /*
  36. |--------------------------------------------------------------------------
  37. | Environment
  38. |--------------------------------------------------------------------------
  39. */
  40. # Deprecated: This feature was rolled into CodeIgniter so we don't need to handle it ourselves anymore.
  41. define('ENV', ENVIRONMENT);
  42. /*
  43. |--------------------------------------------------------------------------
  44. | Docment root folders
  45. |--------------------------------------------------------------------------
  46. |
  47. | These constants use existing location information to work out web root, etc.
  48. |
  49. */
  50. // Base URL (keeps this crazy sh*t out of the config.php
  51. if(isset($_SERVER['HTTP_HOST']))
  52. {
  53. $base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 'https' : 'http';
  54. $base_url .= '://'. $_SERVER['HTTP_HOST'];
  55. $base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
  56. // Base URI (It's different to base URL!)
  57. $base_uri = parse_url($base_url, PHP_URL_PATH);
  58. if (substr($base_uri, 0, 1) != '/') $base_uri = '/'.$base_uri;
  59. if (substr($base_uri, -1, 1) != '/') $base_uri .= '/';
  60. }
  61. else
  62. {
  63. $base_url = 'http://localhost/';
  64. $base_uri = '/';
  65. }
  66. // Define these values to be used later on
  67. define('BASE_URL', $base_url);
  68. define('BASE_URI', $base_uri);
  69. define('APPPATH_URI', BASE_URI.APPPATH);
  70. // We dont need these variables any more
  71. unset($base_uri, $base_url);
  72. /*
  73. |--------------------------------------------------------------------------
  74. | PyroCMS Version
  75. |--------------------------------------------------------------------------
  76. |
  77. | Which version of PyroCMS is currently running?
  78. |
  79. */
  80. define('CMS_VERSION', '2.2.5');
  81. /*
  82. |--------------------------------------------------------------------------
  83. | CDN Offer URL
  84. |--------------------------------------------------------------------------
  85. |
  86. | We have a link in the settings page to MaxCDN and our landing page
  87. |
  88. */
  89. define('CDN_OFFER_URL', '');