Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpKernel] Deprecated commands auto-registration#23805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
GuilhemN wants to merge4 commits intosymfony:3.4fromGuilhemN:implicitcommands

Conversation

@GuilhemN
Copy link
Contributor

QA
Branch?3.4
Bug fix?no
New feature?no
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets#23488
LicenseMIT
Doc PR

Deprecates commands auto-registration. See#23488 for arguments.

@GuilhemN
Copy link
ContributorAuthor

Looks like we need to update the DoctrineBundle first.

HttpKernel
----------

* Relying on commands auto-discovery has been deprecated and won't be supported
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

should we putconvention-based?

sstok reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

is it better like that? :)

HttpKernel
----------

* Relying on commands auto-discovery has been deprecated and won't be supported
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

is not supported anymore

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

indeed

# explicit commands registration
AppBundle\Command:
resource: '../../src/AppBundle/Command/*'
tags: ['console.command']
Copy link
Contributor

@ogizanagiogizanagiAug 6, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not required when using auto configuration. Given thedefault config that'll be promoted, should we really add this before/after at all? Or at least mention it's not required when using the new default config?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is for people upgrading from the standard edition < 3.3, the others won't get a deprecation so I don't think they will even notice the change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Fair point 👍

}
$r =new \ReflectionClass($class);
if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract() && !$r->getConstructor()->getNumberOfRequiredParameters()) {
@trigger_error(sprintf('Auto-registration of the command "%s" is deprecated since Symfony 3.4 and won\'t be supported in 4.0. Use PSR-4 based Service Discovery instead.',$class),E_USER_DEPRECATED);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

is using PSR4 registration enough? that won't remove that notice, isn't it? people need also to override the registerCommands method in their bundle?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

No need as long as they register all their commands as services.

Copy link
Member

@chalasrchalasrAug 8, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

enough indeed, registering the command as a service makes convention based skipped thanks to theconsole.command.ids parameter

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think "Service Discovery" should be written with capital letters as it doesn't reference a fixed term or feature name.

services:
# ...
# implicit commands registration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

maybe add "implicit registration of all commands in theCommand folder" for clarity

----------

* Relying on convention-based commands discovery has been deprecated and
won't be supported in 4.0. Use PSR-4 based service siscovery instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Typo :) (discovery)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Oops indeed :)


# to be removed once https://github.com/doctrine/DoctrineBundle/pull/684 is merged
services:
Doctrine\Bundle\DoctrineBundle\Command\:
Copy link
ContributorAuthor

@GuilhemNGuilhemNAug 9, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is temporary :) This way this PR is mergeable.

services:
# ...
# implicit commands registration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

this should be updated as in the upgrade 4.0 file

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

done

Tobion added a commit that referenced this pull requestAug 9, 2017
…ilhemN)This PR was squashed before being merged into the 3.4 branch (closes#23805).Discussion----------[HttpKernel] Deprecated commands auto-registration| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | no| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->| BC breaks?    | no| Deprecations? | yes <!-- don't forget updating UPGRADE-*.md files -->| Tests pass?   | yes| Fixed tickets |#23488| License       | MIT| Doc PR        |Deprecates commands auto-registration. See#23488 for arguments.Commits-------14215d8 [HttpKernel] Deprecated commands auto-registration
@Tobion
Copy link
Contributor

Thank you@GuilhemN

chalasr and GuilhemN reacted with hooray emoji

@GuilhemNGuilhemN deleted the implicitcommands branchAugust 9, 2017 17:04
xabbuh added a commit to symfony/symfony-docs that referenced this pull requestSep 3, 2017
…emN)This PR was squashed before being merged into the 3.4 branch (closes#8269).Discussion----------[Console] Commands auto-registration is deprecatedDocumentsymfony/symfony#23805.I wonder, should I updatehttps://github.com/symfony/symfony-docs/blob/17d1c39298e9415886e2c712748d3021ed7865a4/bundles/best_practices.rst L122 (`Command/  Yes`) ? As it is not really mandatory to use the `Command/` directory anymore.Commits-------493ae89 [Console] Commands auto-registration is deprecated
This was referencedOct 18, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@chalasrchalasrchalasr approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+2 more reviewers

@ogizanagiogizanagiogizanagi approved these changes

@TobionTobionTobion approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

6 participants

@GuilhemN@Tobion@nicolas-grekas@ogizanagi@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp