SproutCMS

This is the code documentation for the SproutCMS project

source of /config/database.php

Database connection settings.

Each array is a separate group, which can be connected to independently.

The standard connection used by Pdb is the 'default' group, but
the method Pdb::connect can be used to connect to other groups

Group Options:
 connection      Array of connection specific parameters:
      type       Only supported value is 'mysql'
      host       Hostname
      user       Username
      pass       Password
      port       If non-empty, specifies a non-standard port
      database   Database name
 character_set   Database character set
  1. <?php
  2. /*
  3.  * Copyright (C) 2017 Karmabunny Pty Ltd.
  4.  *
  5.  * This file is a part of SproutCMS.
  6.  *
  7.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  8.  * of the GNU General Public License as published by the Free Software Foundation, either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * For more information, visit <http://getsproutcms.com>.
  12.  */
  13.  
  14. /**
  15. * Database connection settings.
  16. *
  17. * Each array is a separate group, which can be connected to independently.
  18. *
  19. * The standard connection used by {@see Pdb} is the 'default' group, but
  20. * the method {@see Pdb::connect} can be used to connect to other groups
  21. *
  22. * Group Options:
  23. * connection Array of connection specific parameters:
  24. * type Only supported value is 'mysql'
  25. * host Hostname
  26. * user Username
  27. * pass Password
  28. * port If non-empty, specifies a non-standard port
  29. * database Database name
  30. * character_set Database character set
  31. **/
  32.  
  33.  
  34. if (IN_PRODUCTION) {
  35. // Live server config
  36. $config['default'] = [
  37. 'connection' => [
  38. 'type' => 'mysql',
  39. 'user' => 'b9cc9cf9ed0bce',
  40. 'pass' => 'd7b19b3d',
  41. 'database' => 'heroku_11cb2d367015e0a',
  42. 'host' => 'us-cdbr-east-04.cleardb.com',
  43. 'port' => FALSE,
  44. ],
  45. 'character_set' => 'utf8',
  46. ];
  47.  
  48. // A unique random key for this site
  49. $config['server_key'] = 'QN1hco0gZfp9wl9A';
  50.  
  51. } else {
  52. // Test server config
  53. $config['default'] = [
  54. 'connection' => [
  55. 'type' => 'mysql',
  56. 'user' => 'harbor-and-sprout',
  57. 'pass' => 'password',
  58. 'database' => 'harbor_and-sprout',
  59. 'host' => 'localhost',
  60. 'port' => FALSE,
  61. ],
  62. 'character_set' => 'utf8',
  63. ];
  64.  
  65. // This key is not secure, so it must not be used in production environments
  66. $config['server_key'] = 'NOT SECURE';
  67. }
  68.