PageRenderTime 53ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/sgl/includes/configuration/configuration.inc.php

http://logisticsouth.googlecode.com/
PHP | 225 lines | 58 code | 29 blank | 138 comment | 4 complexity | 7b80f9b7786c18973bb45574cd54f031 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0
  1. <?php
  2. if (!defined('SERVER_INSTANCE')) {
  3. // The Server Instance constant is used to help ease web applications with multiple environments.
  4. // Feel free to use, change or ignore.
  5. define('SERVER_INSTANCE', 'dev');
  6. switch (SERVER_INSTANCE) {
  7. case 'dev':
  8. case 'test':
  9. case 'stage':
  10. case 'prod':
  11. /* Constant to allow/disallow remote access to the admin pages
  12. * e.g. the generated form_drafts, codegen, or any other script that calls QApplication::CheckRemoteAdmin()
  13. *
  14. * If set to TRUE, anyone can access those pages.
  15. * If set to FALSE, only localhost can access those pages.
  16. * If set to an IP address (e.g. "12.34.56.78"), then only localhost and 12.34.56.78 can access those pages.
  17. * If set to a comma-separate list of IP addresses, then localhoost and any of those IP addresses can access those pages.
  18. *
  19. * Of course, you can also feel free to remove QApplication::CheckRemoteAdmin() call on any of these pages,
  20. * which will completely ignore ALLOW_REMOTE_ADMIN altogether.
  21. */
  22. define('ALLOW_REMOTE_ADMIN', true);
  23. /* Constants for Document Root (and Virtual Directories / Subfoldering)
  24. *
  25. * IMPORTANT NOTE FOR WINDOWS USERS
  26. * Please note that all paths should use standard "forward" slashes instead of "backslashes".
  27. * So windows paths would look like "c:/wwwroot" instead of "c:\wwwroot".
  28. *
  29. * Please specify the "Document Root" here. This is the top level filepath for your web application.
  30. * If you are on a installation that uses virtual directories, then you must specify that here, as well.
  31. *
  32. * For example, if your example web application where http://my.domain.com/index.php points to
  33. * /home/web/htdocs/index.php, then you must specify:
  34. * __DOCROOT__ is defined as '/home/web/htdocs'
  35. * (note the leading slash and no ending slash)
  36. * On Windows, if you have http://my.domain.com/index.php pointing to c:\webroot\files\index.php, then:
  37. * __DOCROOT__ is defined as 'c:/webroot/files'
  38. * (again, note the leading c:/ and no ending slash)
  39. *
  40. * Next, if you are using Virtual Directories, where http://not.my.domain.com/~my_user/index.php
  41. * (for example) points to /home/my_user/public_html/index.php, then:
  42. * __DOCROOT__ is defined as '/home/my_user/public_html'
  43. * __VIRTUAL_DIRECTORY__ is defined as '/~my_user'
  44. *
  45. * Finally, if you have installed QCubed within a SubDirectory of the Document Root, so for example
  46. * the QCubed "index.php" page is accessible at http://my.domain.com/frameworks/qcubed/index.php, then:
  47. * __SUBDIRECTORY__ is defined as '/frameworks/qcubed'
  48. * (again, note the leading and no ending slash)
  49. *
  50. * In combination with Virtual Directories, if you (for example) have the QCubed "index.php" page
  51. * accessible at http://not.my.domain.com/~my_user/qcubed/index.php, and the index.php resides at
  52. * c:\users\my_user\public_html\index.php, then:
  53. * __DOCROOT__ is defined as 'c:/users/my_user/public_html'
  54. * __VIRTUAL_DIRECTORY__ is defined as '/~my_user'
  55. * __SUBDIRECTORY__ is defined as '/qcubed'
  56. * /var/www/qcubed/wwwroot
  57. */
  58. define ('__DOCROOT__', '/Applications/XAMPP/xamppfiles/htdocs');
  59. define ('__VIRTUAL_DIRECTORY__', '');
  60. define ('__SUBDIRECTORY__', '/sgl');
  61. /*
  62. * These definitions will hardly change, but you may change them based on your setup
  63. */
  64. define ('__INCLUDES__', __DOCROOT__ . __SUBDIRECTORY__ . '/includes');
  65. define ('__CONFIGURATION__', __INCLUDES__ . '/configuration');
  66. /*
  67. * If you are using Apache-based mod_rewrite to perform URL rewrites, please specify "apache" here.
  68. * Otherwise, specify as "none"
  69. */
  70. define ('__URL_REWRITE__', 'none');
  71. /* Absolute File Paths for Internal Directories
  72. *
  73. * Please specify the absolute file path for all the following directories in your QCubed-based web
  74. * application.
  75. *
  76. * Note that all paths must start with a slash or 'x:\' (for windows users) and must have
  77. * no ending slashes. (We take advantage of the __INCLUDES__ to help simplify this section.
  78. * But note that this is NOT required. These directories can also reside outside of the
  79. * Document Root altogether. So feel free to use or not use the __DOCROOT__ and __INCLUDES__
  80. * constants as you wish/need in defining your other directory constants.)
  81. */
  82. // The QCubed Directories
  83. // Includes subdirectories for QCubed Customizations in CodeGen and QForms, i18n PO files, QCache storage, etc.
  84. // Also includes the _core subdirectory for the QCubed Core
  85. define ('__QCUBED__', __INCLUDES__ . '/qcubed');
  86. define ('__PLUGINS__', __QCUBED__ . '/plugins');
  87. define ('__CACHE__', __INCLUDES__ . '/tmp/cache');
  88. // The QCubed Core
  89. define ('__QCUBED_CORE__', __INCLUDES__ . '/qcubed/_core');
  90. // Destination for Code Generated class files
  91. define ('__MODEL__', __INCLUDES__ . '/model' );
  92. define ('__MODEL_GEN__', __MODEL__ . '/generated' );
  93. define ('__META_CONTROLS__', __INCLUDES__ . '/meta_controls' );
  94. define ('__META_CONTROLS_GEN__', __META_CONTROLS__ . '/generated' );
  95. /* Relative File Paths for Web Accessible Directories
  96. *
  97. * Please specify the file path RELATIVE FROM THE DOCROOT for all the following web-accessible directories
  98. * in your QCubed-based web application.
  99. *
  100. * For some directories (e.g. the Examples site), if you are no longer using it, you STILL need to
  101. * have the constant defined. But feel free to define the directory constant as blank (e.g. '') or null.
  102. *
  103. * Note that constants must have a leading slash and no ending slash, and they MUST reside within
  104. * the Document Root.
  105. *
  106. * (We take advantage of the __SUBDIRECTORY__ constant defined above to help simplify this section.
  107. * Note that this is NOT required. Feel free to use or ignore.)
  108. */
  109. // Destination for generated form drafts and panel drafts
  110. define ('__FORM_DRAFTS__', __SUBDIRECTORY__ . '/drafts');
  111. define ('__FORM_ADMINISTRADOR__', __SUBDIRECTORY__ . '/administrador');
  112. define ('__FORM_EMPLEADO__', __SUBDIRECTORY__ . '/empleados');
  113. define ('__FORM_CLIENTE__', __SUBDIRECTORY__ . '/cliente');
  114. define ('__ARCHIVE_DIRECTORY__', __DOCROOT__ . __SUBDIRECTORY__ . '/archivos');
  115. define ('__ARCHIVE_DIRECTORY_PARTIAL__', __SUBDIRECTORY__ . '/archivos');
  116. define ('__PANEL_DRAFTS__', __SUBDIRECTORY__ . '/drafts/panels');
  117. define ('__FORMBASE_CLASSES__', __INCLUDES__ . '/formbase_classes_generated');
  118. // Location of QCubed-specific Web Assets (JavaScripts, CSS, Images, and PHP Pages/Popups)
  119. define ('__JS_ASSETS__', __SUBDIRECTORY__ . '/assets/_core/js');
  120. define ('__CSS_ASSETS__', __SUBDIRECTORY__ . '/assets/_core/css');
  121. define ('__IMAGE_ASSETS__', __SUBDIRECTORY__ . '/assets/_core/images');
  122. define ('__PHP_ASSETS__', __SUBDIRECTORY__ . '/assets/_core/php');
  123. define ('__PLUGIN_ASSETS__', __SUBDIRECTORY__ . '/assets/plugins');
  124. // jQuery folder location
  125. define ('__JQUERY_BASE__', '/jquery/jquery-1.4.min.js');
  126. define ('__JQUERY_EFFECTS__', '/jquery/jquery-ui-1.7.2.custom.min.js');
  127. // Location of the QCubed-specific web-based development tools, like codegen.php
  128. // define ('__DEVTOOLS__', __PHP_ASSETS__ . '/_devtools');
  129. // Location of the Examples site
  130. define ('__EXAMPLES__', __PHP_ASSETS__ . '/examples');
  131. /* Database Connection SerialArrays
  132. *
  133. * Note that all Database Connections are defined as constant serialized arrays. QCubed supports
  134. * connections to an unlimited number of different database sources. Each database source, referenced by
  135. * a numeric index, will have its DB Connection SerialArray stored in a DB_CONNECTION_# constant
  136. * (where # is the numeric index).
  137. *
  138. * The SerialArray can have the following keys:
  139. * "adapter" (Required), options are:
  140. * MySql (MySQL v4.x, using the old mysql extension)
  141. * MySqli (MySQL v4.x, using the new mysqli extension)
  142. * MySqli5 (MySQL v5.x, using the new mysqli extension)
  143. * SqlServer (Microsoft SQL Server)
  144. * SqlServer2005 (Microsoft SQL Server 2005/2008 using new sqlsrv extension, Windows only)
  145. * PostgreSql (PostgreSQL)
  146. * "server" (Required) is the db server's name or IP address, e.g. localhost, 10.1.1.5, etc.
  147. * "port" is the port number - default is the server-specified default
  148. * "database", "username", "password" should be self explanatory
  149. * "dateformat" is an optional value for the desired db date format, the default value is
  150. * 'YYYY-MM-DD hhhh:mm:ss' if not defined or null
  151. * "profiling" is true or false, defining whether or not you want to enable DB profiling - default is false
  152. * NOTE: Profiling should only be enabled when you are actively wanting to profile a
  153. * specific PHP script or scripts. Because of SIGNIFICANT performance degradation,
  154. * it should otherwise always be OFF.
  155. * "ScriptPath": you can have CodeGen virtually add additional FKs, even though they are
  156. * not defined as a DB constraint in the database, by using a script to define what
  157. * those constraints are. The path of the script can be defined here. - default is blank or none
  158. * Note: any option not used or set to blank will result in using the default value for that option
  159. */
  160. define('DB_CONNECTION_1', serialize(array(
  161. 'adapter' => 'MySqli5',
  162. 'server' => 'localhost',
  163. 'port' => null,
  164. 'database' => 'sgldemo',
  165. 'username' => 'root',
  166. 'password' => '1234567',
  167. 'encoding' => 'utf8',
  168. 'profiling' => false)));
  169. // Additional Database Connection Strings can be defined here (e.g. for connection #2, #3, #4, #5, etc.)
  170. // define('DB_CONNECTION_2', serialize(array('adapter'=>'SqlServer', 'server'=>'localhost', 'port'=>null, 'database'=>'qcubed', 'username'=>'root', 'password'=>'', 'profiling'=>false)));
  171. // define('DB_CONNECTION_3', serialize(array('adapter'=>'MySqli', 'server'=>'localhost', 'port'=>null, 'database'=>'qcubed', 'username'=>'root', 'password'=>'', 'profiling'=>false)));
  172. // define('DB_CONNECTION_4', serialize(array('adapter'=>'MySql', 'server'=>'localhost', 'port'=>null, 'database'=>'qcubed', 'username'=>'root', 'password'=>'', 'profiling'=>false)));
  173. // define('DB_CONNECTION_5', serialize(array('adapter'=>'PostgreSql', 'server'=>'localhost', 'port'=>null, 'database'=>'qcubed', 'username'=>'root', 'password'=>'', 'profiling'=>false)));
  174. // (For PHP > v5.1) Setup the default timezone (if not already specified in php.ini)
  175. if ((function_exists('date_default_timezone_set')) && (!ini_get('date.timezone')))
  176. date_default_timezone_set('America/Los_Angeles');
  177. // Determines which class is used to serialize the form in-between Ajax callbacks.
  178. // By default, QFormStateHandler will be used (which simply outputs the entire serialized
  179. // form data stream to the form), but file- and session- based, or any custom db-
  180. // based FormState handling can be used as well.
  181. define('__FORM_STATE_HANDLER__', 'QFormStateHandler');
  182. // If using the QFileFormStateHandler, specify the path where QCubed will save the session state files (has to be writeable!)
  183. define('__FILE_FORM_STATE_HANDLER_PATH__', __DOCROOT__ . '/tmp');
  184. // Define the Filepath for the error page (path MUST be relative from the DOCROOT)
  185. define('ERROR_PAGE_PATH', __PHP_ASSETS__ . '/error_page.php');
  186. // Define the Filepath for any logged errors
  187. define('ERROR_LOG_PATH', __INCLUDES__ . '/error_log');
  188. // To Log ALL errors that have occurred, set flag to true
  189. // define('ERROR_LOG_FLAG', true);
  190. // To enable the display of "Friendly" error pages and messages, define them here (path MUST be relative from the DOCROOT)
  191. // define('ERROR_FRIENDLY_PAGE_PATH', __PHP_ASSETS__ . '/friendly_error_page.php');
  192. // 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.');
  193. break;
  194. }
  195. }
  196. ?>