You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (is_dir($dir = $rootDir.'/Resources/translations')) {
136
+
if ($dir !== $this->defaultTransPath) {
137
+
$notice = sprintf('Storing translations in the "%s" directory is deprecated since Symfony 4.2. ', $dir);
138
+
@trigger_error($notice.($this->defaultTransPath ? sprintf('Use the "%s" directory instead.', $this->defaultTransPath) : 'Configure and use "translator.default_path" instead.'), E_USER_DEPRECATED);
139
+
}
140
+
$transPaths[] = $dir;
141
+
}
135
142
if ($this->defaultTransPath) {
136
143
$transPaths[] = $this->defaultTransPath;
137
144
}
138
-
$viewsPaths = array($rootDir.'/Resources/views');
145
+
$viewsPaths = array();
146
+
if (is_dir($dir = $rootDir.'/Resources/views')) {
147
+
if ($dir !== $this->defaultViewsPath) {
148
+
$notice = sprintf('Storing templates in the "%s" directory is deprecated since Symfony 4.2. ', $dir);
149
+
@trigger_error($notice.($this->defaultViewsPath ? sprintf('Use the "%s" directory instead.', $this->defaultViewsPath) : 'Configure and use "twig.default_path" instead.'), E_USER_DEPRECATED);
150
+
}
151
+
$viewsPaths[] = $dir;
152
+
}
139
153
if ($this->defaultViewsPath) {
140
154
$viewsPaths[] = $this->defaultViewsPath;
141
155
}
@@ -146,20 +160,43 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (is_dir($dir = sprintf('%s/Resources/%s/translations', $rootDir, $bundle->getName()))) {
166
+
$transPaths[] = $dir;
167
+
$notice = sprintf('Storing translations files for "%s" in the "%s" directory is deprecated since Symfony 4.2. ', $dir, $bundle->getName());
168
+
@trigger_error($notice.($this->defaultTransPath ? sprintf('Use the "%s" directory instead.', $this->defaultTransPath.'/bundles/'.$bundle->getName()) : sprintf('Configure "translator.default_path" and create a "bundles/%s/" directory into it instead.', $bundle->getName())), E_USER_DEPRECATED);
if (is_dir($dir = sprintf('%s/Resources/%s/views', $rootDir, $bundle->getName()))) {
175
+
$viewsPaths[] = $dir;
176
+
$notice = sprintf('Storing templates for "%s" in the "%s" directory is deprecated since Symfony 4.2. ', $bundle->getName(), $dir);
177
+
@trigger_error($notice.($this->defaultViewsPath ? sprintf('Use the "%s" directory instead.', $this->defaultViewsPath.'/bundles/'.$bundle->getName()) : sprintf('Configure "twig.default_path" and create a "bundles/%s/" directory into it instead.', $bundle->getName())), E_USER_DEPRECATED);
178
+
}
157
179
} catch (\InvalidArgumentException$e) {
158
180
// such a bundle does not exist, so treat the argument as path
if (is_dir($dir = $path.'/Resources/translations')) {
185
+
if ($dir !== $this->defaultTransPath) {
186
+
@trigger_error(sprintf('Storing translations in the "%s" directory is deprecated since Symfony 4.2. Use the "%s" directory instead.', $dir, $path.'/translations'), E_USER_DEPRECATED);
187
+
}
188
+
$transPaths[] = $dir;
189
+
}
190
+
191
+
$viewsPaths = array($path.'/templates');
192
+
if (is_dir($dir = $path.'/Resources/views')) {
193
+
if ($dir !== $this->defaultViewsPath) {
194
+
@trigger_error(sprintf('Storing templates in the "%s" directory is deprecated since Symfony 4.2. Use the "%s" directory instead.', $dir, $path.'/templates'), E_USER_DEPRECATED);
195
+
}
196
+
$viewsPaths[] = $dir;
197
+
}
198
+
199
+
if (!is_dir($transPaths[0]) && !isset($transPaths[1])) {
163
200
thrownewInvalidArgumentException(sprintf('"%s" is neither an enabled bundle nor a directory.', $transPaths[0]));
164
201
}
165
202
}
@@ -169,12 +206,20 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (is_dir($deprecatedPath = sprintf('%s/Resources/%s/translations', $rootDir, $bundle->getName()))) {
210
+
$transPaths[] = $deprecatedPath;
211
+
$notice = sprintf('Storing translations files for "%s" in the "%s" directory is deprecated since Symfony 4.2. ', $bundle->getName(), $deprecatedPath);
212
+
@trigger_error($notice.($this->defaultTransPath ? sprintf('Use the "%s" directory instead.', $this->defaultTransPath.'/bundles/'.$bundle->getName()) : 'Configure "translator.default_path" and create a "%s/" directory into it instead.'), E_USER_DEPRECATED);
if (is_dir($deprecatedPath = sprintf('%s/Resources/%s/views', $rootDir, $bundle->getName()))) {
219
+
$viewsPaths[] = $deprecatedPath;
220
+
$notice = sprintf('Storing templates for "%s" in the "%s" directory is deprecated since Symfony 4.2. ', $bundle->getName(), $deprecatedPath);
221
+
@trigger_error($notice.($this->defaultViewsPath ? sprintf('Use the "%s" directory instead.', $this->defaultViewsPath.'/bundles/'.$bundle->getName()) : sprintf('Configure "twig.default_path" and create a "bundles/%s/" directory into it instead.', $bundle->getName())), E_USER_DEPRECATED);
if (is_dir($dir = $rootDir.'/Resources/translations')) {
126
+
if ($dir !== $this->defaultTransPath) {
127
+
$notice = sprintf('Storing translations in the "%s" directory is deprecated since Symfony 4.2. ', $dir);
128
+
@trigger_error($notice.($this->defaultTransPath ? sprintf('Use the "%s" directory instead.', $this->defaultTransPath) : 'Configure and use "translator.default_path" instead.'), E_USER_DEPRECATED);
129
+
}
130
+
$transPaths[] = $dir;
131
+
}
125
132
if ($this->defaultTransPath) {
126
133
$transPaths[] = $this->defaultTransPath;
127
134
}
128
-
$viewsPaths = array($rootDir.'/Resources/views');
135
+
$viewsPaths = array();
136
+
if (is_dir($dir = $rootDir.'/Resources/views')) {
137
+
if ($dir !== $this->defaultViewsPath) {
138
+
$notice = sprintf('Storing templates in the "%s" directory is deprecated since Symfony 4.2. ', $dir);
139
+
@trigger_error($notice.($this->defaultViewsPath ? sprintf('Use the "%s" directory instead.', $this->defaultViewsPath) : 'Configure and use "twig.default_path" instead.'), E_USER_DEPRECATED);
140
+
}
141
+
$viewsPaths[] = $dir;
142
+
}
129
143
if ($this->defaultViewsPath) {
130
144
$viewsPaths[] = $this->defaultViewsPath;
131
145
}
@@ -139,20 +153,42 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (is_dir($dir = sprintf('%s/Resources/%s/translations', $rootDir, $foundBundle->getName()))) {
157
+
$transPaths[] = $dir;
158
+
$notice = sprintf('Storing translations files for "%s" in the "%s" directory is deprecated since Symfony 4.2. ', $foundBundle->getName(), $dir);
159
+
@trigger_error($notice.($this->defaultTransPath ? sprintf('Use the "%s" directory instead.', $this->defaultTransPath.'/bundles/'.$foundBundle->getName()) : 'Configure "translator.default_path" and create a "bundles/%s/" directory into it instead.'), E_USER_DEPRECATED);
if (is_dir($dir = sprintf('%s/Resources/%s/views', $rootDir, $foundBundle->getName()))) {
166
+
$viewsPaths[] = $dir;
167
+
$notice = sprintf('Storing templates for "%s" in the "%s" directory is deprecated since Symfony 4.2. ', $foundBundle->getName(), $dir);
168
+
@trigger_error($notice.($this->defaultViewsPath ? sprintf('Use the "%s" directory instead.', $this->defaultViewsPath.'/bundles/'.$foundBundle->getName()) : sprintf('Configure "twig.default_path" and create a "bundles/%s/" directory into it instead.', $foundBundle->getName())), E_USER_DEPRECATED);
169
+
}
148
170
$currentName = $foundBundle->getName();
149
171
} catch (\InvalidArgumentException$e) {
150
172
// such a bundle does not exist, so treat the argument as path
if (is_dir($dir = $path.'/Resources/translations')) {
177
+
if ($dir !== $this->defaultTransPath) {
178
+
@trigger_error(sprintf('Storing translations in the "%s" directory is deprecated since Symfony 4.2. Use the "%s" directory instead.', $dir, $path.'/translations'), E_USER_DEPRECATED);
179
+
}
180
+
$transPaths[] = $dir;
181
+
}
182
+
183
+
$viewsPaths = array($path.'/templates');
184
+
if (is_dir($dir = $path.'/Resources/views')) {
185
+
if ($dir !== $this->defaultViewsPath) {
186
+
@trigger_error(sprintf('Storing templates in the "%s" directory is deprecated since Symfony 4.2. Use the "%s" directory instead.', $dir, $path.'/templates'), E_USER_DEPRECATED);
187
+
}
188
+
$viewsPaths[] = $dir;
189
+
}
154
190
155
-
if (!is_dir($transPaths[0])) {
191
+
if (!is_dir($transPaths[0]) && !isset($transPaths[1])) {
156
192
thrownewInvalidArgumentException(sprintf('<error>"%s" is neither an enabled bundle nor a directory.</error>', $transPaths[0]));
* @expectedDeprecation Storing translations in the "%ssf_translation%s/Resources/translations" directory is deprecated since Symfony 4.2. Use the "%ssf_translation%s/translations" directory instead.
71
+
* @expectedDeprecation Storing templates in the "%ssf_translation%s/Resources/views" directory is deprecated since Symfony 4.2. Use the "%ssf_translation%s/templates" directory instead.
0 commit comments