database.php.default 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. *
  4. *
  5. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  6. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  7. *
  8. * Licensed under The MIT License
  9. * For full copyright and license information, please see the LICENSE.txt
  10. * Redistributions of files must retain the above copyright notice.
  11. *
  12. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  13. * @link http://cakephp.org CakePHP(tm) Project
  14. * @package app.Config
  15. * @since CakePHP(tm) v 0.2.9
  16. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  17. */
  18. /**
  19. * Database configuration class.
  20. *
  21. * You can specify multiple configurations for production, development and testing.
  22. *
  23. * datasource => The name of a supported datasource; valid options are as follows:
  24. * Database/Mysql - MySQL 4 & 5,
  25. * Database/Sqlite - SQLite (PHP5 only),
  26. * Database/Postgres - PostgreSQL 7 and higher,
  27. * Database/Sqlserver - Microsoft SQL Server 2005 and higher
  28. *
  29. * You can add custom database datasources (or override existing datasources) by adding the
  30. * appropriate file to app/Model/Datasource/Database. Datasources should be named 'MyDatasource.php',
  31. *
  32. *
  33. * persistent => true / false
  34. * Determines whether or not the database should use a persistent connection
  35. *
  36. * host =>
  37. * the host you connect to the database. To add a socket or port number, use 'port' => #
  38. *
  39. * prefix =>
  40. * Uses the given prefix for all the tables in this database. This setting can be overridden
  41. * on a per-table basis with the Model::$tablePrefix property.
  42. *
  43. * schema =>
  44. * For Postgres/Sqlserver specifies which schema you would like to use the tables in.
  45. * Postgres defaults to 'public'. For Sqlserver, it defaults to empty and use
  46. * the connected user's default schema (typically 'dbo').
  47. *
  48. * encoding =>
  49. * For MySQL, Postgres specifies the character encoding to use when connecting to the
  50. * database. Uses database default not specified.
  51. *
  52. * unix_socket =>
  53. * For MySQL to connect via socket specify the `unix_socket` parameter instead of `host` and `port`
  54. *
  55. * settings =>
  56. * Array of key/value pairs, on connection it executes SET statements for each pair
  57. * For MySQL : http://dev.mysql.com/doc/refman/5.6/en/set-statement.html
  58. * For Postgres : http://www.postgresql.org/docs/9.2/static/sql-set.html
  59. * For Sql Server : http://msdn.microsoft.com/en-us/library/ms190356.aspx
  60. *
  61. * flags =>
  62. * A key/value array of driver specific connection options.
  63. */
  64. class DATABASE_CONFIG {
  65. public $default = array(
  66. 'datasource' => 'Database/Mysql',
  67. 'persistent' => false,
  68. 'host' => 'localhost',
  69. 'login' => 'user',
  70. 'password' => 'password',
  71. 'database' => 'database_name',
  72. 'prefix' => '',
  73. //'encoding' => 'utf8',
  74. );
  75. public $test = array(
  76. 'datasource' => 'Database/Mysql',
  77. 'persistent' => false,
  78. 'host' => 'localhost',
  79. 'login' => 'user',
  80. 'password' => 'password',
  81. 'database' => 'test_database_name',
  82. 'prefix' => '',
  83. //'encoding' => 'utf8',
  84. );
  85. }