Message-ID: <1481532632.3214.1485852409927.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3213_1667337280.1485852409927" ------=_Part_3213_1667337280.1485852409927 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Version compatibility
Compatible with eZ Publish 5.25.3 and 2= 013.07 (up to 2014.11)
Deprecated
This recipe is deprecated as of 5.4 / 2014.11.
Use user context providers from FOSHttpCacheBundle instead.
Be sure to have read Context aware HTTP cache documentation before reading this recipe.= p>
When user hash generation is requested, eZ Publish will create a hashable User Identity object.
One can add information to the Identity object making the resulted hash = vary. This can be done by registering Identity definers.
For this, all you need to do is to declare a service with =
ezpublish.identity_definer
tag. Class for this s=
ervice must implement <=
strong>eZ\Publish\SPI\User\IdentityAware
i=
nterface.
parameters: my_identity_definer.class: Acme\TestBundle\Identity\MyDefiner services: my_identity_definer: class: %my_identity_definer.class% tags: - { name: ezpublish.identity_definer }=20
<?php namespace Acme\TestBundle\Identity; use eZ\Publish\SPI\User\IdentityAware; use eZ\Publish\SPI\User\Identity; class MyDefiner implements IdentityAware { public function setIdentity( Identity $identity ) { // Here I can add information to $identity. // value MUST be scalar. $identity->setInformation( 'my_key', 'my_value' ); } }=20
By default, hash generation requests are granted for localhost (12=
7.0.0.1
, ::1
, fe80::1
).
If you want to enlarge the scope (e.g. if your Varnish server is not run=
ning on the same machine), you can override canGenerateUserHash(=
)
protected method in your main kernel class (mostly AppK=
ernel
).