Skip to content

Lots of automated migrations to Symfony Flex structure #8569

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 2, 2017

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Oct 30, 2017

Almost all of these changes need a check if the paragraphs surrounding the code block still make sense, but at least, it is a start.

I skipped the Best Pratices and Create Your Own Framework guides. Both of these need to be completely revisited.

Also, lots of other (configuration, bundles, controller and services) guides need to be checked carefully.

Please review and merge quickly @symfony/team-symfony-docs

@@ -364,8 +364,7 @@ routes with UTF-8 characters:

.. code-block:: php-annotations

// src/AppBundle/Controller/DefaultController.php
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to keep such comments? We can probably automatically just strip the AppBundle directory. The new one would be src/Controller/DefaultController.php in that case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I changed it everywhere, but we're in the components section, we shouldn't talk about framework conventions here. (probably, this needs to be extracted to its own subguide).

Copy link
Member

Choose a reason for hiding this comment

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

ok, makes sense.

@@ -26,7 +26,7 @@ Routing

Routing is never automatically imported in Symfony. If you want to include
the routes from any bundle, then they must be manually imported from somewhere
in your application (e.g. ``app/config/routing.yml``).
in your application (e.g. ``app/config/routes.yaml``).
Copy link
Member

Choose a reason for hiding this comment

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

config/routes.yaml

Copy link
Member Author

Choose a reason for hiding this comment

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

Reverted this change, the whole paragraph needs to be rewritten (and thus done in a non-automatic PR).

console.rst Outdated
@@ -229,9 +227,9 @@ class. It uses special input and output classes to ease testing without a real
console::

// tests/AppBundle/Command/CreateUserCommandTest.php
namespace Tests\AppBundle\Command;
namespace Tests\App\Command;
Copy link
Member

Choose a reason for hiding this comment

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

App\Tests everywhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed (every other occurence of this as well)

@@ -105,23 +105,23 @@ manually and tag it with ``form.type``:

.. code-block:: yaml

# src/AppBundle/Resources/config/services.yml
# src/Resources/config/services.yaml
Copy link
Member

Choose a reason for hiding this comment

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

It should refer to config/services.yaml? same for other formats.

http_cache.rst Outdated
use Symfony\Component\HttpFoundation\Request;

// ...
$kernel = new AppKernel('prod', false);
$kernel = new Kernel('prod', false);
$kernel->loadClassCache();
Copy link
Member

Choose a reason for hiding this comment

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

this line is obsolete?

Copy link
Member Author

Choose a reason for hiding this comment

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

Reverted, all front controller and kernel changes should be done manually.

@@ -148,14 +148,14 @@ and adding a priority.

.. code-block:: yaml

# app/config/services.yml
# app/config/services.yaml
Copy link
Member

Choose a reason for hiding this comment

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

config/* everywhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done for all services and routes files, the remaining onces need all be visited manually.

@@ -294,7 +294,7 @@ below:

The code of the Symfony application has now been deployed to the Azure Website
which you can browse from the file explorer of the Kudu application. You should
see the ``app/``, ``src/`` and ``web/`` directories under your ``site/wwwroot``
see the ``app/``, ``src/`` and ``public/`` directories under your ``site/wwwroot``
Copy link
Member

Choose a reason for hiding this comment

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

"see the ``config/``, ..."

@@ -126,7 +126,7 @@ matter), Symfony uses the standard ``render`` helper to configure ESI tags:

.. code-block:: twig

{# app/Resources/views/static/about.html.twig #}
{# templates/static/about.html.twig #}

{# you can use a controller reference #}
{{ render_esi(controller('AppBundle:News:latest', { 'maxPerPage': 5 })) }}
Copy link
Member

Choose a reason for hiding this comment

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

App\Controller\NewsController::latestAction use FQNC notation everywhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's change that in a manual PR as well (not so easy to automate)

@@ -132,7 +132,7 @@ using the login form:

.. code-block:: html+twig

{# src/AppBundle/Resources/views/Security/login.html.twig #}
{# src/Resources/views/Security/login.html.twig #}
Copy link
Member

Choose a reason for hiding this comment

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

maybe this templates should be moved to templates/?

@@ -459,10 +459,10 @@ to service ids that may not exist yet: ``AppBundle\Security\Authentication\Provi
Now that your services are defined, tell your security context about your
factory in your bundle class::

// src/AppBundle/AppBundle.php
// src/AppBundle.php
namespace AppBundle;
Copy link
Member

Choose a reason for hiding this comment

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

both lines should be updated, probably this code lives now in Kernel.php.

@wouterj
Copy link
Member Author

wouterj commented Oct 31, 2017

Thanks a lot for your detailed review @yceruto ! I've now fixed everything or reverted the change as they have to be done in another PR (to not make this too big and hard to merge).

Copy link
Member

@yceruto yceruto left a comment

Choose a reason for hiding this comment

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

Awesome!

@@ -1067,5 +1067,5 @@ Learn more
/service_container/*

.. _`service-oriented architecture`: https://en.wikipedia.org/wiki/Service-oriented_architecture
.. _`Symfony Standard Edition (version 3.3) services.yaml`: https://github.com/symfony/symfony-standard/blob/3.3/app/config/services.yaml
.. _`Symfony Standard Edition (version 3.3) services.yaml`: https://github.com/symfony/symfony-standard/blob/3.3/config/services.yaml
Copy link
Member

Choose a reason for hiding this comment

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

should be reverted or referenced to the recipe instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed

@wouterj wouterj force-pushed the automated-sf3.4-updates branch from 7064286 to 57baceb Compare October 31, 2017 21:44
@wouterj
Copy link
Member Author

wouterj commented Oct 31, 2017

Applied the comment and also fixed the build


use App\DependencyInjection\Security\Factory\WsseFactory;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Copy link
Member

@yceruto yceruto Oct 31, 2017

Choose a reason for hiding this comment

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

add use Symfony\Component\HttpKernel\Kernel as BaseKernel?

@weaverryan
Copy link
Member

YES, awesome! Thank you Wouter! Thanks to the review from @yceruto, I'm happy to merge this quickly. If we find any bugs, we can make sure to automate those "fixes" across everything. So I think merging this right now is a great idea :)

@weaverryan weaverryan merged commit 57baceb into symfony:master Nov 2, 2017
weaverryan added a commit that referenced this pull request Nov 2, 2017
…(wouterj)

This PR was squashed before being merged into the master branch (closes #8569).

Discussion
----------

Lots of automated migrations to Symfony Flex structure

Almost all of these changes need a check if the paragraphs surrounding the code block still make sense, but at least, it is a start.

I skipped the Best Pratices and Create Your Own Framework guides. Both of these need to be completely revisited.

Also, lots of other (configuration, bundles, controller and services) guides need to be checked carefully.

Please review and merge quickly @symfony/team-symfony-docs

Commits
-------

57baceb Fixed build failures
6853f61 Some manual tweaks to the automated migrations
9e5cd17 Lots of automated migrations to Symfony Flex structure
weaverryan added a commit that referenced this pull request Nov 5, 2017
This PR was merged into the master branch.

Discussion
----------

Migrating Tests topics to Symfony Flex structure

#8569 continuation.

I've excluded `creating-the-project.rst` guide, because it needs to be changed completely.

Commits
-------

9dd5a9d Migrating Tests topics to Symfony Flex structure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants