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.

202 lines
10 KiB

13 years ago
  1. <?php
  2. // The Server Instance constant is used to help ease web applications with multiple environments.
  3. // Feel free to use, change or ignore.
  4. define('SERVER_INSTANCE', 'dev');
  5. switch (SERVER_INSTANCE) {
  6. case 'dev':
  7. case 'test':
  8. case 'stage':
  9. case 'prod':
  10. /* Constant to allow/disallow remote access to the admin pages
  11. * e.g. the generated form_drafts, codegen, or any other script that calls QApplication::CheckRemoteAdmin()
  12. *
  13. * If set to TRUE, anyone can access those pages.
  14. * If set to FALSE, only localhost can access those pages.
  15. * If set to an IP address (e.g. "12.34.56.78"), then only localhost and 12.34.56.78 can access those pages.
  16. * If set to a comma-separate list of IP addresses, then localhoost and any of those IP addresses can access those pages.
  17. *
  18. * Of course, you can also feel free to remove QApplication::CheckRemoteAdmin() call on any of these pages,
  19. * which will completely ignore ALLOW_REMOTE_ADMIN altogether.
  20. */
  21. define('ALLOW_REMOTE_ADMIN', false);
  22. /* Constants for Document Root (and Virtual Directories / Subfoldering)
  23. *
  24. * IMPORTANT NOTE FOR WINDOWS USERS
  25. * Please note that all paths should use standard "forward" slashes instead of "backslashes".
  26. * So windows paths would look like "c:/wwwroot" instead of "c:\wwwroot".
  27. *
  28. * Please specify the "Document Root" here. This is the top level filepath for your web application.
  29. * If you are on a installation that uses virtual directories, then you must specify that here, as well.
  30. *
  31. * For example, if your example web application where http://my.domain.com/index.php points to
  32. * /home/web/htdocs/index.php, then you must specify:
  33. * __DOCROOT__ is defined as '/home/web/htdocs'
  34. * (note the leading slash and no ending slash)
  35. * On Windows, if you have http://my.domain.com/index.php pointing to c:\webroot\files\index.php, then:
  36. * __DOCROOT__ is defined as 'c:/webroot/files'
  37. * (again, note the leading c:/ and no ending slash)
  38. *
  39. * Next, if you are using Virtual Directories, where http://not.my.domain.com/~my_user/index.php
  40. * (for example) points to /home/my_user/public_html/index.php, then:
  41. * __DOCROOT__ is defined as '/home/my_user/public_html'
  42. * __VIRTUAL_DIRECTORY__ is defined as '/~my_user'
  43. *
  44. * Finally, if you have installed Qcodo within a SubDirectory of the Document Root, so for example
  45. * the Qcodo "index.php" page is accessible at http://my.domain.com/frameworks/qcodo/index.php, then:
  46. * __SUBDIRECTORY__ is defined as '/frameworks/qcodo'
  47. * (again, note the leading and no ending slash)
  48. *
  49. * In combination with Virtual Directories, if you (for example) have the Qcodo "index.php" page
  50. * accessible at http://not.my.domain.com/~my_user/qcodo/index.php, and the index.php resides at
  51. * c:\users\my_user\public_html\index.php, then:
  52. * __DOCROOT__ is defined as 'c:/users/my_user/public_html'
  53. * __VIRTUAL_DIRECTORY__ is defined as '/~my_user'
  54. * __SUBDIRECTORY__ is defined as '/qcodo'
  55. */
  56. define ('__DOCROOT__', '/var/www/qcodo/wwwroot');
  57. define ('__VIRTUAL_DIRECTORY__', '');
  58. define ('__SUBDIRECTORY__', '');
  59. /*
  60. * If you are using Apache-based mod_rewrite to perform URL rewrites, please specify "apache" here.
  61. * Otherwise, specify as "none"
  62. */
  63. define ('__URL_REWRITE__', 'none');
  64. // Constant for the DevTools (Command Line Interface) Directory
  65. // (We're assuming it's at one level above __DOCROOT__... but feel free to specify any absolute path
  66. define ('__DEVTOOLS_CLI__', __DOCROOT__ . __SUBDIRECTORY__ . '/../_devtools_cli');
  67. /* Absolute File Paths for Internal Directories
  68. *
  69. * Please specify the absolute file path for all the following directories in your Qcodo-based web
  70. * application.
  71. *
  72. * Note that all paths must start with a slash or 'x:\' (for windows users) and must have
  73. * no ending slashes. (We take advantage of the __DOCROOT__ constant defined above and the
  74. * __INCLUDES__ constant defined below to help simplify this section. But note that this is NOT
  75. * required. These directories can also reside outside of the Document Root altogether.
  76. * So feel free to use or not use the __DOCROOT__ and __INCLUDES__ constants as you wish/need
  77. * in defining your other directory constants.)
  78. */
  79. // General Includes (the location of the Prepend and Configuration includes files, and the Manifest XML)
  80. define ('__INCLUDES__', __DOCROOT__ . __SUBDIRECTORY__ . '/includes');
  81. // The Qcodo Directories
  82. // Includes subdirectories for Qcodo Customizations in CodeGen and QForms, i18n PO files, QCache storage, etc.
  83. // Also includes the _core subdirectory for the QCodo Core
  84. define ('__QCODO__', __INCLUDES__ . '/qcodo');
  85. // The Qcodo Core
  86. define ('__QCODO_CORE__', __INCLUDES__ . '/qcodo/_core');
  87. // Destination for Code Generated class files
  88. define ('__DATA_CLASSES__', __INCLUDES__ . '/data_classes');
  89. define ('__DATAGEN_CLASSES__', __INCLUDES__ . '/data_classes/generated');
  90. define ('__DATA_META_CONTROLS__', __INCLUDES__ . '/data_meta_controls');
  91. define ('__DATAGEN_META_CONTROLS__', __INCLUDES__ . '/data_meta_controls/generated');
  92. /* Relative File Paths for Web Accessible Directories
  93. *
  94. * Please specify the file path RELATIVE FROM THE DOCROOT for all the following web-accessible directories
  95. * in your Qcodo-based web application.
  96. *
  97. * For some directories (e.g. the Examples site), if you are no longer using it, you STILL need to
  98. * have the constant defined. But feel free to define the directory constant as blank (e.g. '') or null.
  99. *
  100. * Note that constants must have a leading slash and no ending slash, and they MUST reside within
  101. * the Document Root.
  102. *
  103. * (We take advantage of the __SUBDIRECTORY__ constant defined above to help simplify this section.
  104. * Note that this is NOT required. Feel free to use or ignore.)
  105. */
  106. // Location of the Qcodo-specific web-based development tools, like codegen.php
  107. define ('__DEVTOOLS__', __SUBDIRECTORY__ . '/_devtools');
  108. // Destination for generated form drafts and panel drafts
  109. define ('__FORM_DRAFTS__', __SUBDIRECTORY__ . '/drafts');
  110. define ('__PANEL_DRAFTS__', __SUBDIRECTORY__ . '/drafts/dashboard');
  111. // Location of the Examples site
  112. define ('__EXAMPLES__', __SUBDIRECTORY__ . '/examples');
  113. // Location of Qcodo-specific Web Assets (JavaScripts, CSS, Images, and PHP Pages/Popups)
  114. define ('__JS_ASSETS__', __SUBDIRECTORY__ . '/assets/js');
  115. define ('__CSS_ASSETS__', __SUBDIRECTORY__ . '/assets/css');
  116. define ('__IMAGE_ASSETS__', __SUBDIRECTORY__ . '/assets/images');
  117. define ('__PHP_ASSETS__', __SUBDIRECTORY__ . '/assets/php');
  118. /* Database Connection SerialArrays
  119. *
  120. * Note that all Database Connections are defined as constant serialized arrays. Qcodo supports
  121. * connections to an unlimited number of different database sources. Each database source, referenced by
  122. * a numeric index, will have its DB Connection SerialArray stored in a DB_CONNECTION_# constant
  123. * (where # is the numeric index).
  124. *
  125. * The SerialArray can have the following keys:
  126. * "adapter" (Required), options are:
  127. * MySql (MySQL v4.x, using the old mysql extension)
  128. * MySqli (MySQL v4.x, using the new mysqli extension)
  129. * MySqli5 (MySQL v5.x, using the new mysqli extension)
  130. * SqlServer (Microsoft SQL Server)
  131. * PostgreSql (PostgreSQL)
  132. * "server" (Required) is the db server's name or IP address, e.g. localhost, 10.1.1.5, etc.
  133. * "port" is the port number - default is the server-specified default
  134. * "database", "username", "password" should be self explanatory
  135. * "profiling" is true or false, defining whether or not you want to enable DB profiling - default is false
  136. * NOTE: Profiling should only be enabled when you are actively wanting to profile a
  137. * specific PHP script or scripts. Because of SIGNIFICANT performance degradation,
  138. * it should otherwise always be OFF.
  139. * "ScriptPath": you can have CodeGen virtually add additional FKs, even though they are
  140. * not defined as a DB constraint in the database, by using a script to define what
  141. * those constraints are. The path of the script can be defined here. - default is blank or none
  142. * Note: any option not used or set to blank will result in using the default value for that option
  143. */
  144. define('DB_CONNECTION_1', serialize(array(
  145. 'adapter' => 'MySqli5',
  146. 'server' => 'localhost',
  147. 'port' => null,
  148. 'database' => 'qcodo',
  149. 'username' => 'root',
  150. 'password' => '',
  151. 'profiling' => false)));
  152. // Additional Database Connection Strings can be defined here (e.g. for connection #2, #3, #4, #5, etc.)
  153. // define('DB_CONNECTION_2', serialize(array('adapter'=>'SqlServer', 'server'=>'localhost', 'port'=>null, 'database'=>'qcodo', 'username'=>'root', 'password'=>'', 'profiling'=>false)));
  154. // define('DB_CONNECTION_3', serialize(array('adapter'=>'MySqli', 'server'=>'localhost', 'port'=>null, 'database'=>'qcodo', 'username'=>'root', 'password'=>'', 'profiling'=>false)));
  155. // define('DB_CONNECTION_4', serialize(array('adapter'=>'MySql', 'server'=>'localhost', 'port'=>null, 'database'=>'qcodo', 'username'=>'root', 'password'=>'', 'profiling'=>false)));
  156. // define('DB_CONNECTION_5', serialize(array('adapter'=>'PostgreSql', 'server'=>'localhost', 'port'=>null, 'database'=>'qcodo', 'username'=>'root', 'password'=>'', 'profiling'=>false)));
  157. // (For PHP > v5.1) Setup the default timezone (if not already specified in php.ini)
  158. if ((function_exists('date_default_timezone_set')) && (!ini_get('date.timezone')))
  159. date_default_timezone_set('America/Los_Angeles');
  160. // Define the Filepath for the error page (path MUST be relative from the DOCROOT)
  161. define('ERROR_PAGE_PATH', __PHP_ASSETS__ . '/_core/error_page.php');
  162. // Define the Filepath for any logged errors
  163. define('ERROR_LOG_PATH', __INCLUDES__ . '/error_log');
  164. // To Log ALL errors that have occurred, set flag to true
  165. // define('ERROR_LOG_FLAG', true);
  166. // To enable the display of "Friendly" error pages and messages, define them here (path MUST be relative from the DOCROOT)
  167. // define('ERROR_FRIENDLY_PAGE_PATH', __PHP_ASSETS__ . '/friendly_error_page.php');
  168. // 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.');
  169. break;
  170. }
  171. ?>