Source for file config.inc.php

Documentation is available at config.inc.php

  1. <?php
  2. // =============================================================================
  3. //    Copyright 2008, 2009 Richard Gladman
  4. //        Distributed under the terms of the GNU General Public License
  5. // =============================================================================
  6. //    This file is part of Benchpress.
  7. //    Benchpress is free software: you can redistribute it and/or modify
  8. //  it under the terms of the GNU General Public License as published by
  9. //  the Free Software Foundation, either version 3 of the License, or
  10. //  (at your option) any later version.
  11. //
  12. //  Benchpress is distributed in the hope that it will be useful,
  13. //  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. //  GNU General Public License for more details.
  16. //
  17. //  You should have received a copy of the GNU General Public License
  18. //  along with Benchpress.  If not, see <http://www.gnu.org/licenses/>.
  19. // =============================================================================
  20.  
  21. //  ============================================================================
  22. //      C H A N G E   T H E S E   S E T T I N G S   A S   N E E D E D
  23. //  ============================================================================
  24. define('FILE_BASE''full path to site on disk');
  25. define('URL_BASE''URL TO ROOT OF SITE');
  26.  
  27. define('HOST''database server');
  28. define('USER''database user name');
  29. define('PASSWORD''users password');
  30. define('DATABASE''Database to use');
  31.  
  32. define('EXCEPTION_LOG_TO_FILE'true);
  33. define('EXCEPTION_ADMIN_EMAIL'false);
  34.  
  35. define('SITE_TITLE''Framework');
  36. define('SITE_STRAPLINE''Brief description in here');
  37.  
  38.  
  39. //  ============================================================================
  40. //      D O   N O T   C H A N G E   T H E S E   S E T T I N G S
  41. //            Unless you really know what you are doing.
  42. //  ============================================================================
  43. define('LIB'FILE_BASE '/lib');
  44. define('APP'FILE_BASE '/application');
  45.  
  46. define('LIB_CORE'LIB '/core');
  47. define('LIB_DATABASE'LIB '/database');
  48. define('LIB_FORMS'LIB '/forms');
  49. define('LIB_VALIDATION'LIB '/validation');
  50. define('LIB_UTILITIES'LIB '/utilities');
  51. define('LIB_TEMPLATES'LIB '/templates');
  52.  
  53. define('LIB_EXCEPTIONS'LIB '/exceptions');
  54. define('FILE_ERROR_LOG'FILE_BASE '/errors/error.log');
  55.  
  56. define('APP_MODELS'APP '/models');
  57. define('APP_CONTROLLERS'APP '/controllers');
  58. define('APP_VIEWS'APP '/views');
  59. define('APP_FORMS'APP '/forms');
  60. define('APP_VALIDATION'APP '/validation');
  61.  
  62. define('INCLUDES'FILE_BASE '/includes');
  63. define('TEMPLATES'FILE_BASE '/templates');
  64.  
  65. //  ============================================================================
  66. //      Autoload of classes as used
  67. //  ============================================================================
  68. function __autoload($strClass{
  69.     
  70.     //  Look in the current directory and then in each of the lib sub directories for the class
  71.     $strClass strtolower($strClass);
  72.     $arrLib array('.'APP_FORMSAPP_VALIDATIONAPP_UTILITIESAPP_MODELSAPP_CONTROLLERSAPP_VIEWS,
  73.                             LIB_CORELIB_DATABASELIB_FORMS,  LIB_VALIDATIONLIB_UTILITIESLIB_CONTENTLIB_TEMPLATESLIB_EXCEPTIONS);
  74.     
  75.     foreach ($arrLib as $strLib{
  76.         $strFilename "{$strLib}/class.{$strClass}.php";
  77.         if (file_exists($strFilename)) {
  78.             require_once($strFilename);
  79.             break;
  80.         }
  81.     }
  82. }
  83.  
  84. //  ============================================================================
  85. //      Turn errors / warnings / notices into exceptions
  86. //      Honour error reporting settings
  87. //  ============================================================================
  88. function exceptions_error_handler($intSeverity$strMessage$strFilename$intLine{
  89.   if (error_reporting(== 0{
  90.     return;
  91.   }
  92.   if (error_reporting($intSeverity{
  93.     throw new ErrorException($strMessage0$intSeverity$strFilename$intLine);
  94.   }
  95. }
  96. set_error_handler('exceptions_error_handler')
  97.  
  98. ?>

Documentation generated on Sun, 13 Dec 2009 19:39:42 +0000 by phpDocumentor 1.4.3