Skip to content

Commit 5e117b4

Browse files
committed
migration guide for Nette 4.0 [WIP]
1 parent 57407f6 commit 5e117b4

File tree

6 files changed

+124
-0
lines changed

6 files changed

+124
-0
lines changed

migrations/cs/@home.texy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Přechod na novější verze
22
************************
33

4+
- [z Nette 3.1 na 4.0 |to-4-0]
45
- [z Nette 3.0 na 3.1 |to-3-1]
56
- [z Nette 2.4 na 3.0 |to-3-0]
67
- [z Nette 2.3 na 2.4 |to-2-4]

migrations/cs/@left-menu.texy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Přechod na novější verze
22
************************
33
- [Úvod |@home]
4+
- [Z verze 3.1 na 4.0 |to-4-0]
45
- [Z verze 3.0 na 3.1 |to-3-1]
56
- [Z verze 2.4 na 3.0 |to-3-0]
67
- [Z verze 2.3 na 2.4 |to-2-4]

migrations/cs/to-4-0.texy

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Přechod na verzi 4.0
2+
********************
3+
4+
.[note]
5+
Tato stránka vzniká postupně s tím, jak se uvolňují jednotlivé balíčky.
6+
7+
Minimální požadovaná verze PHP je 8.0
8+
9+
Všechny změny názvů uvedené v tomto dokumentu znamenají, že původní název samozřejmě nadále existuje a funguje, jen je označený jako deprecated. Můžete se setkat s tím, že vám je bude IDE vizuálně označovat jako deprecated.
10+
11+
/--comment
12+
Verzí Nette 4.0 se rozumí, že máte tyto balíčky nainstalované ve verze 4.0.*. Ostatní balíčky mohou mít vyšší nebo nižší čísla verzí, kompatibilitu hlídá Composer.
13+
14+
```json
15+
"require": {
16+
"nette/application": "4.0.*",
17+
"nette/bootstrap": "3.2.*",
18+
"nette/caching": "3.2.*",
19+
"nette/database": "4.0.*",
20+
"nette/forms": "4.0.*",
21+
"nette/http": "4.0.*",
22+
"nette/security": "4.0.*",
23+
},
24+
```
25+
\--
26+
27+
28+
Utils 4.0
29+
---------
30+
31+
Třída `Nette\Utils\Reflection` [poskytovala metody |utils:reflection#getparametertype] pro práci s typy `getParameterType()`, `getPropertyType()` a `getReturnType()`. Metody vznikly v době, kdy PHP nemělo union, intersection nebo nejnovější disjunctive normal form typy, se kterými už nefungují a nahradila je [třída Type |utils:type]. Od verze 4.0 jsou tyto metody odstraněné.
32+
33+
Metoda `Nette\Utils\Reflection::getParameterDefaultValue()` je deprecated, protože nativní `ReflectionParameter::getDefaultValue()` už funguje správně.
34+
35+
Zrušená je proměnná `Nette\Utils\Html::$xhtml`.
36+
37+
Pro instalaci Nette Utils 4.0 je potřeba aktualizovat i RobotLoader na verzi 4, pokud jej používáte, a odstranit balíček `nette/finder`:
38+
39+
```shell
40+
composer remove nette/finder
41+
composer require "nette/utils:^4.0" "nette/robot-loader:^4.0"
42+
```
43+
44+
45+
Finder 4.0
46+
----------
47+
48+
Finder se přestěhoval do balíčku `nette/utils`, viz [#Utils 4.0].
49+
50+
Na Linuxu se nově chová v režimu case-sensitive.
51+
52+
V předchozí verzi platilo, že metody `exclude()` a `filter()` fungovaly jinak, když byly zavolány **před** `from()` resp. `in()` a **po** ní. Tohle už neplatí, `exclude()` a `filter()` fungují vždy stejně. Dřívější `filter()` volaný *až po* nahradila nová metoda `descentFilter()`.
53+
54+
Finder již neimplementuje rozhraní Countable.
55+
56+
Řetězec začínající lomítkem ve `Finder::findFiles('/f*')` se nově považuje za absolutní cestu, je potřeba ho nahradit např. za `Finder::findFiles('./f*')`.
57+
58+
59+
60+
61+
{{priority: -5}}

migrations/en/@home.texy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Upgrade Guide
22
*************
33

4+
- [from Nette 3.1 to 4.0 |to-4-0]
45
- [from Nette 3.0 to 3.1 |to-3-1]
56
- [from Nette 2.4 to 3.0 |to-3-0]
67
- [from Nette 2.3 to 2.4 |to-2-4]

migrations/en/@left-menu.texy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Upgrade Guide
22
*************
33
- [Overview |@home]
4+
- [From 3.1 to 4.0 |to-4-0]
45
- [From 3.0 to 3.1 |to-3-1]
56
- [From 2.4 to 3.0 |to-3-0]
67
- [From 2.3 to 2.4 |to-2-4]

migrations/en/to-4-0.texy

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
Migrating to Version 4.0
2+
************************
3+
4+
.[note]
5+
This page is being built incrementally as packages are released.
6+
7+
Minimum required PHP version is 8.0
8+
9+
All name changes mentioned in this document mean that the original name obviously still exists and works, it is just marked as deprecated. You may encounter the IDE visually marking them as deprecated.
10+
11+
/--comment
12+
Verzí Nette 4.0 se rozumí, že máte tyto balíčky nainstalované ve verze 4.0.*. Ostatní balíčky mohou mít vyšší nebo nižší čísla verzí, kompatibilitu hlídá Composer.
13+
14+
```json
15+
"require": {
16+
"nette/application": "4.0.*",
17+
"nette/bootstrap": "3.2.*",
18+
"nette/caching": "3.2.*",
19+
"nette/database": "4.0.*",
20+
"nette/forms": "4.0.*",
21+
"nette/http": "4.0.*",
22+
"nette/security": "4.0.*",
23+
},
24+
```
25+
\--
26+
27+
28+
Utils 4.0
29+
---------
30+
31+
The `Nette\Utils\Reflection` class [provided methods |utils:reflection#getparametertype] `getParameterType()`, `getPropertyType()` and `getReturnType()` for working with the types. These methods were created when PHP didn't have union, intersection or the newest disjunctive normal form types, which they no longer work with and were replaced by the [Type class |utils:type]. As of version 4.0, these methods have been removed.
32+
33+
The method `Nette\Utils\Reflection::getParameterDefaultValue()` is deprecated because the native `ReflectionParameter::getDefaultValue()` already works correctly.
34+
35+
The `Nette\Utils\Html::$xhtml` variable is removed.
36+
37+
To install Nette Utils 4.0 you need to update RobotLoader to version 4 if you are using it, and remove the `nette/finder` package:
38+
39+
```shell
40+
composer remove nette/finder
41+
composer require "nette/utils:^4.0" "nette/robot-loader:^4.0"
42+
```
43+
44+
45+
Finder 4.0
46+
----------
47+
48+
Finder has moved to the package `nette/utils`, see [Utils 4.0 |#Utils 4.0].
49+
50+
On Linux, it now behaves in case-sensitive mode.
51+
52+
In the previous version, the `exclude()` and `filter()` methods worked differently when called **before** `from()` and `in()` respectively, and **after** it. This is no longer the case, `exclude()` and `filter()` always work the same. The former `filter()` called *before* has been replaced by the new `descentFilter()` method.
53+
54+
The Finder no longer implements the Countable interface.
55+
56+
A string starting with a slash in `Finder::findFiles('/f*')` is now considered an absolute path, it should be replaced with e.g. `Finder::findFiles('./f*')`.
57+
58+
59+
{{priority: -5}}

0 commit comments

Comments
 (0)