Skip to content

Commit 2f49c0e

Browse files
committed
cms@31c8d3e
Finish 3.9.14
1 parent b3779b5 commit 2f49c0e

File tree

9 files changed

+519
-380
lines changed

9 files changed

+519
-380
lines changed

docs/.artifacts/cms/3.x/assets.md

-54
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
| Param | Description
1010
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11-
| [addOrderBy](#addorderby) | Adds additional ORDER BY columns to the query.
1211
| [afterPopulate](#afterpopulate) | Performs any post-population processing on elements.
1312
| [andRelatedTo](#andrelatedto) | Narrows the query results to only assets that are related to certain other elements.
1413
| [anyStatus](#anystatus) | Removes element filters based on their statuses.
@@ -18,7 +17,6 @@
1817
| [dateCreated](#datecreated) | Narrows the query results based on the assets’ creation dates.
1918
| [dateModified](#datemodified) | Narrows the query results based on the assets’ files’ last-modified dates.
2019
| [dateUpdated](#dateupdated) | Narrows the query results based on the assets’ last-updated dates.
21-
| [fields](#fields) | Returns the list of fields that should be returned by default by [toArray()](https://www.yiiframework.com/doc/api/2.0/yii-base-arrayabletrait#toArray()-detail) when no specific fields are specified.
2220
| [filename](#filename) | Narrows the query results based on the assets’ filenames.
2321
| [fixedOrder](#fixedorder) | Causes the query results to be returned in the order specified by [id](#id).
2422
| [folderId](#folderid) | Narrows the query results based on the folders the assets belong to, per the folders’ IDs.
@@ -54,19 +52,6 @@
5452
<!-- textlint-enable -->
5553

5654

57-
#### `addOrderBy`
58-
59-
Adds additional ORDER BY columns to the query.
60-
61-
62-
63-
64-
65-
66-
67-
68-
69-
7055
#### `afterPopulate`
7156

7257
Performs any post-population processing on elements.
@@ -292,45 +277,6 @@ $assets = \craft\elements\Asset::find()
292277
:::
293278

294279

295-
#### `fields`
296-
297-
Returns the list of fields that should be returned by default by [toArray()](https://www.yiiframework.com/doc/api/2.0/yii-base-arrayabletrait#toArray()-detail) when no specific fields are specified.
298-
299-
A field is a named element in the returned array by [toArray()](https://www.yiiframework.com/doc/api/2.0/yii-base-arrayabletrait#toArray()-detail).
300-
This method should return an array of field names or field definitions.
301-
If the former, the field name will be treated as an object property name whose value will be used
302-
as the field value. If the latter, the array key should be the field name while the array value should be
303-
the corresponding field definition which can be either an object property name or a PHP callable
304-
returning the corresponding field value. The signature of the callable should be:
305-
306-
```php
307-
function ($model, $field) {
308-
// return field value
309-
}
310-
```
311-
312-
For example, the following code declares four fields:
313-
314-
- `email`: the field name is the same as the property name `email`;
315-
- `firstName` and `lastName`: the field names are `firstName` and `lastName`, and their
316-
values are obtained from the `first_name` and `last_name` properties;
317-
- `fullName`: the field name is `fullName`. Its value is obtained by concatenating `first_name`
318-
and `last_name`.
319-
320-
```php
321-
return [
322-
'email',
323-
'firstName' => 'first_name',
324-
'lastName' => 'last_name',
325-
'fullName' => function ($model) {
326-
return $model->first_name . ' ' . $model->last_name;
327-
},
328-
];
329-
```
330-
331-
332-
333-
334280
#### `filename`
335281

336282
Narrows the query results based on the assets’ filenames.

docs/.artifacts/cms/3.x/categories.md

-54
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
| Param | Description
1010
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11-
| [addOrderBy](#addorderby) | Adds additional ORDER BY columns to the query.
1211
| [afterPopulate](#afterpopulate) | Performs any post-population processing on elements.
1312
| [ancestorDist](#ancestordist) | Narrows the query results to only categories that are up to a certain distance away from the category specified by [ancestorOf](#ancestorof).
1413
| [ancestorOf](#ancestorof) | Narrows the query results to only categories that are ancestors of another category in its structure.
@@ -21,7 +20,6 @@
2120
| [dateUpdated](#dateupdated) | Narrows the query results based on the categories’ last-updated dates.
2221
| [descendantDist](#descendantdist) | Narrows the query results to only categories that are up to a certain distance away from the category specified by [descendantOf](#descendantof).
2322
| [descendantOf](#descendantof) | Narrows the query results to only categories that are descendants of another category in its structure.
24-
| [fields](#fields) | Returns the list of fields that should be returned by default by [toArray()](https://www.yiiframework.com/doc/api/2.0/yii-base-arrayabletrait#toArray()-detail) when no specific fields are specified.
2523
| [fixedOrder](#fixedorder) | Causes the query results to be returned in the order specified by [id](#id).
2624
| [group](#group) | Narrows the query results based on the category groups the categories belong to.
2725
| [groupId](#groupid) | Narrows the query results based on the category groups the categories belong to, per the groups’ IDs.
@@ -58,19 +56,6 @@
5856
<!-- textlint-enable -->
5957

6058

61-
#### `addOrderBy`
62-
63-
Adds additional ORDER BY columns to the query.
64-
65-
66-
67-
68-
69-
70-
71-
72-
73-
7459
#### `afterPopulate`
7560

7661
Performs any post-population processing on elements.
@@ -391,45 +376,6 @@ This can be combined with [descendantDist](#descendantdist) if you want to limit
391376
:::
392377

393378

394-
#### `fields`
395-
396-
Returns the list of fields that should be returned by default by [toArray()](https://www.yiiframework.com/doc/api/2.0/yii-base-arrayabletrait#toArray()-detail) when no specific fields are specified.
397-
398-
A field is a named element in the returned array by [toArray()](https://www.yiiframework.com/doc/api/2.0/yii-base-arrayabletrait#toArray()-detail).
399-
This method should return an array of field names or field definitions.
400-
If the former, the field name will be treated as an object property name whose value will be used
401-
as the field value. If the latter, the array key should be the field name while the array value should be
402-
the corresponding field definition which can be either an object property name or a PHP callable
403-
returning the corresponding field value. The signature of the callable should be:
404-
405-
```php
406-
function ($model, $field) {
407-
// return field value
408-
}
409-
```
410-
411-
For example, the following code declares four fields:
412-
413-
- `email`: the field name is the same as the property name `email`;
414-
- `firstName` and `lastName`: the field names are `firstName` and `lastName`, and their
415-
values are obtained from the `first_name` and `last_name` properties;
416-
- `fullName`: the field name is `fullName`. Its value is obtained by concatenating `first_name`
417-
and `last_name`.
418-
419-
```php
420-
return [
421-
'email',
422-
'firstName' => 'first_name',
423-
'lastName' => 'last_name',
424-
'fullName' => function ($model) {
425-
return $model->first_name . ' ' . $model->last_name;
426-
},
427-
];
428-
```
429-
430-
431-
432-
433379
#### `fixedOrder`
434380

435381
Causes the query results to be returned in the order specified by [id](#id).

docs/.artifacts/cms/3.x/config-db.md

+58
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ Defined by
1919

2020
An array of key => value pairs of PDO attributes to pass into the PDO constructor.
2121

22+
For example, when using the [MySQL PDO driver](https://php.net/manual/en/ref.pdo-mysql.php), if you wanted to enable a SSL database connection
23+
(assuming [SSL is enabled in MySQL](https://dev.mysql.com/doc/mysql-secure-deployment-guide/5.7/en/secure-deployment-secure-connections.html) and `'user'` can connect via SSL,
24+
you’d set these:
25+
26+
```php
27+
[
28+
PDO::MYSQL_ATTR_SSL_KEY => '/path/to/my/client-key.pem',
29+
PDO::MYSQL_ATTR_SSL_CERT => '/path/to/my/client-cert.pem',
30+
PDO::MYSQL_ATTR_SSL_CA => '/path/to/my/ca-cert.pem',
31+
],
32+
```
33+
2234

2335

2436
### `charset`
@@ -38,6 +50,14 @@ Defined by
3850

3951
The charset to use when creating tables.
4052

53+
::: tip
54+
You can change the character set and collation across all existing database tables using this terminal command:
55+
56+
```bash
57+
> php craft db/convert-charset
58+
```
59+
:::
60+
4161

4262

4363
### `collation`
@@ -60,6 +80,21 @@ Since
6080

6181
The collation to use when creating tables.
6282

83+
This is only used by MySQL. If null, the [charset’s](https://docs.craftcms.com/api/v3/craft-config-dbconfig.html#property-charset) default collation will be used.
84+
85+
| Charset | Default collation |
86+
| --------- | -------------------- |
87+
| `utf8` | `utf8_general_ci` |
88+
| `utf8mb4` | `utf8mb4_0900_ai_ci` |
89+
90+
::: tip
91+
You can change the character set and collation across all existing database tables using this terminal command:
92+
93+
```bash
94+
> php craft db/convert-charset
95+
```
96+
:::
97+
6398

6499

65100
### `database`
@@ -117,6 +152,12 @@ Defined by
117152

118153
The Data Source Name (“DSN”) that tells Craft how to connect to the database.
119154

155+
DSNs should begin with a driver prefix (`mysql:` or `pgsql:`), followed by driver-specific parameters.
156+
For example, `mysql:host=127.0.0.1;port=3306;dbname=acme_corp`.
157+
158+
- MySQL parameters: <https://php.net/manual/en/ref.pdo-mysql.connection.php>
159+
- PostgreSQL parameters: <https://php.net/manual/en/ref.pdo-pgsql.connection.php>
160+
120161

121162

122163
### `password`
@@ -174,6 +215,11 @@ Defined by
174215

175216
The schema that Postgres is configured to use by default (PostgreSQL only).
176217

218+
::: tip
219+
To force Craft to use the specified schema regardless of PostgreSQL’s `search_path` setting, you must enable
220+
the [setSchemaOnConnect](https://docs.craftcms.com/api/v3/craft-config-dbconfig.html#property-setschemaonconnect) setting.
221+
:::
222+
177223

178224

179225
### `server`
@@ -215,6 +261,11 @@ Since
215261

216262
Whether the [schema](https://docs.craftcms.com/api/v3/craft-config-dbconfig.html#property-schema) should be explicitly used for database queries (PostgreSQL only).
217263

264+
::: warning
265+
This will cause an extra `SET search_path` SQL query to be executed per database connection. Ideally,
266+
PostgreSQL’s `search_path` setting should be configured to prioritize the desired schema.
267+
:::
268+
218269

219270

220271
### `tablePrefix`
@@ -274,6 +325,8 @@ Defined by
274325

275326
The database connection URL, if one was provided by your hosting environment.
276327

328+
If this is set, the values for [driver](https://docs.craftcms.com/api/v3/craft-config-dbconfig.html#property-driver), [user](https://docs.craftcms.com/api/v3/craft-config-dbconfig.html#property-user), [database](https://docs.craftcms.com/api/v3/craft-config-dbconfig.html#property-database), [server](https://docs.craftcms.com/api/v3/craft-config-dbconfig.html#property-server), [port](https://docs.craftcms.com/api/v3/craft-config-dbconfig.html#property-port), and [database](https://docs.craftcms.com/api/v3/craft-config-dbconfig.html#property-database) will be extracted from it.
329+
277330

278331

279332
### `useUnbufferedConnections`
@@ -296,6 +349,11 @@ Since
296349

297350
Whether batched queries should be executed on a separate, unbuffered database connection.
298351

352+
This setting only applies to MySQL. It can be enabled when working with high volume content, to prevent
353+
PHP from running out of memory when querying too much data at once. (See
354+
<https://www.yiiframework.com/doc/guide/2.0/en/db-query-builder#batch-query-mysql> for an explanation
355+
of MySQL’s batch query limitations.)
356+
299357

300358

301359
### `user`

0 commit comments

Comments
 (0)