Skip to content

Commit b92dfd6

Browse files
authored
Docs: clarify migration from removed ORM split extensions (#133)
1 parent 20cfc18 commit b92dfd6

2 files changed

Lines changed: 58 additions & 17 deletions

File tree

.docs/README.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ nettrine.orm:
117117
metadataCache: <class-string|service>
118118
119119
secondLevelCache:
120-
enable: <boolean>
120+
enabled: <boolean>
121121
cache: <class-string|service>
122122
logger: <class-string|service>
123123
regions:
@@ -160,7 +160,7 @@ nettrine.orm:
160160

161161
By default, this extension will try to autoconfigure itself.
162162

163-
- **proxyDir**: `%tempDir%/proxies`, if `%tempDir%` is not defined,, you have to define it manually.
163+
- **proxyDir**: `%tempDir%/cache/doctrine/orm/proxies`, if `%tempDir%` is not defined, you have to define it manually.
164164
- **autoGenerateProxyClasses**: `%debugMode%`, if `%debugMode%` is not defined, you have to define it manually.
165165
- `0` means that the proxy classes must be generated manually.
166166
- `1` means that the proxy classes are generated automatically.
@@ -268,23 +268,23 @@ nettrine.orm:
268268
metadataCache: App\CacheService(%tempDir%/cache/doctrine/orm/metadata)
269269
```
270270

271-
Second level cache is a bit different. Be sure you know what you are doing, lear more in official [Doctrine documentation](https://www.doctrine-project.org/projects/doctrine-orm/en/3.3/reference/second-level-cache.html).
271+
Second level cache is a bit different. Be sure you know what you are doing, learn more in official [Doctrine documentation](https://www.doctrine-project.org/projects/doctrine-orm/en/3.3/reference/second-level-cache.html).
272272

273273
```neon
274274
nettrine.orm:
275275
managers:
276276
default:
277-
secondLevelCache:
278-
enable: true
279-
cache: App\CacheService(%tempDir%/cache/doctrine/orm/slc)
280-
logger: App\LoggerService()
281-
regions:
282-
region1:
283-
lifetime: 3600
284-
lockLifetime: 60
285-
region2:
286-
lifetime: 86000
287-
lockLifetime: 60
277+
secondLevelCache:
278+
enabled: true
279+
cache: App\CacheService(%tempDir%/cache/doctrine/orm/slc)
280+
logger: App\LoggerService()
281+
regions:
282+
region1:
283+
lifetime: 3600
284+
lockLifetime: 60
285+
region2:
286+
lifetime: 86000
287+
lockLifetime: 60
288288
```
289289

290290
If you like [`symfony/cache`](https://github.com/symfony/cache) you can use it as well.
@@ -424,7 +424,8 @@ It's a good practice if you have separated modules in your applications.
424424

425425
namespace App\Model\DI;
426426

427-
use Nette\DI\CompilerExtension;use Nettrine\ORM\DI\Helpers\MappingHelper;
427+
use Nette\DI\CompilerExtension;
428+
use Nettrine\ORM\DI\Helpers\MappingHelper;
428429

429430
class DoctrineMappingExtension extends CompilerExtension
430431
{
@@ -971,7 +972,7 @@ extensions:
971972
### Console
972973

973974
> [!TIP]
974-
> Doctrine DBAL needs Symfony Console to work. You can use `symfony/console` or [contributte/console](https://github.com/contributte/console).
975+
> Doctrine ORM console commands need Symfony Console. You can use `symfony/console` or [contributte/console](https://github.com/contributte/console).
975976
976977
```bash
977978
composer require contributte/console
@@ -984,7 +985,7 @@ extensions:
984985
nettrine.orm: Nettrine\ORM\DI\OrmExtension
985986
```
986987

987-
Since this moment when you type `bin/console`, there'll be registered commands from Doctrine DBAL.
988+
Since this moment when you type `bin/console`, there'll be registered commands from Doctrine ORM.
988989

989990
![Console Commands](https://raw.githubusercontent.com/nettrine/orm/master/.docs/assets/console.png)
990991

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Changelog
2+
3+
All notable changes to `nettrine/orm` are documented in this file.
4+
5+
## Migration notes
6+
7+
### v0.10
8+
9+
- `nettrine/orm` uses only `Nettrine\ORM\DI\OrmExtension`.
10+
- Removed split extensions:
11+
- `nettrine.orm.cache`
12+
- `nettrine.orm.attributes`
13+
- `nettrine.orm.xml`
14+
- `nettrine.orm.annotations`
15+
- `nettrine.orm.console`
16+
- Configure cache, mapping, and managers under `nettrine.orm.managers.<name>`.
17+
18+
```neon
19+
# before (removed)
20+
extensions:
21+
nettrine.orm: Nettrine\ORM\DI\OrmExtension
22+
nettrine.orm.cache: Nettrine\ORM\DI\OrmCacheExtension
23+
24+
nettrine.orm.cache:
25+
defaultDriver: @cache
26+
27+
# now
28+
extensions:
29+
nettrine.orm: Nettrine\ORM\DI\OrmExtension
30+
31+
nettrine.orm:
32+
managers:
33+
default:
34+
connection: default
35+
defaultCache: @cache
36+
mapping:
37+
App:
38+
directories: [%appDir%/Database]
39+
namespace: App\Database
40+
```

0 commit comments

Comments
 (0)