PageRenderTime 76ms CodeModel.GetById 72ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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