8000 Merge branch '3.4' into 4.1 · symfony/symfony@01808ca · GitHub
[go: up one dir, main page]

Skip to content

Commit 01808ca

Browse files
committed
8000
Merge branch '3.4' into 4.1
* 3.4: [FWBundle] Uniformize errors when a component is missing Fixes 28816 Translation commands should not talk about the old app/ directory since 3.4
2 parents d010eb3 + fdc9e09 commit 01808ca

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected function configure()
6969
$this
7070
->setDefinition(array(
7171
new InputArgument('locale', InputArgument::REQUIRED, 'The locale'),
72-
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages, defaults to app/Resources folder'),
72+
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages'),
7373
new InputOption('domain', null, InputOption::VALUE_OPTIONAL, 'The messages domain'),
7474
new InputOption('only-missing', null, InputOption::VALUE_NONE, 'Displays only missing messages'),
7575
new InputOption('only-unused', null, InputOption::VALUE_NONE, 'Displays only unused messages'),
@@ -79,7 +79,7 @@ protected function configure()
7979
->setHelp(<<<'EOF'
8080
The <info>%command.name%</info> command helps finding unused or missing translation
8181
messages and comparing them with the fallback ones by inspecting the
82-
templates and translation files of a given bundle or the app folder.
82+
templates and translation files of a given bundle or the default translations directory.
8383
8484
You can display information about bundle translations in a specific locale:
8585
@@ -97,7 +97,7 @@ protected function configure()
9797
9898
<info>php %command.full_name% --only-unused en AcmeDemoBundle</info>
9999
100-
You can display information about app translations in a specific locale:
100+
You can display information about application translations in a specific locale:
101101
102102
<info>php %command.full_name% en</info>
103103

src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function configure()
6565
$this
6666
->setDefinition(array(
6767
new InputArgument('locale', InputArgument::REQUIRED, 'The locale'),
68-
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages, defaults to app/Resources folder'),
68+
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages'),
6969
new InputOption('prefix', null, InputOption::VALUE_OPTIONAL, 'Override the default prefix', '__'),
7070
new InputOption('output-format', null, InputOption::VALUE_OPTIONAL, 'Override the default output format', 'yml'),
7171
new InputOption('dump-messages', null, InputOption::VALUE_NONE, 'Should the messages be dumped in the console'),
@@ -77,7 +77,7 @@ protected function configure()
7777
->setDescription('Updates the translation file')
7878
->setHelp(<<<'EOF'
7979
The <info>%command.name%</info> command extracts translation strings from templates
80-
of a given bundle or the app folder. It can display them or merge the new ones into the translation files.
80+
of a given bundle or the default translations directory. It can display them or merge the new ones into the translation files.
8181
8282
When new translation strings are found it can automatically add a prefix to the translation
8383
message.
@@ -86,7 +86,7 @@ protected function configure()
8686
<info>php %command.full_name% --dump-messages en AcmeBundle</info>
8787
<info>php %command.full_name% --force --prefix="new_" fr AcmeBundle</info>
8888
89-
Example running against app messages (app/Resources folder)
89+
Example running against default messages directory
9090
<info>php %command.full_name% --dump-messages en</info>
9191
<info>php %command.full_name% --force --prefix="new_" fr</info>
9292
EOF
@@ -128,7 +128,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
128128
if ($this->defaultViewsPath) {
129129
$viewsPaths[] = $this->defaultViewsPath;
130130
}
131-
$currentName = 'app folder';
131+
$currentName = 'default directory';
132132

133133
// Override with provided Bundle info
134134
if (null !== $input->getArgument('bundle')) {

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function load(array $configs, ContainerBuilder $container)
155155
// translator will be used and everything will still work as expected.
156156
if ($this->isConfigEnabled($container, $config['translator']) || $this->isConfigEnabled($container, $config['form']) || $this->isConfigEnabled($container, $config['validation'])) {
157157
if (!class_exists('Symfony\Component\Translation\Translator') && $this->isConfigEnabled($container, $config['translator'])) {
158-
throw new LogicException('Translation support cannot be enabled as the Translation component is not installed.');
158+
throw new LogicException('Translation support cannot be enabled as the Translation component is not installed. Try running "composer require symfony/translation".');
159159
}
160160

161161
if (class_exists(Translator::class)) {
@@ -208,7 +208,7 @@ public function load(array $configs, ContainerBuilder $container)
208208

209209
if ($this->isConfigEnabled($container, $config['form'])) {
210210
if (!class_exists('Symfony\Component\Form\Form')) {
211-
throw new LogicException('Form support cannot be enabled as the Form component is not installed.');
211+
throw new LogicException('Form support cannot be enabled as the Form component is not installed. Try running "composer require symfony/form".');
212212
}
213213

214214
$this->formConfigEnabled = true;
@@ -228,15 +228,15 @@ public function load(array $configs, ContainerBuilder $container)
228228

229229
if ($this->isConfigEnabled($container, $config['assets'])) {
230230
if (!class_exists('Symfony\Component\Asset\Package')) {
231-
throw new LogicException('Asset support cannot be enabled as the Asset component is not installed.');
231+
throw new LogicException('Asset support cannot be enabled as the Asset component is not installed. Try running "composer require symfony/asset".');
232232
}
233233

234234
$this->registerAssetsConfiguration($config['assets'], $container, $loader);
235235
}
236236

237237
if ($this->isConfigEnabled($container, $config['templating'])) {
238238
if (!class_exists('Symfony\Component\Templating\PhpEngine')) {
239-
throw new LogicException('Templating support cannot be enabled as the Templating component is not installed.');
239+
throw new LogicException('Templating support cannot be enabled as the Templating component is not installed. Try running "composer require symfony/templating".');
240240
}
241241

242242
$this->registerTemplatingConfiguration($config['templating'], $container, $loader);
@@ -264,7 +264,7 @@ public function load(array $configs, ContainerBuilder $container)
264264

265265
if ($this->isConfigEnabled($container, $config['serializer'])) {
266266
if (!class_exists('Symfony\Component\Serializer\Serializer')) {
267-
throw new LogicException('Serializer support cannot be enabled as the Serializer component is not installed.');
267+
throw new LogicException('Serializer support cannot be enabled as the Serializer component is not installed. Try running "composer require symfony/serializer-pack".');
268268
}
269269

270270
$this->registerSerializerConfiguration($config['serializer'], $container, $loader);
@@ -280,7 +280,7 @@ public function load(array $configs, ContainerBuilder $container)
280280

281281
if ($this->isConfigEnabled($container, $config['web_link'])) {
282282
if (!class_exists(HttpHeaderSerializer::class)) {
283-
throw new LogicException('WebLink support cannot be enabled as the WebLink component is not installed.');
283+
throw new LogicException('WebLink support cannot be enabled as the WebLink component is not installed. Try running "composer require symfony/weblink".');
284284
}
285285

286286
$loader->load('web_link.xml');
@@ -476,7 +476,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
476476
}
477477

478478
if (!class_exists(Workflow\Workflow::class)) {
479-
throw new LogicException('Workflow support cannot be enabled as the Workflow component is not installed.');
479+
throw new LogicException('Workflow support cannot be enabled as the Workflow component is not installed. Try running "composer require symfony/workflow".');
480480
}
481481

482482
$loader->load('workflow.xml');
@@ -607,11 +607,11 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
607607
}
608608

609609
if (!class_exists(ExpressionLanguage::class)) {
610-
throw new LogicException('Cannot guard workflows as the ExpressionLanguage component is not installed.');
610+
throw new LogicException('Cannot guard workflows as the ExpressionLanguage component is not installed. Try running "composer require symfony/expression-language".');
611611
}
612612

613613
if (!class_exists(Security::class)) {
614-
throw new LogicException('Cannot guard workflows as the Security component is not installed.');
614+
throw new LogicException('Cannot guard workflows as the Security component is not installed. Try running "composer require symfony/security".');
615615
}
616616

617617
$eventName = sprintf('workflow.%s.guard.%s', $name, $transitionName);
@@ -1043,7 +1043,7 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
10431043
}
10441044

10451045
if (!class_exists('Symfony\Component\Validator\Validation')) {
1046-
throw new LogicException('Validation support cannot be enabled as the Validator component is not installed.');
1046+
throw new LogicException('Validation support cannot be enabled as the Validator component is not installed. Try running "composer require symfony/validator".');
10471047
}
10481048

10491049
if (!isset($config['email_validation_mode'])) {

0 commit comments

Comments
 (0)
0