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

[WebProfilerBundle] use the router to resolve file links#26626

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

Conversation

@nicolas-grekas
Copy link
Member

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

<argument>?file=%%f&amp;line=%%l#line%%l</argument>
</argument>
</service>
</argument>
Copy link
MemberAuthor

@nicolas-grekasnicolas-grekasMar 21, 2018
edited
Loading

Choose a reason for hiding this comment

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

this generates the following code, which is exactly what we need here:

new \Symfony\Component\HttpKernel\Debug\FileLinkFormatter(NULL, ($this->services['request_stack'] ??$this->services['request_stack'] =new \Symfony\Component\HttpFoundation\RequestStack()),$this->targetDirs[3],\implode(array(0 => ($this->services['router'] ??$this->getRouterService())->generate('_profiler_open_file'),1 =>'?file=%f&line=%l#line%l')));

<argument>%kernel.project_dir%</argument>
<argument>/_profiler/open?file=%%f&amp;line=%%l#line%%l</argument>
<argumenttype="service">
<serviceclass="string">
Copy link
Member

Choose a reason for hiding this comment

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

nice hack!

linaori reacted with laugh emoji
<argument>/_profiler/open?file=%%f&amp;line=%%l#line%%l</argument>
<argumenttype="service">
<serviceclass="string">
<factoryfunction="implode" />
Copy link
Member

Choose a reason for hiding this comment

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

oh, and yet another nice hack!
Well done :)

linaori and matt-usurp reacted with laugh emoji
@javiereguiluz
Copy link
Member

javiereguiluz commentedMar 22, 2018
edited
Loading

@nicolas-grekas my head exploded when trying to understand this ... but I'm glad this is working 🎉

However, the main concern of Fabien in the other PR (see#24153 (comment)) was the configurability of this. So, can you please paste an example of the config needed if the user wants to customize the URL? We'd need it to update the docs. Thanks!

@nicolas-grekas
Copy link
MemberAuthor

nicolas-grekas commentedMar 22, 2018
edited
Loading

@javiereguiluz there is no config needed, the URL will be generated based on the path of the_profiler_open_file route. If you want another route, do it yourself (but that's not what the original issue asked for.)

javiereguiluz and matt-usurp reacted with thumbs up emoji

@nicolas-grekasnicolas-grekas merged commit2cfc573 intosymfony:3.4Mar 22, 2018
nicolas-grekas added a commit that referenced this pull requestMar 22, 2018
…nicolas-grekas)This PR was merged into the 3.4 branch.Discussion----------[WebProfilerBundle] use the router to resolve file links| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#22290,#25886| License       | MIT| Doc PR        | -Commits-------2cfc573 [WebProfilerBundle] use the router to resolve file links
@nicolas-grekasnicolas-grekas deleted the generate-profiler-open-link branchMarch 22, 2018 15:05
This was referencedApr 3, 2018
@ahilles107
Copy link

ahilles107 commentedApr 3, 2018
edited
Loading

It creates a BC break as router tries to generate route on container dumping.

  [PDOException (HY000)]  SQLSTATE[HY000]: General error: 1 no such table: swp_routeException trace: PDO->prepare() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:77 Doctrine\DBAL\Driver\PDOConnection->prepare() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:904 Doctrine\DBAL\Connection->executeQuery() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:733 Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:196 Doctrine\ORM\EntityRepository->findOneBy() at /Users/pawelmikolajczuk/Projects/web-publisher/src/SWP/Bundle/ContentBundle/Provider/ORM/RouteProvider.php:183 SWP\Bundle\ContentBundle\Provider\ORM\RouteProvider->getRouteByName() at /Users/pawelmikolajczuk/Projects/web-publisher/app/cache/test/ContainerMt0kps0/RouteProvider_370e34c.php:110 RouteProvider_370e34c->getRouteByName() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony-cmf/routing/src/ContentAwareGenerator.php:102 Symfony\Cmf\Component\Routing\ContentAwareGenerator->getRouteByName() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony-cmf/routing/src/ContentAwareGenerator.php:74 Symfony\Cmf\Component\Routing\ContentAwareGenerator->generate() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony-cmf/routing/src/DynamicRouter.php:179 Symfony\Cmf\Component\Routing\DynamicRouter->generate() at /Users/pawelmikolajczuk/Projects/web-publisher/src/SWP/Bundle/CoreBundle/Routing/MetaRouter.php:65 SWP\Bundle\CoreBundle\Routing\MetaRouter->generate() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony-cmf/routing/src/ChainRouter.php:233 Symfony\Cmf\Component\Routing\ChainRouter->generate() at /Users/pawelmikolajczuk/Projects/web-publisher/app/cache/test/ContainerMt0kps0/appTestDebugProjectContainer.php:3864 ContainerMt0kps0\appTestDebugProjectContainer->getDebug_FileLinkFormatterService() at /Users/pawelmikolajczuk/Projects/web-publisher/app/cache/test/ContainerMt0kps0/appTestDebugProjectContainer.php:2986 ContainerMt0kps0\appTestDebugProjectContainer->getTwigService() at /Users/pawelmikolajczuk/Projects/web-publisher/app/cache/tes_/ContainerMt0kps0/getTwig_CacheWarmerService.php:9 ContainerMt0kps0\appTestDebugProjectContainer->{closure}() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ServiceLocator.php:64 Symfony\Component\DependencyInjection\ServiceLocator->get() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php:63 Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer->warmUp() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php:52 Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate->warmUp() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php:203 Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->warmup() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php:133 Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->execute() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:252 Symfony\Component\Console\Command\Command->run() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:964 Symfony\Component\Console\Application->doRunCommand() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:86 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:248 Symfony\Component\Console\Application->doRun() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:74 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /Users/pawelmikolajczuk/Projects/web-publisher/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:148 Symfony\Component\Console\Application->run() at /Users/pawelmikolajczuk/Projects/web-publisher/app/console:30cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [-t|--tenant TENANT] [--] <command>

We have routes in database and at the end database is checked on container generation (cache:clear command)

@thijskaspers
Copy link

thijskaspers commentedApr 3, 2018
edited
Loading

Same here withbin/console debug:router --env=ci:

In appCiDebugProjectContainerUrlGenerator.php line 81:                                                                                                      Unable to generate a URL for the named route "_profiler_open_file" as such route does not exist.

The 'ci' environment loads theSymfony\Bundle\WebProfilerBundle\WebProfilerBundle() in AppKernel.php so what I am doing wrong here?

IwfY and RyanGittins reacted with thumbs up emoji

@fabpot
Copy link
Member

Shall we revert?

@nicolas-grekas
Copy link
MemberAuthor

It depends on the time we want, fix in progress, could be ready tomorrow.

@nicolas-grekas
Copy link
MemberAuthor

Fix in#26758

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@xabbuhxabbuhxabbuh approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

7 participants

@nicolas-grekas@javiereguiluz@ahilles107@thijskaspers@fabpot@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp