@@ -60,85 +60,6 @@ code::
60
60
$loader->registerPrefixFallback('/path/to/Icu/Resources/stubs');
61
61
}
62
62
63
- .. sidebar :: ICU and Deployment Problems
64
-
65
- .. note ::
66
-
67
- These deployment problems only affect the following Symfony versions:
68
- 2.3.0 to 2.3.20 versions, any 2.4.x version and 2.5.0 to 2.5.5 versions.
69
-
70
- The intl extension internally uses the `ICU library `_ to obtain localization
71
- data such as number formats in different languages, country names and more.
72
- To make this data accessible to userland PHP libraries, Symfony ships a copy
73
- in the `Icu component `_.
74
-
75
- Depending on the ICU version compiled with your intl extension, a matching
76
- version of that component needs to be installed. It sounds complicated,
77
- but usually Composer does this for you automatically:
78
-
79
- * 1.0.*: when the intl extension is not available
80
- * 1.1.*: when intl is compiled with ICU 3.8 or higher
81
- * 1.2.*: when intl is compiled with ICU 4.4 or higher
82
-
83
- These versions are important when you deploy your application to a **server with
84
- a lower ICU version ** than your development machines, because deployment will
85
- fail if:
86
-
87
- * the development machines are compiled with ICU 4.4 or higher, but the
88
- server is compiled with a lower ICU version than 4.4;
89
- * the intl extension is available on the development machines but not on
90
- the server.
91
-
92
- For example, consider that your development machines ship ICU 4.8 and the server
93
- ICU 4.2. When you run ``composer update `` on the development machine, version
94
- 1.2.* of the Icu component will be installed. But after deploying the
95
- application, ``composer install `` will fail with the following error:
96
-
97
- .. code-block :: bash
98
-
99
- $ composer install
100
- Loading composer repositories with package information
101
- Installing dependencies from lock file
102
- Your requirements could not be resolved to an installable set of packages.
103
-
104
- Problem 1
105
- - symfony/icu 1.2.x requires lib-icu > =4.4 -> the requested linked
106
- library icu has the wrong version installed or is missing from your
107
- system, make sure to have the extension providing it.
108
-
109
- The error tells you that the requested version of the Icu component, version
110
- 1.2, is not compatible with PHP's ICU version 4.2.
111
-
112
- One solution to this problem is to run ``composer update `` instead of
113
- ``composer install ``. It is highly recommended **not ** to do this. The
114
- ``update `` command will install the latest versions of each Composer dependency
115
- to your production server and potentially break the application.
116
-
117
- A better solution is to fix your composer.json to the version required by the
118
- production server. First, determine the ICU version on the server:
119
-
120
- .. code-block :: bash
121
-
122
- $ php -i | grep ICU
123
- ICU version => 4.2.1
124
-
125
- Then fix the Icu component in your ``composer.json `` file to a matching version:
126
-
127
- .. code-block :: json
128
-
129
- "require: {
130
- "symfony/icu" : " 1.1.*"
131
- }
132
-
133
- Set the version to
134
-
135
- * "1.0.*" if the server does not have the intl extension installed;
136
- * "1.1.*" if the server is compiled with ICU 4.2 or lower.
137
-
138
- Finally, run ``composer update symfony/icu `` on your development machine, test
139
- extensively and deploy again. The installation of the dependencies will now
140
- succeed.
141
-
142
63
Writing and Reading Resource Bundles
143
64
------------------------------------
144
65
0 commit comments