common.conf.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. /*
  3. * Common configuration that can be used throughout the application
  4. * Please refer to DooConfig class in the API doc for a complete list of configurations
  5. * Access via Singleton, eg. Doo::conf()->BASE_PATH;
  6. */
  7. error_reporting(E_ALL | E_STRICT);
  8. date_default_timezone_set('Asia/Shanghai');
  9. /**
  10. * for benchmark purpose, call Doo::benchmark() for time used.
  11. */
  12. $config['START_TIME'] = microtime(true);
  13. //For framework use. Must be defined. Use full absolute paths and end them with '/' eg. /var/www/project/
  14. $config['SITE_PATH'] = realpath('..') . '/jlzf2/';
  15. //$config['PROTECTED_FOLDER'] = 'protected/';
  16. $config['BASE_PATH'] = realpath('..') . '/dooframework/';
  17. // for Project Name
  18. //$config['PRO_NAME'] = '纵横演示版';
  19. //for production mode use 'prod'
  20. $config['APP_MODE'] = 'dev';
  21. //----------------- optional, if not defined, default settings are optimized for production mode ----------------
  22. //if your root directory is /var/www/ and you place this in a subfolder eg. 'app', define SUBFOLDER = '/app/'
  23. $config['SUBFOLDER'] = str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace('\\', '/', $config['SITE_PATH']));
  24. if (strpos($config['SUBFOLDER'], '/') !== 0) {
  25. $config['SUBFOLDER'] = '/' . $config['SUBFOLDER'];
  26. }
  27. $config['APP_URL'] = 'http://' . $_SERVER['HTTP_HOST'] . $config['SUBFOLDER'];
  28. //$config['AUTOROUTE'] = TRUE;
  29. $config['DEBUG_ENABLED'] = TRUE;
  30. //$config['TEMPLATE_COMPILE_ALWAYS'] = TRUE;
  31. //register functions to be used with your template files
  32. //$config['TEMPLATE_GLOBAL_TAGS'] = array('url', 'url2', 'time', 'isset', 'empty');
  33. /**
  34. * Path to store logs/profiles when using with the logger tool. This is needed for writing log files and using the log viewer tool
  35. */
  36. //$config['LOG_PATH'] = '/var/logs/';
  37. /**
  38. * defined either Document or Route to be loaded/executed when requested page is not found
  39. * A 404 route must be one of the routes defined in routes.conf.php (if autoroute on, make sure the controller and method exist)
  40. * Error document must be more than 512 bytes as IE sees it as a normal 404 sent if < 512b
  41. */
  42. //$config['ERROR_404_DOCUMENT'] = 'error.php';
  43. $config['ERROR_404_ROUTE'] = '/error';
  44. /**
  45. * Settings for memcache server connections, you don't have to set if using localhost only.
  46. * host, port, persistent, weight
  47. * $config['MEMCACHE'] = array(
  48. * array('192.168.1.31', '11211', true, 40),
  49. * array('192.168.1.23', '11211', true, 80)
  50. * );
  51. */
  52. /**
  53. * Defines modules that are allowed to be accessed from an auto route URI.
  54. * Example, we have a module in SITE_PATH/PROTECTED_FOLDER/module/example
  55. * It can be accessed via http://localhost/example/controller/method/parameters
  56. *
  57. * $config['MODULES'] = array('example');
  58. *
  59. */
  60. $config['MODULES'] = array('admin');
  61. /**
  62. * Unique string ID of the application to be used with PHP 5.3 namespace and auto loading of namespaced classes
  63. * If you wish to use namespace with the framework, your classes must have a namespace starting with this ID.
  64. * Example below is located at /var/www/app/protected/controller/test and can be access via autoroute http://localhost/test/my/method
  65. * <?php
  66. * namespace myapp\controller\test;
  67. * class MyController extends \DooController {
  68. * .....
  69. * } ?>
  70. *
  71. * You would need to enable autoload to use Namespace classes in index.php
  72. * spl_autoload_register('Doo::autoload');
  73. *
  74. * $config['APP_NAMESPACE_ID'] = 'myapp';
  75. *
  76. */
  77. /**
  78. * To enable autoloading, add directories which consist of the classes needed in your application.
  79. *
  80. * $config['AUTOLOAD'] = array(
  81. //internal directories, live in the app
  82. 'class', 'model', 'module/example/controller',
  83. //external directories, live outside the app
  84. '/var/php/library/classes'
  85. );
  86. */
  87. /**
  88. * you can include self defined config, retrieved via Doo::conf()->variable
  89. * Use lower case for you own settings for future Compability with DooPHP
  90. */
  91. //$config['pagesize'] = 10;
  92. $config['AUTHKEY'] = 'z685b7q4V8ifR7F9T71eUdH8p9k5i135G6p6C9Mek4m3q7y7Uba2XbXdKfXbr9Af';