server/src/config/database.php
changeset 2 00e2916104fe
parent 1 01a844d292ac
child 4 f55970e41793
equal deleted inserted replaced
1:01a844d292ac 2:00e2916104fe
     1 <?php
     1 <?php
     2 
     2 
     3 return [
     3 return [
     4 
     4 
     5 	/*
     5     /*
     6 	|--------------------------------------------------------------------------
     6     |--------------------------------------------------------------------------
     7 	| PDO Fetch Style
     7     | PDO Fetch Style
     8 	|--------------------------------------------------------------------------
     8     |--------------------------------------------------------------------------
     9 	|
     9     |
    10 	| By default, database results will be returned as instances of the PHP
    10     | By default, database results will be returned as instances of the PHP
    11 	| stdClass object; however, you may desire to retrieve records in an
    11     | stdClass object; however, you may desire to retrieve records in an
    12 	| array format for simplicity. Here you can tweak the fetch style.
    12     | array format for simplicity. Here you can tweak the fetch style.
    13 	|
    13     |
    14 	*/
    14     */
    15 
    15 
    16 	'fetch' => PDO::FETCH_CLASS,
    16     'fetch' => PDO::FETCH_CLASS,
    17 
    17 
    18 	/*
    18     /*
    19 	|--------------------------------------------------------------------------
    19     |--------------------------------------------------------------------------
    20 	| Default Database Connection Name
    20     | Default Database Connection Name
    21 	|--------------------------------------------------------------------------
    21     |--------------------------------------------------------------------------
    22 	|
    22     |
    23 	| Here you may specify which of the database connections below you wish
    23     | Here you may specify which of the database connections below you wish
    24 	| to use as your default connection for all database work. Of course
    24     | to use as your default connection for all database work. Of course
    25 	| you may use many connections at once using the Database library.
    25     | you may use many connections at once using the Database library.
    26 	|
    26     |
    27 	*/
    27     */
    28 
    28 
    29 	'default' => 'pgsql',
    29     'default' => 'pgsql',
    30 
    30 
    31 	/*
    31     /*
    32 	|--------------------------------------------------------------------------
    32     |--------------------------------------------------------------------------
    33 	| Database Connections
    33     | Database Connections
    34 	|--------------------------------------------------------------------------
    34     |--------------------------------------------------------------------------
    35 	|
    35     |
    36 	| Here are each of the database connections setup for your application.
    36     | Here are each of the database connections setup for your application.
    37 	| Of course, examples of configuring each database platform that is
    37     | Of course, examples of configuring each database platform that is
    38 	| supported by Laravel is shown below to make development simple.
    38     | supported by Laravel is shown below to make development simple.
    39 	|
    39     |
    40 	|
    40     |
    41 	| All database work in Laravel is done through the PHP PDO facilities
    41     | All database work in Laravel is done through the PHP PDO facilities
    42 	| so make sure you have the driver for your particular database of
    42     | so make sure you have the driver for your particular database of
    43 	| choice installed on your machine before you begin development.
    43     | choice installed on your machine before you begin development.
    44 	|
    44     |
    45 	*/
    45     */
    46 
    46 
    47 	'connections' => [
    47     'connections' => [
    48 
    48 
    49 		'sqlite' => [
    49         'sqlite' => [
    50 			'driver'   => 'sqlite',
    50             'driver' => 'sqlite',
    51 			'database' => storage_path().'/database.sqlite',
    51             'database' => storage_path().'/database.sqlite',
    52 			'prefix'   => '',
    52             'prefix' => '',
    53 		],
    53         ],
    54 
    54 
    55 		'mysql' => [
    55         'mysql' => [
    56 			'driver'    => 'mysql',
    56             'driver' => 'mysql',
    57 			'host'      => env('DB_HOST', 'localhost'),
    57             'host' => env('DB_HOST', 'localhost'),
    58 			'database'  => env('DB_DATABASE', 'forge'),
    58             'database' => env('DB_DATABASE', 'forge'),
    59 			'username'  => env('DB_USERNAME', 'forge'),
    59             'username' => env('DB_USERNAME', 'forge'),
    60 			'password'  => env('DB_PASSWORD', ''),
    60             'password' => env('DB_PASSWORD', ''),
    61 			'charset'   => 'utf8',
    61             'charset' => 'utf8',
    62 			'collation' => 'utf8_unicode_ci',
    62             'collation' => 'utf8_unicode_ci',
    63 			'prefix'    => '',
    63             'prefix' => '',
    64 			'strict'    => false,
    64             'strict' => false,
    65 		],
    65         ],
    66 
    66 
    67 		'pgsql' => [
    67         'pgsql' => [
    68 			'driver'   => 'pgsql',
    68             'driver' => 'pgsql',
    69 			'host'     => env('DB_HOST', 'localhost'),
    69             'host' => env('DB_HOST', 'localhost'),
    70 			'database' => env('DB_DATABASE', 'forge'),
    70             'database' => env('DB_DATABASE', 'forge'),
    71 			'username' => env('DB_USERNAME', 'forge'),
    71             'username' => env('DB_USERNAME', 'forge'),
    72 			'password' => env('DB_PASSWORD', ''),
    72             'password' => env('DB_PASSWORD', ''),
    73 			'charset'  => 'utf8',
    73             'charset' => 'utf8',
    74 			'prefix'   => '',
    74             'prefix' => '',
    75 			'schema'   => 'public',
    75             'schema' => 'public',
    76 		],
    76         ],
    77 
    77 
    78 		'sqlsrv' => [
    78         'sqlsrv' => [
    79 			'driver'   => 'sqlsrv',
    79             'driver' => 'sqlsrv',
    80 			'host'     => env('DB_HOST', 'localhost'),
    80             'host' => env('DB_HOST', 'localhost'),
    81 			'database' => env('DB_DATABASE', 'forge'),
    81             'database' => env('DB_DATABASE', 'forge'),
    82 			'username' => env('DB_USERNAME', 'forge'),
    82             'username' => env('DB_USERNAME', 'forge'),
    83 			'password' => env('DB_PASSWORD', ''),
    83             'password' => env('DB_PASSWORD', ''),
    84 			'prefix'   => '',
    84             'prefix' => '',
    85 		],
    85         ],
    86 
    86 
    87 	],
    87     ],
    88 
    88 
    89 	/*
    89     /*
    90 	|--------------------------------------------------------------------------
    90     |--------------------------------------------------------------------------
    91 	| Migration Repository Table
    91     | Migration Repository Table
    92 	|--------------------------------------------------------------------------
    92     |--------------------------------------------------------------------------
    93 	|
    93     |
    94 	| This table keeps track of all the migrations that have already run for
    94     | This table keeps track of all the migrations that have already run for
    95 	| your application. Using this information, we can determine which of
    95     | your application. Using this information, we can determine which of
    96 	| the migrations on disk haven't actually been run in the database.
    96     | the migrations on disk haven't actually been run in the database.
    97 	|
    97     |
    98 	*/
    98     */
    99 
    99 
   100 	'migrations' => 'migrations',
   100     'migrations' => 'migrations',
   101 
   101 
   102 	/*
   102     /*
   103 	|--------------------------------------------------------------------------
   103     |--------------------------------------------------------------------------
   104 	| Redis Databases
   104     | Redis Databases
   105 	|--------------------------------------------------------------------------
   105     |--------------------------------------------------------------------------
   106 	|
   106     |
   107 	| Redis is an open source, fast, and advanced key-value store that also
   107     | Redis is an open source, fast, and advanced key-value store that also
   108 	| provides a richer set of commands than a typical key-value systems
   108     | provides a richer set of commands than a typical key-value systems
   109 	| such as APC or Memcached. Laravel makes it easy to dig right in.
   109     | such as APC or Memcached. Laravel makes it easy to dig right in.
   110 	|
   110     |
   111 	*/
   111     */
   112 
   112 
   113 	'redis' => [
   113     'redis' => [
   114 
   114 
   115 		'cluster' => false,
   115         'cluster' => false,
   116 
   116 
   117 		'default' => [
   117         'default' => [
   118 			'host'     => '127.0.0.1',
   118             'host' => '127.0.0.1',
   119 			'port'     => 6379,
   119             'port' => 6379,
   120 			'database' => 0,
   120             'database' => 0,
   121 		],
   121         ],
   122 
   122 
   123 	],
   123     ],
   124 
   124 
   125 ];
   125 ];