Base for a static organization website

database.php 2.5KB

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