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

Appearance settings

[Asset] Adding a new version strategy that reads from a manifest JSON file #22046

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

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tweaks thanks to fabpot
  • Loading branch information
weaverryan committed Mar 23, 2017
commit ff8869a36f593173c9e8bdfa333f312d3d649530
2 changes: 2 additions & 0 deletions 2 .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ return PhpCsFixer\Config::create()
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php')
// explicit heredoc test
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php')
// purposefully invalid JSON
->notPath('Symfony/Component/Asset/Tests/fixtures/manifest-invalid.json')
)
;
2 changes: 1 addition & 1 deletion 2 src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CHANGELOG
3.3.0
-----

* A new version strategy option called json_manifest_path was added
* Added a new new version strategy option called json_manifest_path
Copy link
Member

Choose a reason for hiding this comment

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

quotes around "json_manifest_path"?

that allows you to use the JsonManifestVersionStrategy.
Copy link
Member

Choose a reason for hiding this comment

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

backticks here?

* Added support for the `controller.service_arguments` tag, for injecting services into controllers' actions
* Deprecated `cache:clear` with warmup (always call it with `--no-warmup`)
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/Asset/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CHANGELOG

3.3.0
-----
* JsonManifestVersionStrategy was added as a way to read final,
* Added JsonManifestVersionStrategy as a way to read final,
versioned paths from a JSON manifest file.

2.7.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@
* "css/styles.css": "css/styles.555abc.css"
* }
*
* You could then as for the version of "main.js" or "css/styles.css".
* You could then ask for the version of "main.js" or "css/styles.css".
*/
class JsonManifestVersionStrategy implements VersionStrategyInterface
{
private $manifestPath;

private $manifestData;

/**
* @param string $manifestPath Absolute path to the manifest file.
* @param string $manifestPath Absolute path to the manifest file
*/
public function __construct($manifestPath)
Copy link
Member

Choose a reason for hiding this comment

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

please add the phpdoc describing the argument as a string, as we don't have a typehint to tell it

{
Expand All @@ -40,10 +39,6 @@ public function __construct($manifestPath)
* With a manifest, we don't really know or care about what
* the version is. Instead, this returns the path to the
* versioned file.
*
* @param string $path
*
* @return string
*/
public function getVersion($path)
{
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.