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.

254 lines
12 KiB

12 years ago
  1. <?php
  2. //This file must always be included for any QuasiCMS files to run
  3. define('QUASICMS',1);
  4. define('QUASI_VERSION', '0.2');
  5. /************ Quasi CMS configuration *************/
  6. /**
  7. * Attempt to set the base directories - if this does not work for you
  8. * comment out the autoconfiguration and uncomment and set the
  9. * following for your setup:
  10. * define('__WWWROOT__', '/var/www/quasi');
  11. * define ('__QUASI_SUBDIRECTORY__', '');
  12. */
  13. define('__WWWROOT__', rtrim( $_SERVER['DOCUMENT_ROOT'], '/') );
  14. //if Quasi is in the docroot, just leave __QUASI_SUBDIRECTORY__ empty
  15. if(file_exists(__WWWROOT__ . '/core/Quasi.class.php'))
  16. define ('__QUASI_SUBDIRECTORY__', '');
  17. else
  18. {
  19. //attempt to find the sub directory from the script executing:
  20. $strScriptname = $_SERVER['SCRIPT_NAME'];
  21. $pos = strrpos( $strScriptname, '/' );
  22. //remove scriptname itself ..
  23. $strSubdir = substr( $strScriptname, 0, $pos );
  24. $arySubdirs = explode('/', trim($strSubdir) );
  25. //remove empty first cell ..
  26. array_shift($arySubdirs);
  27. $strDirStack = '';
  28. //check each subdirectory for Quasi class file ..
  29. foreach($arySubdirs as $strPart)
  30. {
  31. $strDirStack .= '/' . $strPart;
  32. if(file_exists(__WWWROOT__ . $strDirStack . '/core/Quasi.class.php'))
  33. {
  34. define ('__QUASI_SUBDIRECTORY__', $strDirStack);
  35. break;
  36. }
  37. }
  38. //Quasi installation will catch this ..
  39. if(!defined('__QUASI_SUBDIRECTORY__'))
  40. throw new Exception('Base directory autoconfiguration failed. Please set manually.');
  41. }
  42. /**
  43. * ----------------------- Quasi CMS directories -------------------------------
  44. *
  45. * The Quasi directory structure is designed to support separation between core, contributed
  46. * and local code to make isolation and independant updates clean. The core/ directory is
  47. * maintained in the main Quasi repository and may be checked out and updated by itself,
  48. * the contrib directory is maintained as the Quasi contributed code repository and local is
  49. * delegated to local custom code for a site. Each of these contains the same substructure:
  50. * - assets: images, css and javascript files
  51. * - classes: class files and other files
  52. * - modules: module class files - this is where the module loader looks for registered modules
  53. * - templates: template files used by classes in the other directories. These represent the final
  54. * stage of the View and may be altered
  55. * - orm: ORM object classes for the data model. Base classes for these may be placed
  56. * under orm/static for non-generated or orm/generated for QCodo generated classes.
  57. * Classes under orm/ will be autoloaded by Quasi.
  58. * Note: you must configure QCodo code generation to use these directories - or you can
  59. * also use the standard QCodo default directories under qcodoroot/includes
  60. * The autoloader also makes it possible to have a local version of a class that overrides the
  61. * core version - local classes will be loaded first, then contrib, then core. The same applies
  62. * for Javascripts and in CSS loading cascades in the reverse direction.
  63. */
  64. ///Base of the Quasi tree - Note that this _includes_ the subdirectory for the absolute path
  65. /// ASSETS of any kind are relative and must build off ONLY __QUASI_SUBDIRECTORY__
  66. /// - see below.
  67. define('__QUASI_ROOT__', __WWWROOT__ . __QUASI_SUBDIRECTORY__ );
  68. ///Quasi core absolute directories
  69. define('__QUASI_CORE__', __QUASI_ROOT__ . '/core');
  70. define('__QUASI_CORE_CLASSES__', __QUASI_CORE__ . '/classes');
  71. define('__QUASI_CORE_MODULES__', __QUASI_CORE__ . '/modules');
  72. define('__QUASI_CORE_ORM__', __QUASI_CORE__ . '/orm');
  73. define('__QUASI_CORE_METAORM__', __QUASI_CORE__ . '/meta_controls');
  74. define('__QUASI_CORE_TEMPLATES__', __QUASI_CORE__ . '/templates');
  75. ///core relative directories
  76. define('__QUASI_CORE_ASSETS__', __QUASI_SUBDIRECTORY__ . '/core/assets');
  77. define('__QUASI_CORE_IMAGES__', __QUASI_CORE_ASSETS__ . '/images');
  78. define('__QUASI_CORE_JS__', __QUASI_CORE_ASSETS__ . '/js');
  79. define('__QUASI_CORE_CSS__', __QUASI_CORE_ASSETS__ . '/css');
  80. ///Contributed and non-core code directories
  81. define('__QUASI_CONTRIB__', __QUASI_ROOT__ . '/contrib');
  82. define('__QUASI_CONTRIB_CLASSES__', __QUASI_CONTRIB__ . '/classes');
  83. define('__QUASI_CONTRIB_MODULES__', __QUASI_CONTRIB__ . '/modules');
  84. define('__QUASI_CONTRIB_ORM__', __QUASI_CONTRIB__ . '/orm');
  85. define('__QUASI_CONTRIB_METAORM__', __QUASI_CONTRIB__ . '/meta_controls');
  86. define('__QUASI_CONTRIB_TEMPLATES__', __QUASI_CONTRIB__ . '/templates');
  87. ///contrib relative directories
  88. define('__QUASI_CONTRIB_ASSETS__', __QUASI_SUBDIRECTORY__ . '/contrib/assets');
  89. define('__QUASI_CONTRIB_IMAGES__', __QUASI_CONTRIB_ASSETS__ . '/images');
  90. define('__QUASI_CONTRIB_JS__', __QUASI_CONTRIB_ASSETS__ . '/js');
  91. define('__QUASI_CONTRIB_CSS__', __QUASI_CONTRIB_ASSETS__ . '/css');
  92. ///Local code directories
  93. define('__QUASI_LOCAL__', __QUASI_ROOT__ . '/local');
  94. define('__QUASI_LOCAL_CLASSES__', __QUASI_LOCAL__ . '/classes');
  95. define('__QUASI_LOCAL_MODULES__', __QUASI_LOCAL__ . '/modules');
  96. define('__QUASI_LOCAL_ORM__', __QUASI_LOCAL__ . '/orm');
  97. define('__QUASI_LOCAL_METAORM__', __QUASI_LOCAL__ . '/meta_controls');
  98. define('__QUASI_LOCAL_TEMPLATES__', __QUASI_LOCAL__ . '/templates');
  99. ///local relative directories
  100. define('__QUASI_LOCAL_ASSETS__', __QUASI_SUBDIRECTORY__ . '/local/assets');
  101. define('__QUASI_LOCAL_IMAGES__', __QUASI_LOCAL_ASSETS__ . '/images');
  102. define('__QUASI_LOCAL_JS__', __QUASI_LOCAL_ASSETS__ . '/js');
  103. define('__QUASI_LOCAL_CSS__', __QUASI_LOCAL_ASSETS__ . '/css');
  104. /**
  105. * Base of the QCodo tree - this is required to run Quasi CMS - it is the one thing
  106. * you may need to configure. If the Quasi CMS and QCodo directories are together
  107. * (ie. Quasi root == QCodo's wwwroot), you can simply uncomment the second line,
  108. * otherwise you must specify the location of QCodo's root (the directory called "wwwroot"
  109. * in the distribution) as shown in the first line.
  110. */
  111. // define('__QCODO_ROOT__', __WWWROOT__ . '/qcodo' );
  112. define('__QCODO_ROOT__', __WWWROOT__ . __QUASI_SUBDIRECTORY__ );
  113. /**
  114. * Extend the PHP include path - this makes it unnecessary to modify php.ini, you can
  115. * also add extra paths to search here. This also ensures that we load our files first in
  116. * case of conflicts. The final include is for QCodo for if it is bundled with Quasi.
  117. */
  118. set_include_path( __QUASI_CORE_CLASSES__ . PATH_SEPARATOR
  119. . __QUASI_CORE_MODULES__ . PATH_SEPARATOR
  120. . __QUASI_CONTRIB_CLASSES__ . PATH_SEPARATOR
  121. . __QUASI_CONTRIB_MODULES__ . PATH_SEPARATOR
  122. . __QUASI_LOCAL_CLASSES__ . PATH_SEPARATOR
  123. . __QUASI_LOCAL_MODULES__ . PATH_SEPARATOR
  124. //this is for QCodo if bundled ..
  125. . __QCODO_ROOT__ . PATH_SEPARATOR
  126. . get_include_path()
  127. );
  128. /**
  129. * Module configurations - these are local values for modules.
  130. * TODO: create a scheme for storing these in the database - this is a quick fix
  131. * due to current time constraints, ideally we should probably move these to the
  132. * database (encrypted). First we need an interface for entering them, then store in db ..
  133. *
  134. */
  135. ///USPS shipping ..change me for use!
  136. define('USPS_USERID', 'get from USPS' );
  137. ///Endicia Label service .. Note: the test values can also be set to the production values
  138. /// and test mode will be active against the production server.
  139. define('ENDICIA_TESTDOMAIN', 'www.envmgr.com' );
  140. define('ENDICIA_TESTREQUESTER_ID', 'get from Endicia' );
  141. define('ENDICIA_TESTREQUEST_ID', 'get from Endicia' );
  142. define('ENDICIA_TESTACCOUNT_ID', 'get from Endicia' );
  143. define('ENDICIA_TESTPASSWORD', 'get from Endicia' );
  144. define('ENDICIA_DOMAIN', 'labelserver.endicia.com' );
  145. define('ENDICIA_REQUESTER_ID', 'get from Endicia' );
  146. define('ENDICIA_REQUEST_ID', 'get from Endicia' );
  147. define('ENDICIA_ACCOUNT_ID', 'get from Endicia' );
  148. define('ENDICIA_PASSWORD', 'get from Endicia' );
  149. define('ENDICIA_RECREDIT_AMOUNT', 100 );
  150. define('ENDICIA_ACCOUNT_MIN', 100 );
  151. define('ENDICIA_AUTO_RECREDIT', false );
  152. ///default mail piece type/shape
  153. define('ENDICIA_MAILPIECE_SHAPE', 'FlatRateEnvelope' );
  154. define('ENDICIA_CGI_URL', '/LabelService/EwsLabelService.asmx/' );
  155. ///FedEx shipping ..
  156. define('FEDEX_TESTKEY', 'developer key' );
  157. define('FEDEX_TESTPASSWORD', 'developer password' );
  158. define('FEDEX_TESTACCOUNT_NUMBER', 'developer number' );
  159. define('FEDEX_TESTMETER_NUMBER', 'developer number' );
  160. define('FEDEX_KEY', 'get from FedEx' );
  161. define('FEDEX_PASSWORD', 'get from FedEx' );
  162. define('FEDEX_ACCOUNT_NUMBER', 'get from FedEx' );
  163. define('FEDEX_METER_NUMBER', 'get from FedEx' );
  164. /**
  165. * Payment methods
  166. */
  167. /* /// PayPal EWP - unimplemented (requires FORM POST ... use IFRAME ??)
  168. define("PAYPAL_DEV_CENTRAL", "developer");
  169. define("PAYPAL_ENV", "sandbox");
  170. ///Note: these are testing values by default, from the PP SDK ..
  171. define("PAYPAL_EWP_USERNAME", "sdk-three_api1.sdk.com");
  172. define("PAYPAL_EWP_PASSWORD", "QFZCWN5HZM8VBG7Q");
  173. define("PAYPAL_SIGNATURE", "A.d9eRKfd1yVkRrtmMfCFLTqa6M9AyodL0SJkhYztxUi8W9pCXF6.4NI");
  174. define("PAYPAL_EMAIL_ADDRESS", "sdk-seller@sdk.com");
  175. define("PAYPAL_IDENTITY_TOKEN", "G5JgcRdmlYUwnHcYSEXI2rFuQ5yv-Ei19fMFWn30aDkZAoKt_7LTuufYXUa");
  176. define("PAYPAL_EWP_CERT_PATH", "cert/sdk-ewp-cert.pem");
  177. define("PAYPAL_EWP_PRIVATE_KEY_PATH", "cert/sdk-ewp-key.pem");
  178. define("PAYPAL_EWP_PRIVATE_KEY_PWD", "password");
  179. define("PAYPAL_CERT_ID", "KJAERUGBLVF6Y");
  180. define("PAYPAL_CERT_PATH", "cert/sandbox-cert.pem");
  181. define("PAYPAL_BUTTON_IMAGE_URL", "https://www.paypal.com/en_US/i/btn/x-click-but23.gif");
  182. define("PAYPAL_IPN_LOG", "paypal-ipn.log");
  183. */
  184. /// PayPal Express / NVP
  185. define('PAYPAL_REDIRECT_TESTURL', 'https://www.sandbox.paypal.com');
  186. define('PAYPAL_REDIRECT_URL', 'https://www.paypal.com');
  187. define('PAYPAL_NVP_TESTURL', 'https://api-3t.sandbox.paypal.com');
  188. define('PAYPAL_NVP_URL', 'https://api-3t.paypal.com');
  189. ///Note: these are testing values by default, from the PayPal SDK, adjust for real account ..
  190. define('PAYPAL_NVP_USERNAME', 'sdk-three_api1.sdk.com');
  191. define('PAYPAL_NVP_PASSWORD', 'QFZCWN5HZM8VBG7Q');
  192. define('PAYPAL_NVP_SIGNATURE', 'A.d9eRKfd1yVkRrtmMfCFLTqa6M9AyodL0SJkhYztxUi8W9pCXF6.4NI');
  193. ///Authorize.net AIM
  194. define('AUTHORIZENET_AIM_USERNAME','get from authorize.net');
  195. define('AUTHORIZENET_AIM_TRANSACTIONKEY','get from authorize.net');
  196. define('AUTHORIZENET_AIM_URL','secure.authorize.net');
  197. define('AUTHORIZENET_AIM_TESTUSERNAME','get from authorize.net');
  198. define('AUTHORIZENET_AIM_TESTTRANSACTIONKEY','get from authorize.net');
  199. define('AUTHORIZENET_AIM_TESTURL','test.authorize.net');
  200. /**
  201. * Webstore settings - Note, this might be better as Account #1 in the database ..
  202. */
  203. define('STORE_EMAIL_ADDRESS','');
  204. define('STORE_OWNER','');
  205. define('STORE_ADDRESS1', '');
  206. define('STORE_ADDRESS2', '');
  207. define('STORE_CITY', '');
  208. define('STORE_COUNTY','');
  209. define('STORE_STATE','');
  210. define('STORE_POSTAL_CODE', '');
  211. define('STORE_COUNTRY','');
  212. define('STORE_PHONE','');
  213. define('STORE_FAX','');
  214. define('STORE_NAME','My Store');
  215. /// Default description sent to payment providers ..
  216. define('DEFAULT_ORDER_DESCRIPTION', 'storename product');
  217. ///Defaults for providers - these will be selected by default at checkout.
  218. /// Note: you can disable defaults by merely leaving these empty.
  219. define('DEFAULT_PAYMENT_PROVIDER','Authorize.net');
  220. define('DEFAULT_PAYMENT_SERVICE','Credit Card');
  221. define('DEFAULT_SHIPPING_CARRIER','USPS');
  222. define('DEFAULT_SHIPPING_SERVICE','PRIORITY');
  223. /**
  224. * Which page to redirect to after login
  225. */
  226. define('LOGIN_REDIRECT', '/index.php/AccountHome');
  227. /**
  228. * Miscelleneous defaults
  229. */
  230. define('MAX_PRODUCT_QUANTITY', 1000);
  231. define('DEFAULT_SHIPPING_RATE', 2);
  232. ?>