database.php.default 3.0 KB

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