A Qcodo based CMS/ecommerce framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
5.3 KiB

12 years ago
  1. <?php
  2. define('SERVER_INSTANCE', 'dev');
  3. switch (SERVER_INSTANCE)
  4. {
  5. case 'dev':
  6. case 'test':
  7. case 'stage':
  8. case 'prod':
  9. define('__DOCROOT__', rtrim( $_SERVER['DOCUMENT_ROOT'], '/') );
  10. if(is_dir(__DOCROOT__ . '/includes/qcodo/_core'))
  11. {
  12. define ('__SUBDIRECTORY__', '');
  13. } else {
  14. $scriptname = $_SERVER['PHP_SELF'];
  15. $pos = strrpos( $scriptname, '/' );
  16. $subdir = substr( $scriptname, 0, $pos );
  17. $arySubdirs = explode('/', trim($subdir) );
  18. $strDirStack = '';
  19. //remove empty first cell ..
  20. array_shift($arySubdirs);
  21. foreach($arySubdirs as $strPart)
  22. {
  23. $strDirStack .= '/' . $strPart;
  24. if(is_dir(__DOCROOT__ . $strDirStack . '/includes/qcodo/_core'))
  25. {
  26. define ('__SUBDIRECTORY__', $strDirStack);
  27. break;
  28. }
  29. }
  30. }
  31. /***************************************************************
  32. If the autoconfiguration above did not work, you can comment
  33. it out and use the following to set base directories statically:
  34. if( defined('QUASICMS') )
  35. {
  36. define ('__DOCROOT__', __WWWROOT__ );
  37. define ('__SUBDIRECTORY__', __QUASI_SUBDIRECTORY__ );
  38. }
  39. else
  40. {
  41. define ('__DOCROOT__', '/var/www/quasi');
  42. define ('__SUBDIRECTORY__', '');
  43. }
  44. ***************************************************************/
  45. define ('__VIRTUAL_DIRECTORY__', '');
  46. define('DB_CONNECTION_1', serialize(array(
  47. 'adapter' => 'MySql5',
  48. 'server' => 'localhost',
  49. 'port' => null,
  50. 'database' => 'quasicmstest',
  51. 'username' => 'quasidbutest',
  52. 'password' => 'quasidbptest',
  53. 'secure' => false,
  54. 'sslkey' => '',
  55. 'sslcertificate' => '',
  56. 'sslcacertificate' => '',
  57. 'profiling' => false,
  58. 'encoding' => 'utf8',
  59. )
  60. ));
  61. break;
  62. }
  63. define('ALLOW_REMOTE_ADMIN', true);
  64. define ('__URL_REWRITE__', 'apache');
  65. define ('__DEVTOOLS_CLI__', __DOCROOT__ . __SUBDIRECTORY__ . '/../_devtools_cli');
  66. define ('__INCLUDES__', __DOCROOT__ . __SUBDIRECTORY__ . '/includes');
  67. define ('__QCODO__', __INCLUDES__ . '/qcodo');
  68. define ('__QCODO_CORE__', __INCLUDES__ . '/qcodo/_core');
  69. define ('__DEVTOOLS__', __SUBDIRECTORY__ . '/_devtools');
  70. // We don't want "Examples", and we don't want to download them during qcodo_update
  71. define ('__EXAMPLES__', '/examples');
  72. define ('__JS_ASSETS__', __SUBDIRECTORY__ . '/assets/js');
  73. define ('__CSS_ASSETS__', __SUBDIRECTORY__ . '/assets/css');
  74. define ('__IMAGE_ASSETS__', __SUBDIRECTORY__ . '/assets/images');
  75. define ('__PHP_ASSETS__', __SUBDIRECTORY__ . '/assets/php');
  76. if ((function_exists('date_default_timezone_set')) && (!ini_get('date.timezone')))
  77. date_default_timezone_set('America/Los_Angeles');
  78. define('ERROR_PAGE_PATH', __PHP_ASSETS__ . '/_core/error_page.php');
  79. // define('ERROR_LOG_PATH', __INCLUDES__ . '/error_log');
  80. // define('ERROR_FRIENDLY_PAGE_PATH', __PHP_ASSETS__ . '/friendly_error_page.php');
  81. // define('ERROR_FRIENDLY_AJAX_MESSAGE', 'Oops! An error has occurred.\r\n\r\nThe error was logged, and we will take a look into this right away.');
  82. /** Quasi CMS specific configuration
  83. * The generator directories are defined so that it is easy to have a different local generation.
  84. * All basic functionality for Quasi's ORM layer is under core/orm/ while the generated base classes
  85. * are in generated. Thus, Quasi ORM can be under version control while generated classes
  86. * are not, allowing for local versions of base classes that may have relationships due to local
  87. * database schema changes or extensions. You can move subclassed ORM and MetaControls
  88. * classes to the directories under local after generation and they will be found by the
  89. * Quasi autoloader (Note: currently if you move the generated base class you will need to modify
  90. * the require statements to suit, if you leave them in generated/ they will function as is.).
  91. * This way local and core code can be under different version control without conflict - generated/
  92. * classes are not under version control.
  93. */
  94. /// QUASIBASE defined here in case we are running code generation (ie. without Quasi)
  95. /// QUASIBASE should be the same as QUASI_ROOT ..
  96. define ('__QUASIBASE__', __DOCROOT__ . __SUBDIRECTORY__ );
  97. /// ORM Classes and MetaControls _all_ go under core/orm
  98. define ('__DATA_CLASSES__', __QUASIBASE__ . '/core/orm');
  99. define ('__DATA_META_CONTROLS__', __QUASIBASE__ . '/core/meta_controls');
  100. /// Generated base classes and drafts go under generated/
  101. define ('__DATAGEN_CLASSES__', __QUASIBASE__ . '/generated/orm');
  102. define ('__DATAGEN_META_CONTROLS__', __QUASIBASE__ . '/generated/meta_controls');
  103. ///
  104. define ('__PANEL_DRAFTS__', __SUBDIRECTORY__ . '/generated/panels');
  105. define ('__FORM_DRAFTS__', __SUBDIRECTORY__ . '/generated/forms');
  106. ?>