Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[HttpKernel][FrameworkBundle] SSI support #10702

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 1 commit into from
Jul 25, 2014
Merged

[HttpKernel][FrameworkBundle] SSI support #10702

merged 1 commit into from
Jul 25, 2014

Conversation

kingcrunch
Copy link
Contributor

Q A
Bug fix? No
New feature? Yes
BC breaks? No
Deprecations? No
Tests pass? Yes
Fixed tickets #9419 (, #10684)
License MIT

It does not support comments, or alternative URIs, or "continue" in case of errors. Maybe I can workaround that, but I've decided to left it out for this PR. Especially as far as I can see a "alternative URIs"-hack would always lead to two requests, even if it's not needed.

@@ -70,7 +70,7 @@ protected function getOptions()
return array();
}

protected function createEsi()
protected function createSurrogate()
{
return new Esi();
Copy link
Contributor

Choose a reason for hiding this comment

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

what about here ? shouldn't be Esi renamed too ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Couldn't decide myself (and later I forgot). Problem is, to what should I rename it? You can overwrite it in your applications AppCache-class with

protected function createSurrogate()
{
    return new Ssi();
}

That's not perfect, but it works and is backward compatible. The other solution is to provide two separate FrameworkBundle:HttpCache\HttpCache-classes...

@stof
Copy link
Member

stof commented Apr 14, 2014

Please implement the featur ein a BC way, otherwise it means it cannot be merged until we move to 3.0

@kingcrunch
Copy link
Contributor Author

Fixed. Did I miss something?

Also do you have an idea about how to solve this? The FrameworkBundle:HttpCache\HttpCache-class is hard-wired to the Esi class and additionally it also pushes this into the DIC. I've added a method getName() to Esi and Ssi, so when somebody overwrites createSurrogate() it works as at least I'd expect it, but I'm not totally happy with that.

So in my opinion it is fine for now, but maybe somebody has an idea?

* @param SurrogateInterface $surrogate An Surrogate instance
* @param FragmentRendererInterface $inlineStrategy The inline strategy to use when the surrogate is not supported
*/
public function __construct(SurrogateInterface $surrogate = null, FragmentRendererInterface $inlineStrategy)
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks wrong, first param shouln't be optional if second is required...

Copy link
Member

Choose a reason for hiding this comment

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

it is already the existing signature. = null is not really about making the argument optional, but about making it nullable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly (I've tried it out...)

@murnieza
Copy link

Really looking forward to see this functionality in Symfony 👍

@kingcrunch
Copy link
Contributor Author

So, updated once more. Sorry for the inconvenience with the BC

I've mentioned in the source, that the components are deprecated since 2.5, but actually I don't really know. It's too late for 2.5, isn't?

Are there any other concerns?

@stof
Copy link
Member

stof commented Apr 15, 2014

@kingcrunch yes it is. 2.5 is already feature-frozen. It will come in 2.6 now

}

if (!isset($options['virtual'])) {
throw new \RuntimeException('Unable to process an SSI tag without a "src" attribute.');
Copy link
Member

Choose a reason for hiding this comment

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

Actually, this is the "virtual" attribute.

use Symfony\Component\HttpKernel\UriSigner;

/**
* Defines the interface
Copy link
Member

Choose a reason for hiding this comment

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

Looks wrong to me.

@fabpot
Copy link
Member

fabpot commented Jun 6, 2014

@kingcrunch Looks good to me. Can you fix the minor issues I've mentioned in the comments? Thanks.

@fabpot
Copy link
Member

fabpot commented Jun 18, 2014

👍

@fabpot
Copy link
Member

fabpot commented Jun 18, 2014

@kingcrunch Thanks for that. Can you fix the fabbot errors (mainly about using bool instead of Boolean?)

@@ -70,6 +70,18 @@ protected function getOptions()
return array();
}

protected function createSurrogate()
{
return new Esi();
Copy link
Member

Choose a reason for hiding this comment

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

this is not BC. If someone overwrites createEsi, it is not called anymore

Copy link
Member

Choose a reason for hiding this comment

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

Good catch, you're right.

@kingcrunch
Copy link
Contributor Author

Rebase and pushed. Actually some days ago already, but I don't know, if it's fine to "ping" after every commit :X

@fabpot
Copy link
Member

fabpot commented Jun 20, 2014

@kingcrunch Pinging is fine, but we now need 2 +1 from the core team before being able to merge this PR. http://symfony.com/doc/current/contributing/code/core_team.html#code-development-rules

@fabpot
Copy link
Member

fabpot commented Jun 26, 2014

ping @stof @romainneutron @nicolas-grekas

@kingcrunch
Copy link
Contributor Author

cough ping @stof @romainneutron @nicolas-grekas

@fabpot
Copy link
Member

fabpot commented Jul 25, 2014

Thank you @kingcrunch.

@fabpot fabpot merged commit 06cea08 into symfony:master Jul 25, 2014
fabpot added a commit that referenced this pull request Jul 25, 2014
This PR was merged into the 2.6-dev branch.

Discussion
----------

[HttpKernel][FrameworkBundle] SSI support

| Q             | A
| ------------- | ---
| Bug fix?      | No
| New feature?  | Yes
| BC breaks?    | No
| Deprecations? | No
| Tests pass?   | Yes
| Fixed tickets | #9419 (, #10684)
| License       | MIT

It does not support comments, or alternative URIs, or "continue" in case of errors. Maybe I can workaround that, but I've decided to left it out for this PR. Especially as far as I can see a "alternative URIs"-hack would _always_ lead to two requests, even if it's not needed.

Commits
-------

06cea08 SSI support
@pborreli
Copy link
Contributor

Thanks for this nice work @kingcrunch and all reviewers. This is a great new feature ✨ .

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.

8 participants