diff options
author | Barak Korren <[email protected]> | 2013-04-01 18:40:46 +0300 |
---|---|---|
committer | Barak Korren <[email protected]> | 2013-04-01 18:40:46 +0300 |
commit | e470a273cf09562fb2f9c0c899002303f19c8d16 (patch) | |
tree | 3cbfc4ce61ed5b77b3eb2f3d3d1b7c3e9ac9a9ee /include/functions.php | |
parent | 3f44977129ef0ab3c6233dc94d8c46ca2fa039f0 (diff) | |
parent | 046ec657602ea46e7b32d3f3e387104d89ac6d8a (diff) |
Merge branch 'master' into tunable-fetches
Diffstat (limited to 'include/functions.php')
-rw-r--r-- | include/functions.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/functions.php b/include/functions.php index e2a2282d5..039048095 100644 --- a/include/functions.php +++ b/include/functions.php @@ -30,6 +30,27 @@ require_once 'config.php'; + /** + * Define a constant if not already defined + * + * @param string $name The constant name. + * @param mixed $value The constant value. + * @access public + * @return boolean True if defined successfully or not. + */ + function define_default($name, $value) { + // Note: performence freaks should define everything in + // tunables.php in config.php becasue if will make defined() + // run much faster, see 'tris+php at tfconsulting dot com dot + // au' comment here: + // http://www.php.net/manual/en/function.defined.php#89886 + defined($name) or define($name, $value); + } + + // Require tunables.php to define tunable constants (That may have + // already been denied in config.php) + require_once 'tunables.php'; + if (DB_TYPE == "pgsql") { define('SUBSTRING_FOR_DATE', 'SUBSTRING_FOR_DATE'); } else { |