database.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * This is core configuration file.
  4. *
  5. * Use it to configure core behaviour of Cake.
  6. *
  7. * PHP 5
  8. *
  9. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  10. * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  11. *
  12. * Licensed under The MIT License
  13. * Redistributions of files must retain the above copyright notice.
  14. *
  15. * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  16. * @link http://cakephp.org CakePHP(tm) Project
  17. * @package app.Config
  18. * @since CakePHP(tm) v 0.2.9
  19. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  20. */
  21. /**
  22. * In this file you set up your database connection details.
  23. *
  24. * @package cake.config
  25. */
  26. /**
  27. * Database configuration class.
  28. * You can specify multiple configurations for production, development and testing.
  29. *
  30. * datasource => The name of a supported datasource; valid options are as follows:
  31. * Database/Mysql - MySQL 4 & 5,
  32. * Database/Sqlite - SQLite (PHP5 only),
  33. * Database/Postgres - PostgreSQL 7 and higher,
  34. * Database/Sqlserver - Microsoft SQL Server 2005 and higher
  35. *
  36. * You can add custom database datasources (or override existing datasources) by adding the
  37. * appropriate file to app/Model/Datasource/Database. Datasources should be named 'MyDatasource.php',
  38. *
  39. *
  40. * persistent => true / false
  41. * Determines whether or not the database should use a persistent connection
  42. *
  43. * host =>
  44. * the host you connect to the database. To add a socket or port number, use 'port' => #
  45. *
  46. * prefix =>
  47. * Uses the given prefix for all the tables in this database. This setting can be overridden
  48. * on a per-table basis with the Model::$tablePrefix property.
  49. *
  50. * schema =>
  51. * For Postgres specifies which schema you would like to use the tables in. Postgres defaults to 'public'.
  52. *
  53. * encoding =>
  54. * For MySQL, Postgres specifies the character encoding to use when connecting to the
  55. * database. Uses database default not specified.
  56. *
  57. * unix_socket =>
  58. * For MySQL to connect via socket specify the `unix_socket` parameter instead of `host` and `port`
  59. */
  60. class DATABASE_CONFIG {
  61. public $default = array(
  62. 'datasource' => 'Database/Mysql',
  63. 'persistent' => false,
  64. 'host' => 'localhost',
  65. 'login' => 'benchmarkdbuser',
  66. 'password' => 'benchmarkdbpass',
  67. 'database' => 'hello_world',
  68. 'prefix' => '',
  69. 'encoding' => 'utf8',
  70. );
  71. public $test = array(
  72. 'datasource' => 'Database/Mysql',
  73. 'persistent' => false,
  74. 'host' => 'localhost',
  75. 'login' => 'benchmarkdbuser',
  76. 'password' => 'benchmarkdbpass',
  77. 'database' => 'hello_world',
  78. 'prefix' => '',
  79. 'encoding' => 'utf8',
  80. );
  81. }