PageRenderTime 47ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 1ms

/default-configuration.php

https://bitbucket.org/hgj/tickethammer
PHP | 137 lines | 25 code | 27 blank | 85 comment | 5 complexity | 00c4787cb02777cbf7d924333b3fe3cc MD5 | raw file
  1. <?php
  2. //
  3. // Sodium 2.0.6-alpha
  4. //
  5. // This file is part of the Sodium PHP framework, released under the
  6. // Creative Commons Attribution-NonCommercial-ShareAlike licence.
  7. //
  8. // The framework is created and maintaned by Gergely J. Horv??th.
  9. // More information should be available at http://hgj.hu
  10. //
  11. // Copyright 2013 by Gergely J. Horv??th.
  12. //
  13. /**
  14. * Sodium / configuration.php
  15. *
  16. * Sodium related settings and general PHP configuration.
  17. *
  18. * Every aspect of the Sodium framework is configured in this file. Also,
  19. * PHP configuration should be done here too, prior to the former.
  20. *
  21. * NOTE: Not renaming 'default-configuration.php' to 'configuration.php'
  22. * is not considered to be a mistake. Although, please keep in mind,
  23. * that the former will be overwritten whenever you update the framework!
  24. */
  25. //
  26. // PHP and other basic settings
  27. //
  28. // Custom PHP log
  29. ini_set('error_log', 'logs/php.log');
  30. // Error reporting and its level
  31. error_reporting(E_ALL | E_STRICT);
  32. ini_set('display_errors', false);
  33. ini_set('html_errors', false);
  34. ini_set('magic_quotes_qpc', false);
  35. // Domain name
  36. if (isset($_SERVER['HTTP_HOST'])) {
  37. define('DOMAIN', $_SERVER['HTTP_HOST']);
  38. } else if (isset($_SERVER['SERVER_NAME'])) {
  39. define('DOMAIN', $_SERVER['SERVER_NAME']);
  40. } else {
  41. define('DOMAIN', 'example.com');
  42. }
  43. // Base path for all PHP files
  44. // NOTE: You do not have to change this even if you moved index.php!
  45. define('BASE_PATH', realpath(__DIR__));
  46. // Base URL for public content
  47. // If you put your site/application in a subdirectory,
  48. // you should specify the base URL here.
  49. // Example: http://example.com/myapp/index.php --> '/myapp'
  50. // NOTE: Do not end the URL with a slash!
  51. define('BASE_URL', '');
  52. // Class autoloading
  53. // NOTE: There is a reason the function is called here.
  54. require_once(BASE_PATH . '/autoload.php');
  55. // Timezone
  56. // NOTE: A PHP warning is generated prior to PHP 5.4.0, if PHP has to guess
  57. // the timezone by itself.
  58. ini_set('date.timezone', 'Europe/Budapest');
  59. //
  60. // Cron boundary
  61. // The code below is only executed in normal run, cron job will exit here.
  62. //
  63. if (defined('CRON')) {
  64. // You can put cron related configuration here
  65. ini_set('error_log', 'logs/cron.log');
  66. return;
  67. }
  68. // Session cookie settings
  69. session_set_cookie_params(0, '/', '.' . DOMAIN);
  70. // Disable compression
  71. // Sodium::setCompression(false);
  72. // Default query
  73. // NOTE: Defaults to 'index' if not set
  74. //Sodium::setDefaultQuery('custom/stuff.html');
  75. // Default Controller
  76. // NOTE: Sodium will still use the 'pages' controller - even if you use the
  77. // method above. You can disable this behaviour by setting the second argument
  78. // to false.
  79. //Sodium::setDefaultController('some-search-controller');
  80. // Routing
  81. // You can add custom URL -> Controller filters here
  82. //Sodium::addCustomRouting('the/url', 'controller-name');
  83. // Custom page extensions
  84. // These extensions will be removed from the query.
  85. //Sodium::addRemovableExtension('.page');
  86. //Sodium::addRemovableExtension(array('.p', '.pa', '.pag', '.page'));
  87. // Redirection
  88. // You can add redirection rules here. You can use perl compatible regular
  89. // expressions with addRedirectPCRE().
  90. /*
  91. Sodium::addRedirect('redirect-from.html', 'http://example.com', 304);
  92. Sodium::addRedirect('redirect-from.html', 'http://example.com');
  93. Sodium::addRedirect('from.html', '/to.html');
  94. Sodium::addRedirect(
  95. array(
  96. 'bad-location',
  97. 'false-address.html',
  98. 'mistiped.hmlt',
  99. ),
  100. '/good-location.html'
  101. );
  102. */
  103. // Headers to be sent
  104. Sodium\View::setHeader('Content-type', 'text/html; charset=utf-8');
  105. //
  106. // MODULE SPECIFIC CONFIGURATION
  107. //
  108. // Default mail headers
  109. Sodium\Mailer::addDefaultHeader('From', 'no-reply@' . DOMAIN);
  110. Sodium\Mailer::addDefaultHeader('Content-type', 'text/plain; charset=utf-8');