SlideShare ist ein Scribd-Unternehmen logo
1 von 64
Downloaden Sie, um offline zu lesen
Learnings from Real eZ Publish 5 Projects 
1 von 64 05.09.14 08:31
Learnings from Real eZ Publish 5 Projects 
Learnings from Real eZ Publish 5 
Projects 
Donat Fritschy - Webmanufaktur 
Ekkehard Dörre - Coolscreen 
2 von 64 05.09.14 08:31
Presenters 
Donat is owner of Webmanufaktur, a full service web agency in Switzerland. 
He works as projects manager, software architect and developer and likes 
thinking outside of the box. In the last year he has been involved in major eZ 5 
projects. 
Ekke is a consultant with deep knowledge in eZ Publish 4 and 5, eZ Find / 
Apache Solr and with a faible for coming cutting edge web technologies. He is 
one of the organizers of the PHP Unconference since eight years. 
Members of CJW Network 
#ezsummer 
· 
· 
· 
3/64 
Learnings from Real eZ Publish 5 Projects 
3 von 64 05.09.14 08:31
Learnings from Real eZ Publish 5 Projects 
Last year we have presented our Cookbook... 
... today you get a Ratatouille ;-) 
Let's share the experiences you and we made in the last year! 
http://de.slideshare.net/dfritschy/how-to-start-with-ez-publish-5 
https://github.com/dfritschy/cjw-cookbook 
#ezsummer 
· 
· 
· 
· 
· 
4/64 
Learnings from Real eZ Publish 5 Projects 
4 von 64 05.09.14 08:31
Who is in the audience? 
Who is coming from the eZ World? 
Who is coming from the Symfony World? 
Who has realized eZ Publish 5 sites (productive)? 
Who has realized pure eZ Publish 5 sites (no legacy)? 
#ezsummer 
· 
· 
· 
· 
5/64 
Learnings from Real eZ Publish 5 Projects 
5 von 64 05.09.14 08:31
Agenda 
Things we would like to discuss: 
Good Practice 
ez View Cache vs. HTTP Cache 
Debugging 
Pitfalls 
MultiSite Setup 
#ezsummer 
· 
· 
· 
· 
· 
6/64 
Learnings from Real eZ Publish 5 Projects 
6 von 64 05.09.14 08:31
Learnings from Real eZ Publish 5 Projects 
Good Practice 
7 von 64 05.09.14 08:31
Team up with a Symfony Crack 
To be honest: as eZ 4 developers, we are complete novices in eZ 5 
It's easier for a Smyfony Crack to learn eZ than other way round 
Symfony community is hungry for a CMS, so watch out for new competition 
But @Symfony cracks: It's not easy: an eZ Publish and CMS expert will reduce 
your risk 
And will make your content architecture better and more maintainable 
#ezsummer 
· 
· 
· 
· 
· 
8/64 
Learnings from Real eZ Publish 5 Projects 
8 von 64 05.09.14 08:31
Think in MVC 
A radical different thinking 
eZ 4 mangled all together in the TPL -> the view implemented the logic (fetch) 
Symfony enforces a clean separation, from routing to the controller to the 
rendering of the view 
#ezsummer 
· 
· 
· 
9/64 
Learnings from Real eZ Publish 5 Projects 
9 von 64 05.09.14 08:31
Learnings from Real eZ Publish 5 Projects 
MVC Blackbox 
#ezsummer 10/64 
10 von 64 05.09.14 08:31
Think in Bundles 
What is a bundle? 
Use a least one bundle per site 
Split your application in different bundles (site specific, functional, ...) 
Reuse your code: create and maintain with love a Base Bundle with general 
functions 
Refactor it frequently as you learn and the product evolves 
Creating bundles is easy, don't work in the DemoBundle ;-) 
#ezsummer 
· 
· 
· 
· 
· 
· $ php ezpublish/console generate:bundle BASH 
11/64 
Learnings from Real eZ Publish 5 Projects 
11 von 64 05.09.14 08:31
Organize your config files 
The standard eZ installation is a mess... 
... and the DemoBundle is only slowly becoming a source of good practice 
How do YOU handle this? 
keep config in ezpublish/config as general as possible 
it should merely describe your environment, not the application 
move all site/function specific settings to the bundle 
#ezsummer 
· 
· 
· 
12/64 
Learnings from Real eZ Publish 5 Projects 
12 von 64 05.09.14 08:31
Keep ezpublish.yml small (1) 
ezpublish/config/ezpublish.yml 
imports: 
- {resource: "@CjwExampleBundle/Resources/config/ezpublish.yml"} 
ezpublish: 
siteaccess: 
default_siteaccess:%cjw.site%_user 
list: 
groups: 
#ezsummer 
default_group: 
match: 
CjwMultiSiteBundleMatcherMapHost: 
www.%cjw.site%.ch: %cjw.site%_user 
admin.%cjw.site%.ch: %cjw.site%_admin 
repositories: 
default_repository: 
engine: legacy 
connection: default_connection 
YML 
13/64 
Learnings from Real eZ Publish 5 Projects 
13 von 64 05.09.14 08:31
Keep ezpublish.yml small (2) 
system: 
default_group: 
#ezsummer 
repository: default_repository 
var_dir: var/%cjw.site% 
languages: 
- ger-DE 
%cjw.site%_user: 
legacy_mode: false 
languages: 
- ger-DE 
content: 
view_cache: true 
ttl_cache: true 
default_ttl: 3600 
%cjw.site%_admin: 
legacy_mode: true 
... 
stash: 
... 
YML 
14/64 
Learnings from Real eZ Publish 5 Projects 
14 von 64 05.09.14 08:31
Keep ezpublish.yml small (3) 
Can even be shorter - get inspiration from https://github.com/lolautruche 
/metalfrance 
Extras: 
use parameters 
standardize site access names, groups, repository names 
ezpublish/config/parameters.yml 
Note: prepending configuration does not work well with parameters 
#ezsummer 
· 
· 
parameters: 
... 
cjw.site: frb 
YML 
15/64 
Learnings from Real eZ Publish 5 Projects 
15 von 64 05.09.14 08:31
Config Files in Bundle 
We keep them in a separate directory and name them as in good old eZ... 
ExampleBundle 
⌞ Resources 
⌞ config 
⌞ ezpublish 
image.yml 
override.yml 
ezpublish.yml <-- includes files from ./ezpublish 
parameters.yml 
routing.yml 
services.yml 
#ezsummer 
16/64 
Learnings from Real eZ Publish 5 Projects 
16 von 64 05.09.14 08:31
Controllers 
After several tries, we ended up with... 
Basically one controller per full view 
Separate controllers for navigation etc. 
Consider caching (TTL, X-Location Header) 
Recommended: Move business logic to separate model 
Retrieve all needed data (location, children, ...) 
Prepare the data for easy processing in the templates 
#ezsummer 
· 
· 
· 
· 
· 
· 
17/64 
Learnings from Real eZ Publish 5 Projects 
17 von 64 05.09.14 08:31
Ways to Fetch Content 
LocationService::loadLocation( $id ) --> location 
ContentService::loadContent( $id ) --> content 
SearchService::findContent( $query ) --> list of content 
SearchService::findLocations( $query ) --> list of location 
LocationService::loadLocationChildren( $location ) --> list of location 
Legacy fetch functions 
#ezsummer 
· 
· 
· 
· 
· 
· 
18/64 
Learnings from Real eZ Publish 5 Projects 
18 von 64 05.09.14 08:31
SearchService::findContent() 
The only SearchService function you will find in DemoBundle ... 
returns full content objects with ALL attributes in ALL languages 
does not work well with multiple locations 
no as_objects flag as in eZ 4 
scales very badly 
fetching a content tree with 116 locations took 30 seconds 
most of the time is spent in manipulating the SQL result in PHP 
Another test: 24 hits, PHP array 44'880 rows with 39 elements each, highly 
redundant 
http://share.ez.no/blogs/donat-fritschy/searchservice-performance 
#ezsummer 
· 
· 
· 
· 
· 
· 
· 
· 
19/64 
Learnings from Real eZ Publish 5 Projects 
19 von 64 05.09.14 08:31
SearchService::findLocations() 
Available from 2014.05 / 5.3 only 
Roughly equivalent to good old fetch( 'content', 'list' ) 
returns location objects with contentInfo only 
usually sufficient for building a menu 
use ContentService::loadContent() to fetch whole object 
Performance lower than legacy, but acceptable 
fetching a content tree with 116 locations took < 1 second 
scales very well 
#ezsummer 
· 
· 
· 
· 
· 
· 
20/64 
Learnings from Real eZ Publish 5 Projects 
20 von 64 05.09.14 08:31
Learnings from Real eZ Publish 5 Projects 
LocationService::loadLocationChildren() 
Think of LocationService::loadLocationChildren() as primarily intended 
for administration interface. Has no filtering capabilities. 
Further reading: 
http://www.netgenlabs.com/Blog/Fetching-content-in-eZ-Publish-5-using-Search-service 
#ezsummer 21/64 
21 von 64 05.09.14 08:31
Legacy Fetch Functions 
use eZFunctionHandler; 
... 
$mySearchResults = $this->getLegacyKernel()->runCallback( 
function () use ( $searchPhrase, $sort, $contentTypeIdenfiers ) 
{ 
// eZFunctionHandler::execute is the equivalent for a legacy template fetch function 
// The following is the same than fetch( 'ezfind', 'search', hash(...) ) 
return eZFunctionHandler::execute( 
#ezsummer 
'ezfind', 
'search', 
array( 
'query' => $searchPhrase, 
'sort_by' => $sort, 
'class_id' => $contentTypeIdenfiers 
) 
); 
} 
); 
PHP 
22/64 
Learnings from Real eZ Publish 5 Projects 
22 von 64 05.09.14 08:31
Templates 
How to transform a full view TPL with children to Symfony? 
full/folder.tpl 
<h1>{$node.data_map.title.content|wash()}</h1> 
{attribute_view_gui attribute=$node.data_map.short_description} 
... 
{def $list_items=fetch( 'content', 'list', ... ) ) } 
{foreach $list_items as $child} 
{node_view_gui view=line content_node=$child} 
{/foreach} 
#ezsummer 
TPL 
23/64 
Learnings from Real eZ Publish 5 Projects 
23 von 64 05.09.14 08:31
Moving to TWIG 
Resources/view/full.html.twig 
<h1>{{ ez_render_field( content, 'title') }}</h1> 
{{ ez_render_field( content, 'short_description') }} 
... 
{{ render( controller( "CjwBaseBundle:Default:subItems", {'locationId': location.id }) ) }} 
Controller/DefaultController.php 
#ezsummer 
TWIG 
public function subItemsAction( $locationId ) 
{ 
$response = new Response; 
$locationList = $this->fetchLocationListIncludingContentTypes( $locationId, array() ); 
return $this->render( 
"CjwBaseBundle::sub_items.html.twig", 
array( "locationList" => $locationList ), 
$response 
); 
} 
PHP 
24/64 
Learnings from Real eZ Publish 5 Projects 
24 von 64 05.09.14 08:31
Moving to TWIG 
Resources/view/sub_items.html.twig 
{% for location in locationList %} 
{{ render( controller( 'ez_content:viewLocation', 
{'locationId': location.id, 'viewType': 'line'} )) }} 
{% endfor %} 
#ezsummer 
TWIG 
25/64 
Learnings from Real eZ Publish 5 Projects 
25 von 64 05.09.14 08:31
Our approach 
Basically one template per full view 
Render children directly in the full view template 
Generalized full and line view templates for the easy stuff 
#ezsummer 
· 
· 
· 
26/64 
Learnings from Real eZ Publish 5 Projects 
26 von 64 05.09.14 08:31
How to organize Templates? 
The Symfony way... 
views 
⌞ Customer 
CustomerDetail.html.twig 
⌞ Product 
The classic eZ way... 
views 
⌞ full 
customer.html.twig 
⌞ line 
Two approaches, both valid. Follow your taste. 
#ezsummer 
27/64 
Learnings from Real eZ Publish 5 Projects 
27 von 64 05.09.14 08:31
Learnings from Real eZ Publish 5 Projects 
eZ View Cache vs. HTTP Caching 
28 von 64 05.09.14 08:31
eZ View Caching (Legacy) 
When the pagelayout is rendered, the {$module_result.content} part will be 
replaced with the actual output. If view caching is enabled, the entire result of 
the module will be cached. This means that the contents of the "module_result" 
variable will be put into a cache file (...) 
When a new version (...) of an object is published, the system will automatically 
clear the view cache for the following items: 
All published nodes of the object 
The parent nodes 
Related nodes (keywords, object relations) 
https://doc.ez.no/eZ-Publish/Technical-manual/4.x/Features/View-caching 
#ezsummer 
· 
· 
· 
29/64 
Learnings from Real eZ Publish 5 Projects 
29 von 64 05.09.14 08:31
HTTP Expiration and Validation (Symfony) 
The HTTP specification defines two caching models: 
With the expiration model, you simply specify how long a response should be 
considered "fresh" by including a Cache-Control and/or an Expires header. 
Caches that understand expiration will not make the same request until the 
cached version reaches its expiration time and becomes "stale"; 
When pages are really dynamic (i.e. their representation changes often), the 
validation model is often necessary. With this model, the cache stores the 
response, but asks the server on each request whether or not the cached 
response is still valid. The application uses a unique response identifier (the 
Etag header) and/or a timestamp (the Last-Modified header) to check if the 
page has changed since being cached. 
http://symfony.com/doc/current/book/http_cache.html 
#ezsummer 
· 
· 
30/64 
Learnings from Real eZ Publish 5 Projects 
30 von 64 05.09.14 08:31
In Short (and much simplified...) 
eZ View Cache caches content and content fragments 
Standard TTL is 2 hours 
Is purged on content modifications (with smart cache clearing rules) 
Symfony's HTTP Cache caches requests 
Let's dive in a bit deeper... 
#ezsummer 
· 
· 
eZ uses Expiration model by default 
Standard TTL is 60 seconds (86400 for tree menu!) 
Symfony Cache is purged from backend 
· 
· 
· 
31/64 
Learnings from Real eZ Publish 5 Projects 
31 von 64 05.09.14 08:31
ez 4 Cache Directives 
Code from ezpublish_legacy/kernel/private/classes/ezpkernelweb.php 
// send header information 
foreach ( 
eZHTTPHeader::headerOverrideArray( $this->uri ) + 
array( 
'Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT', 
'Last-Modified' => gmdate( 'D, d M Y H:i:s' ) . ' GMT', 
'Cache-Control' => 'no-cache, must-revalidate', 
'Pragma' => 'no-cache', 
... 
) as $key => $value 
This guarantees that every request is handled by eZ 
#ezsummer 
){ 
header( $key . ': ' . $value ); 
} 
PHP 
32/64 
Learnings from Real eZ Publish 5 Projects 
32 von 64 05.09.14 08:31
eZ 5 Cache Directives 
Code from vendor/ezsystems/demobundle/EzSystems/DemoBundle 
/Controller/DemoController.php 
// Setting HTTP cache for the response to be public and with a TTL of 1 day. 
$response = new Response; 
$response->setPublic(); 
$response->setSharedMaxAge( 86400 ); 
// Menu will expire when top location cache expires. 
$response->headers->set( 'X-Location-Id', $rootLocationId ); 
// Menu might vary depending on user permissions, so make the cache vary on the user hash. 
$response->setVary( 'X-User-Hash' ); 
This effectively sets the Response free, out of the reach of eZ 
#ezsummer 
PHP 
33/64 
Learnings from Real eZ Publish 5 Projects 
33 von 64 05.09.14 08:31
Emulating eZ 4 Cache behaviour in eZ 5 
This patch to index.php disables client and proxy caching without sacrificing the 
benefits of the Symfony HTTP cache. Use at own risk! 
$response = $kernel->handle( $request ); 
// Emulate eZ 4 cache control 
$response->headers->set( 'Cache-Control', 'no-cache, must-revalidate' ); 
$response->send(); 
$kernel->terminate( $request, $response ); 
#ezsummer 
PHP 
34/64 
Learnings from Real eZ Publish 5 Projects 
34 von 64 05.09.14 08:31
Cache Recommendations 
Read the specifications 
Use Shared Caches with caution 
Cave: setTtl() vs. setClientTtl 
Set TTL as high as possible 
Use Varnish 
http://tools.ietf.org/html/rfc2616#page-74 
https://www.mnot.net/cache_docs/ 
#ezsummer 
· 
· 
· 
· 
· 
· 
· 
35/64 
Learnings from Real eZ Publish 5 Projects 
35 von 64 05.09.14 08:31
Cache per User - User Hash Definer 
src/Cjw/SiteCustomerBundle/Identity/UserHashDefiner.php 
namespace CjwSiteCustomerBundleIdentity; 
use eZPublishSPIUserIdentityAware; 
use eZPublishSPIUserIdentity; 
use eZPublishAPIRepositoryRepository; 
class UserHashDefiner implements IdentityAware 
{ 
private $repository; 
public function __construct(Repository $repository) 
{ 
$this->repository = $repository; 
} 
public function setIdentity(Identity $identity) 
{ 
$current_user = $this->repository->getCurrentUser(); 
$identity->setInformation('UserID', $current_user->contentInfo->id); 
} 
#ezsummer 
} 
PHP 
36/64 
Learnings from Real eZ Publish 5 Projects 
36 von 64 05.09.14 08:31
Cache per User - yml config 
src/Cjw/SiteCustomerBundle/Ressources/config/services.yml 
parameters: 
cjw_site_customer.user_hash_definer.class: CjwSiteCustomerBundleIdentityUserHashDefiner 
services: 
cjw_site_customer.user_hash_definer: 
class: %cjw_site_customer.user_hash_definer.class% 
tags: 
- { name: ezpublish.identity_definer } 
arguments: [@ezpublish.api.repository] 
#ezsummer 
YML 
37/64 
Learnings from Real eZ Publish 5 Projects 
37 von 64 05.09.14 08:31
Cache per User - Controller 
src/Cjw/SiteCustomerBundle/Controller/CjwController.php 
public function sectionInternalAction($locationId, $viewType, $layout = false, array $params 
{ 
$response = new Response(); 
$response->setPrivate(); 
$response->headers->set('X-Location-Id', $locationId); 
$response->setVary('X-User-Hash'); 
return $response; 
} 
#ezsummer 
PHP 
38/64 
Learnings from Real eZ Publish 5 Projects 
38 von 64 05.09.14 08:31
Cache per User - Location View Configuration 
src/Cjw/SiteCustomerBundle/Ressources/config/ezpublish 
/override.yml 
system: 
customer_user_de: 
location_view: 
#ezsummer 
full: 
section_internal: 
controller: "CjwSiteCustomerBundle:Cjw:sectionInternal" 
match: 
IdentifierSection: internal 
YML 
39/64 
Learnings from Real eZ Publish 5 Projects 
39 von 64 05.09.14 08:31
Learnings from Real eZ Publish 5 Projects 
Debugging 
Coping with blank screens 
40 von 64 05.09.14 08:31
Blank screen, "503 Service not available" 
PHP errors (Syntax error, Memory, Outdated Autoloads, ...) 
Configuration errors (DB connection, ...) 
Switch to DEV mode for better debugging 
Check the log files 
Check write permissions on log files! 
#ezsummer 
· 
· 
· 
· 
Apache/PHP Log 
ezpublish/logs/<env>.log 
ezpublish_legacy/var/log/* 
ezpublish_legacy/var/<siteaccess>/log/* 
· 
41/64 
Learnings from Real eZ Publish 5 Projects 
41 von 64 05.09.14 08:31
TwigBundle:Exception:error500.html.twig 
NEVER a Twig error! 
Caused by response 500 "Internal Server Error" and missing error template 
Checks as before 
#ezsummer 
· 
· 
· 
42/64 
Learnings from Real eZ Publish 5 Projects 
42 von 64 05.09.14 08:31
Twig Exception: Invalid variation "<variation>" 
Caused by problems when accessing images 
Check if the file exists 
Check permissions on ezpublish_legacy/var/<siteaccess>/storage 
Check log files 
Clear cache 
#ezsummer 
· 
· 
· 
· 
43/64 
Learnings from Real eZ Publish 5 Projects 
43 von 64 05.09.14 08:31
Class 'ezxFormToken' not found 
Usually found with fresh installations involving legacy extensions 
Regenerate Autoloads 
#ezsummer 
· 
· 
$ cd ezpublish_legacy 
$ php bin/php/ezpgenerateautoloads.php -e -p 
BASH 
44/64 
Learnings from Real eZ Publish 5 Projects 
44 von 64 05.09.14 08:31
Learnings from Real eZ Publish 5 Projects 
Pitfalls 
Avoid the traps... 
45 von 64 05.09.14 08:31
Memory limit exceeded in DEV mode 
DEV mode takes a lot of memory 
Stash Logging is the worst 
Disable Stash Logging in ezpublish.yml 
#ezsummer 
· 
· 
· 
stash: 
logging: false 
caches: 
default: 
handlers: 
- FileSystem 
inMemory: true 
registerDoctrineAdapter: false 
YML 
46/64 
Learnings from Real eZ Publish 5 Projects 
46 von 64 05.09.14 08:31
414 Request-URI Too Long 
When doing subrequests, particularly ESI or Hinclude ones, current SiteAccess is 
transmitted in a serialized form, with its matcher. With a large number of 
configured SiteAccesses using MapHost or MapURI matcher (around 40, which 
is not uncommon for a multi-national, multi-lingual site) the URL can exceed the 
size of 8192 Bytes which most servers accept. As a result, the ESI/Hinclude call 
fails. 
Fixed in Version 5.3.3 (2014.07) 
https://jira.ez.no/browse/EZP-23168 
https://github.com/ezsystems/ezpublish-kernel/pull/949 
#ezsummer 
· 
· 
· 
47/64 
Learnings from Real eZ Publish 5 Projects 
47 von 64 05.09.14 08:31
Learnings from Real eZ Publish 5 Projects 
Multi-Site/Multi-Repository Setup 
48 von 64 05.09.14 08:31
Why a Multi-Site/Multi-Repository Setup? 
At CJW Network we have developed a multi-site/multi-repository setup for eZ 
Publish 4 several years ago 
This allows us to host many individual sites on a single eZ Publish installation 
Advantages: 
Disadvantages: 
#ezsummer 
· 
· 
Central site administration (site activation, cronjobs, ...) 
Easy deployment (update site extension with Subversion) 
Highly reduced maintenance costs (security patches, upgrades) 
Highly efficient use of hardware resources 
· 
· 
· 
· 
· Some Kernel patches needed 
49/64 
Learnings from Real eZ Publish 5 Projects 
49 von 64 05.09.14 08:31
Multi-Site/Multi-Repository Setup in eZ 5 
First Approach (proven in production) 
Use different · ezpublish app directories to host the different sites 
Second approach (under development) 
· Use CJW MultiSiteBundle 
#ezsummer 
50/64 
Learnings from Real eZ Publish 5 Projects 
50 von 64 05.09.14 08:31
Directory structure - Multi-Site-Setup (old) 
ezpublish <-- not used 
ezpublish_legacy 
⌞extension 
⌞site_customer <-- each customer has its own extension and database 
⌞site_customertwo 
⌞var 
⌞site_customer <-- each customer has its own var directory 
⌞site_customertwo 
site_customer <-- each customer has its own Symfony app 
site_customertwo 
src 
⌞CjwNetwork 
⌞SiteCustomerBundle <-- each customer has its own bundle 
⌞SiteCustomertwoBundle 
#ezsummer 
51/64 
Learnings from Real eZ Publish 5 Projects 
51 von 64 05.09.14 08:31
Multi-Site-Setup (old) Detail ezpublish_legacy 
ezpublish_legacy 
⌞extension 
⌞site_customer <-- each customer has its own extension 
⌞classes 
⌞design 
⌞modules 
⌞settings 
⌞site.ini 
⌞[DatabaseSettings] <-- each customer has its own database 
⌞Database=database_site_customer 
⌞site_customertwo 
⌞[...] 
⌞settings 
⌞site.ini 
⌞[DatabaseSettings] 
⌞Database=database_site_customertwo 
⌞var 
⌞site_customer <-- each customer has its own var directory 
⌞site_customertwo 
#ezsummer 
52/64 
Learnings from Real eZ Publish 5 Projects 
52 von 64 05.09.14 08:31
Detail site_customer App - Multi-Site-Setup (old) 
site_customer 
⌞autoload.php 
⌞bootstrap.php.cache 
⌞cache 
⌞check.php 
⌞config <-- all yml files like ezpublish folder, (to improve) 
⌞config.yml 
⌞ezpublish.yml 
⌞ parameters.yml 
⌞console 
⌞logs 
⌞phpunit.xml.dist 
⌞Resources 
⌞sessions 
⌞SiteCjwbaseCache.php 
⌞SiteCjwbaseKernel.php 
⌞SymfonyRequirements.php 
#ezsummer 
53/64 
Learnings from Real eZ Publish 5 Projects 
53 von 64 05.09.14 08:31
Scripts on Shell - Multi-Site-Setup (old) 
# Generate symlinks 
php site_customer/console assets:install --symlink web 
php site_customer/console ezpublish:legacy:assets_install --symlink web 
# Clear Cache 
php site_customer/console --env=prod cache:clear 
# Dump assets 
php site_customer/console assetic:dump --env=prod web 
# Run cronjobs 
php site_customer/console ezpublish:legacy:script runcronjobs.php --siteaccess customer_user_de cjw_newsletter 
#ezsummer 
BASH 
54/64 
Learnings from Real eZ Publish 5 Projects 
54 von 64 05.09.14 08:31
Multiple Apps: Multi-Site-Setup (old) 
You can use one development environment with many projects 
You can use one or more production servers or 
easily check out customer to different servers 
all customer are encapsulated apps 
solid and proven for more than 1,5 years 
Examples ... 
#ezsummer 
· 
· 
· 
· 
· 
· 
55/64 
Learnings from Real eZ Publish 5 Projects 
55 von 64 05.09.14 08:31
Introducing CJW MultiSiteBundle 
Although the first approach works fine, it has several drawbacks: 
Application code scattered at different places (site directory, bundle, legacy 
extension), hard to maintain in VCS, hard to deploy 
Redundancy in config files 
No global settings 
No central site activation/administration 
Goal: keep everything in one place! 
#ezsummer 
· 
· 
· 
· 
· 
56/64 
Learnings from Real eZ Publish 5 Projects 
56 von 64 05.09.14 08:31
CJW MultiSiteBundle Features 
Boots kernel and environment based on domain name mappings 
Handles local, staging and live domain names 
Allows for global activation of bundles 
Allows for global settings 
Provides a common console for all sites 
Caches domain name mappings 
Moves cache and log files away from the ezpublish folder 
more to come ... 
#ezsummer 
· 
· 
· 
· 
· 
· 
· 
· 
57/64 
Learnings from Real eZ Publish 5 Projects 
57 von 64 05.09.14 08:31
cjwpublish Directory 
The cjwpublish application directory sits next to the ezpublish directory. 
cjwpublish 
⌞ config 
cjwpublish.yml <-- defines active bundles 
config.yml <-- allows for global settings 
CjwPublishKernel.php <-- inherits from CjwMultiSiteKernel.php 
CjwPublishCache.php <-- inherits from CjwMultiSiteCache.php 
console 
#ezsummer 
58/64 
Learnings from Real eZ Publish 5 Projects 
58 von 64 05.09.14 08:31
Symfony's app directory is back 
Site Bundle Directory Layout 
src 
⌞ Cjw 
⌞ SiteExampleBundle 
⌞ app 
⌞ config 
cjwpublish.yml <-- contains domain mappings 
config.yml 
ezpublish.yml 
... 
CjwSiteExampleKernel.php <-- inherits from CjwPublishKernel.php 
CjwSiteExampleCache.php <-- inherits from CjwPublishCache.php 
⌞ Controller 
... 
#ezsummer 
59/64 
Learnings from Real eZ Publish 5 Projects 
59 von 64 05.09.14 08:31
Caveats 
Adjustments needed in config.yml to reflect different relative location of kernel 
assetic: 
... 
read_from: %kernel.root_dir%/../../../../web 
write_to: %kernel.root_dir%/../../../../web 
... 
ez_publish_legacy: 
... 
root_dir: %kernel.root_dir%/../../../../ezpublish_legacy 
parameters: 
ezpublish.kernel.root_dir: %kernel.root_dir%/../../../../vendor/ezsystems/ezpublish-kernel 
More problems of this kind expected! 
#ezsummer 
YML 
60/64 
Learnings from Real eZ Publish 5 Projects 
60 von 64 05.09.14 08:31
Project Status 
Currently in private Beta, not yet released 
Ideas and Feedback welcome 
Public Beta in October 
info@cjw-network.com 
https://github.com/cjw-network/MultiSiteBundle 
#ezsummer 
· 
· 
· 
· 
· 
61/64 
Learnings from Real eZ Publish 5 Projects 
61 von 64 05.09.14 08:31
Ressources 
Slides as PDF 
see src/Cjw/SummerCampBundle/Resources/doc/learnings.pdf 
https://github.com/cjw-network/SummerCampBundle/Resources 
/doc/learnings.pdf 
Slides (Source) 
CJW MultiSiteBundle 
#ezsummer 
· 
· 
https://github.com/dfritschy/cjw-· summercamp-slides 
https://github.com/cjw-network/MultiSiteBundle 
info@cjw-network.com 
· 
· 
62/64 
Learnings from Real eZ Publish 5 Projects 
62 von 64 05.09.14 08:31
Learnings from Real eZ Publish 5 Projects 
http://vote.netgenlabs.com/ 
Please Vote! 
63 von 64 05.09.14 08:31
Learnings from Real eZ Publish 5 Projects 
<Thank You!> 
Ekkehard Dörre 
http://share.ez.no/community/profile/7431 
@ekkeD 
http://www.coolscreen.de 
Donat Fritschy 
https://github.com/dfritschy 
http://share.ez.no/community/profile/10451 
@webmanufaktur 
http://www.webmanufaktur.ch 
64 von 64 05.09.14 08:31

Weitere ähnliche Inhalte

Was ist angesagt?

Ansible automation tool with modules
Ansible automation tool with modulesAnsible automation tool with modules
Ansible automation tool with modulesmohamedmoharam
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Symfony finally swiped right on envvars
Symfony finally swiped right on envvarsSymfony finally swiped right on envvars
Symfony finally swiped right on envvarsSam Marley-Jarrett
 
Rabbits, indians and... Symfony meets queueing brokers
Rabbits, indians and...  Symfony meets queueing brokersRabbits, indians and...  Symfony meets queueing brokers
Rabbits, indians and... Symfony meets queueing brokersGaetano Giunta
 
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...Alexander Lisachenko
 
Debugging webOS applications
Debugging webOS applicationsDebugging webOS applications
Debugging webOS applicationsfpatton
 
Internals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptInternals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptfpatton
 
Puppet for SysAdmins
Puppet for SysAdminsPuppet for SysAdmins
Puppet for SysAdminsPuppet
 
How to deploy PHP projects with docker
How to deploy PHP projects with dockerHow to deploy PHP projects with docker
How to deploy PHP projects with dockerRuoshi Ling
 
Ansible + WordPress
Ansible + WordPressAnsible + WordPress
Ansible + WordPressAlan Lok
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with ComposerAdam Englander
 
Learn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VMLearn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VMKumaran Balachandran
 
Remote Control WordPress
Remote Control WordPressRemote Control WordPress
Remote Control WordPressEdmund Turbin
 
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...Sebastian Neubauer
 
Create your own composer package
Create your own composer packageCreate your own composer package
Create your own composer packageLattapon Yodsuwan
 
Composer | PHP Dependency Manager
Composer | PHP Dependency ManagerComposer | PHP Dependency Manager
Composer | PHP Dependency ManagerUjjwal Ojha
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Michele Orselli
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Michele Orselli
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java binOlve Hansen
 

Was ist angesagt? (20)

Ansible automation tool with modules
Ansible automation tool with modulesAnsible automation tool with modules
Ansible automation tool with modules
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Symfony finally swiped right on envvars
Symfony finally swiped right on envvarsSymfony finally swiped right on envvars
Symfony finally swiped right on envvars
 
Rabbits, indians and... Symfony meets queueing brokers
Rabbits, indians and...  Symfony meets queueing brokersRabbits, indians and...  Symfony meets queueing brokers
Rabbits, indians and... Symfony meets queueing brokers
 
Ansible 2.2
Ansible 2.2Ansible 2.2
Ansible 2.2
 
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
 
Debugging webOS applications
Debugging webOS applicationsDebugging webOS applications
Debugging webOS applications
 
Internals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptInternals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScript
 
Puppet for SysAdmins
Puppet for SysAdminsPuppet for SysAdmins
Puppet for SysAdmins
 
How to deploy PHP projects with docker
How to deploy PHP projects with dockerHow to deploy PHP projects with docker
How to deploy PHP projects with docker
 
Ansible + WordPress
Ansible + WordPressAnsible + WordPress
Ansible + WordPress
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
 
Learn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VMLearn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VM
 
Remote Control WordPress
Remote Control WordPressRemote Control WordPress
Remote Control WordPress
 
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
 
Create your own composer package
Create your own composer packageCreate your own composer package
Create your own composer package
 
Composer | PHP Dependency Manager
Composer | PHP Dependency ManagerComposer | PHP Dependency Manager
Composer | PHP Dependency Manager
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 

Andere mochten auch

Digitales
DigitalesDigitales
DigitalesCD2000
 
Orientacion educativados2012
Orientacion educativados2012Orientacion educativados2012
Orientacion educativados2012blognms
 
Listas de clase_por_unidades 2015-16
Listas de clase_por_unidades 2015-16Listas de clase_por_unidades 2015-16
Listas de clase_por_unidades 2015-16Miguel Rojas
 
Presentación in mode español
Presentación in mode españolPresentación in mode español
Presentación in mode españolDesplayte s.l
 
Sample statement of work
Sample statement of workSample statement of work
Sample statement of workAlisa DeHoyos
 
Asassn 15ih a_highly_super_luminous_supernova
Asassn 15ih a_highly_super_luminous_supernovaAsassn 15ih a_highly_super_luminous_supernova
Asassn 15ih a_highly_super_luminous_supernovaSérgio Sacani
 
D:\Boletin Oficial-9 08 10
D:\Boletin Oficial-9 08 10D:\Boletin Oficial-9 08 10
D:\Boletin Oficial-9 08 10diluro
 
Patrick Steyart, Discovery Kanban - канбан открытий
Patrick Steyart, Discovery Kanban - канбан открытийPatrick Steyart, Discovery Kanban - канбан открытий
Patrick Steyart, Discovery Kanban - канбан открытийScrumTrek
 
3 pres avance_protocolos_con_eeuu ica
3 pres avance_protocolos_con_eeuu ica3 pres avance_protocolos_con_eeuu ica
3 pres avance_protocolos_con_eeuu icaProColombia
 
Jornada de Genealogia 2008 - Parte 1 de 2
Jornada de Genealogia 2008 - Parte 1 de 2Jornada de Genealogia 2008 - Parte 1 de 2
Jornada de Genealogia 2008 - Parte 1 de 2cacw
 

Andere mochten auch (20)

Doc asesor fincas
Doc asesor fincasDoc asesor fincas
Doc asesor fincas
 
Digitales
DigitalesDigitales
Digitales
 
Orientacion educativados2012
Orientacion educativados2012Orientacion educativados2012
Orientacion educativados2012
 
140926 programa jornada tdah
140926 programa jornada tdah140926 programa jornada tdah
140926 programa jornada tdah
 
RDS - Presse Nationale 2013
RDS - Presse Nationale 2013RDS - Presse Nationale 2013
RDS - Presse Nationale 2013
 
Listas de clase_por_unidades 2015-16
Listas de clase_por_unidades 2015-16Listas de clase_por_unidades 2015-16
Listas de clase_por_unidades 2015-16
 
Seeking angel capital dos and donts
Seeking angel capital  dos and dontsSeeking angel capital  dos and donts
Seeking angel capital dos and donts
 
Presentación in mode español
Presentación in mode españolPresentación in mode español
Presentación in mode español
 
Sample statement of work
Sample statement of workSample statement of work
Sample statement of work
 
Asassn 15ih a_highly_super_luminous_supernova
Asassn 15ih a_highly_super_luminous_supernovaAsassn 15ih a_highly_super_luminous_supernova
Asassn 15ih a_highly_super_luminous_supernova
 
Spam profilaktyka-i-obrona
Spam profilaktyka-i-obronaSpam profilaktyka-i-obrona
Spam profilaktyka-i-obrona
 
1 mocc book
1 mocc book1 mocc book
1 mocc book
 
D:\Boletin Oficial-9 08 10
D:\Boletin Oficial-9 08 10D:\Boletin Oficial-9 08 10
D:\Boletin Oficial-9 08 10
 
Patrick Steyart, Discovery Kanban - канбан открытий
Patrick Steyart, Discovery Kanban - канбан открытийPatrick Steyart, Discovery Kanban - канбан открытий
Patrick Steyart, Discovery Kanban - канбан открытий
 
3 pres avance_protocolos_con_eeuu ica
3 pres avance_protocolos_con_eeuu ica3 pres avance_protocolos_con_eeuu ica
3 pres avance_protocolos_con_eeuu ica
 
E learning and design concepts
E learning and design conceptsE learning and design concepts
E learning and design concepts
 
10 autoinmunidad
10 autoinmunidad10 autoinmunidad
10 autoinmunidad
 
Migraña y variantes
Migraña y variantesMigraña y variantes
Migraña y variantes
 
Jornada de Genealogia 2008 - Parte 1 de 2
Jornada de Genealogia 2008 - Parte 1 de 2Jornada de Genealogia 2008 - Parte 1 de 2
Jornada de Genealogia 2008 - Parte 1 de 2
 
Fort Drum Post Guide
Fort Drum Post GuideFort Drum Post Guide
Fort Drum Post Guide
 

Ähnlich wie Learnings from Real eZ Publish 5 Projects

eZ publish 5[-alpha1] Introduction & Architecture
eZ publish 5[-alpha1] Introduction & ArchitectureeZ publish 5[-alpha1] Introduction & Architecture
eZ publish 5[-alpha1] Introduction & ArchitectureAndré Rømcke
 
How to start with eZ Publish 5
How to start with eZ Publish 5How to start with eZ Publish 5
How to start with eZ Publish 5Donat Fritschy
 
Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017Mohamad Hassan
 
Designing scalable application: from umbrella project to distributed system -...
Designing scalable application: from umbrella project to distributed system -...Designing scalable application: from umbrella project to distributed system -...
Designing scalable application: from umbrella project to distributed system -...Elixir Club
 
Writing Ansible Modules (DENOG11)
Writing Ansible Modules (DENOG11)Writing Ansible Modules (DENOG11)
Writing Ansible Modules (DENOG11)Martin Schütte
 
DSD-INT 2022 Singularity containers - simplifying the use of Delft3D FM on Hi...
DSD-INT 2022 Singularity containers - simplifying the use of Delft3D FM on Hi...DSD-INT 2022 Singularity containers - simplifying the use of Delft3D FM on Hi...
DSD-INT 2022 Singularity containers - simplifying the use of Delft3D FM on Hi...Deltares
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction PresentationNerd Tzanetopoulos
 
6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptx6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptxSimRelokasi2
 
MongoDB and AWS Best Practices
MongoDB and AWS Best PracticesMongoDB and AWS Best Practices
MongoDB and AWS Best PracticesMongoDB
 
V mware
V mwareV mware
V mwaredvmug1
 
Puppet Primer, Robbie Jerrom, Solution Architect VMware
Puppet Primer, Robbie Jerrom, Solution Architect VMwarePuppet Primer, Robbie Jerrom, Solution Architect VMware
Puppet Primer, Robbie Jerrom, Solution Architect VMwaresubtitle
 
Survey of Container Build Tools
Survey of Container Build ToolsSurvey of Container Build Tools
Survey of Container Build ToolsMichael Ducy
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkRyan Weaver
 
OpenNebula, the foreman and CentOS play nice, too
OpenNebula, the foreman and CentOS play nice, tooOpenNebula, the foreman and CentOS play nice, too
OpenNebula, the foreman and CentOS play nice, tooinovex GmbH
 
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbersDefcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbersAlexandre Moneger
 
Php7 extensions workshop
Php7 extensions workshopPhp7 extensions workshop
Php7 extensions workshopjulien pauli
 

Ähnlich wie Learnings from Real eZ Publish 5 Projects (20)

eZ publish 5[-alpha1] Introduction & Architecture
eZ publish 5[-alpha1] Introduction & ArchitectureeZ publish 5[-alpha1] Introduction & Architecture
eZ publish 5[-alpha1] Introduction & Architecture
 
How to start with eZ Publish 5
How to start with eZ Publish 5How to start with eZ Publish 5
How to start with eZ Publish 5
 
eZ Publish 5 in depth inspection
eZ Publish 5 in depth inspectioneZ Publish 5 in depth inspection
eZ Publish 5 in depth inspection
 
Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017
 
Terrific Composer Workshop
Terrific Composer WorkshopTerrific Composer Workshop
Terrific Composer Workshop
 
Designing scalable application: from umbrella project to distributed system -...
Designing scalable application: from umbrella project to distributed system -...Designing scalable application: from umbrella project to distributed system -...
Designing scalable application: from umbrella project to distributed system -...
 
Writing Ansible Modules (DENOG11)
Writing Ansible Modules (DENOG11)Writing Ansible Modules (DENOG11)
Writing Ansible Modules (DENOG11)
 
DSD-INT 2022 Singularity containers - simplifying the use of Delft3D FM on Hi...
DSD-INT 2022 Singularity containers - simplifying the use of Delft3D FM on Hi...DSD-INT 2022 Singularity containers - simplifying the use of Delft3D FM on Hi...
DSD-INT 2022 Singularity containers - simplifying the use of Delft3D FM on Hi...
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction Presentation
 
6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptx6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptx
 
Modularity problems
Modularity  problemsModularity  problems
Modularity problems
 
MongoDB and AWS Best Practices
MongoDB and AWS Best PracticesMongoDB and AWS Best Practices
MongoDB and AWS Best Practices
 
V mware
V mwareV mware
V mware
 
Puppet Primer, Robbie Jerrom, Solution Architect VMware
Puppet Primer, Robbie Jerrom, Solution Architect VMwarePuppet Primer, Robbie Jerrom, Solution Architect VMware
Puppet Primer, Robbie Jerrom, Solution Architect VMware
 
Building For Mer
Building For MerBuilding For Mer
Building For Mer
 
Survey of Container Build Tools
Survey of Container Build ToolsSurvey of Container Build Tools
Survey of Container Build Tools
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 Framework
 
OpenNebula, the foreman and CentOS play nice, too
OpenNebula, the foreman and CentOS play nice, tooOpenNebula, the foreman and CentOS play nice, too
OpenNebula, the foreman and CentOS play nice, too
 
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbersDefcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbers
 
Php7 extensions workshop
Php7 extensions workshopPhp7 extensions workshop
Php7 extensions workshop
 

Kürzlich hochgeladen

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 

Kürzlich hochgeladen (20)

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 

Learnings from Real eZ Publish 5 Projects

  • 1. Learnings from Real eZ Publish 5 Projects 1 von 64 05.09.14 08:31
  • 2. Learnings from Real eZ Publish 5 Projects Learnings from Real eZ Publish 5 Projects Donat Fritschy - Webmanufaktur Ekkehard Dörre - Coolscreen 2 von 64 05.09.14 08:31
  • 3. Presenters Donat is owner of Webmanufaktur, a full service web agency in Switzerland. He works as projects manager, software architect and developer and likes thinking outside of the box. In the last year he has been involved in major eZ 5 projects. Ekke is a consultant with deep knowledge in eZ Publish 4 and 5, eZ Find / Apache Solr and with a faible for coming cutting edge web technologies. He is one of the organizers of the PHP Unconference since eight years. Members of CJW Network #ezsummer · · · 3/64 Learnings from Real eZ Publish 5 Projects 3 von 64 05.09.14 08:31
  • 4. Learnings from Real eZ Publish 5 Projects Last year we have presented our Cookbook... ... today you get a Ratatouille ;-) Let's share the experiences you and we made in the last year! http://de.slideshare.net/dfritschy/how-to-start-with-ez-publish-5 https://github.com/dfritschy/cjw-cookbook #ezsummer · · · · · 4/64 Learnings from Real eZ Publish 5 Projects 4 von 64 05.09.14 08:31
  • 5. Who is in the audience? Who is coming from the eZ World? Who is coming from the Symfony World? Who has realized eZ Publish 5 sites (productive)? Who has realized pure eZ Publish 5 sites (no legacy)? #ezsummer · · · · 5/64 Learnings from Real eZ Publish 5 Projects 5 von 64 05.09.14 08:31
  • 6. Agenda Things we would like to discuss: Good Practice ez View Cache vs. HTTP Cache Debugging Pitfalls MultiSite Setup #ezsummer · · · · · 6/64 Learnings from Real eZ Publish 5 Projects 6 von 64 05.09.14 08:31
  • 7. Learnings from Real eZ Publish 5 Projects Good Practice 7 von 64 05.09.14 08:31
  • 8. Team up with a Symfony Crack To be honest: as eZ 4 developers, we are complete novices in eZ 5 It's easier for a Smyfony Crack to learn eZ than other way round Symfony community is hungry for a CMS, so watch out for new competition But @Symfony cracks: It's not easy: an eZ Publish and CMS expert will reduce your risk And will make your content architecture better and more maintainable #ezsummer · · · · · 8/64 Learnings from Real eZ Publish 5 Projects 8 von 64 05.09.14 08:31
  • 9. Think in MVC A radical different thinking eZ 4 mangled all together in the TPL -> the view implemented the logic (fetch) Symfony enforces a clean separation, from routing to the controller to the rendering of the view #ezsummer · · · 9/64 Learnings from Real eZ Publish 5 Projects 9 von 64 05.09.14 08:31
  • 10. Learnings from Real eZ Publish 5 Projects MVC Blackbox #ezsummer 10/64 10 von 64 05.09.14 08:31
  • 11. Think in Bundles What is a bundle? Use a least one bundle per site Split your application in different bundles (site specific, functional, ...) Reuse your code: create and maintain with love a Base Bundle with general functions Refactor it frequently as you learn and the product evolves Creating bundles is easy, don't work in the DemoBundle ;-) #ezsummer · · · · · · $ php ezpublish/console generate:bundle BASH 11/64 Learnings from Real eZ Publish 5 Projects 11 von 64 05.09.14 08:31
  • 12. Organize your config files The standard eZ installation is a mess... ... and the DemoBundle is only slowly becoming a source of good practice How do YOU handle this? keep config in ezpublish/config as general as possible it should merely describe your environment, not the application move all site/function specific settings to the bundle #ezsummer · · · 12/64 Learnings from Real eZ Publish 5 Projects 12 von 64 05.09.14 08:31
  • 13. Keep ezpublish.yml small (1) ezpublish/config/ezpublish.yml imports: - {resource: "@CjwExampleBundle/Resources/config/ezpublish.yml"} ezpublish: siteaccess: default_siteaccess:%cjw.site%_user list: groups: #ezsummer default_group: match: CjwMultiSiteBundleMatcherMapHost: www.%cjw.site%.ch: %cjw.site%_user admin.%cjw.site%.ch: %cjw.site%_admin repositories: default_repository: engine: legacy connection: default_connection YML 13/64 Learnings from Real eZ Publish 5 Projects 13 von 64 05.09.14 08:31
  • 14. Keep ezpublish.yml small (2) system: default_group: #ezsummer repository: default_repository var_dir: var/%cjw.site% languages: - ger-DE %cjw.site%_user: legacy_mode: false languages: - ger-DE content: view_cache: true ttl_cache: true default_ttl: 3600 %cjw.site%_admin: legacy_mode: true ... stash: ... YML 14/64 Learnings from Real eZ Publish 5 Projects 14 von 64 05.09.14 08:31
  • 15. Keep ezpublish.yml small (3) Can even be shorter - get inspiration from https://github.com/lolautruche /metalfrance Extras: use parameters standardize site access names, groups, repository names ezpublish/config/parameters.yml Note: prepending configuration does not work well with parameters #ezsummer · · parameters: ... cjw.site: frb YML 15/64 Learnings from Real eZ Publish 5 Projects 15 von 64 05.09.14 08:31
  • 16. Config Files in Bundle We keep them in a separate directory and name them as in good old eZ... ExampleBundle ⌞ Resources ⌞ config ⌞ ezpublish image.yml override.yml ezpublish.yml <-- includes files from ./ezpublish parameters.yml routing.yml services.yml #ezsummer 16/64 Learnings from Real eZ Publish 5 Projects 16 von 64 05.09.14 08:31
  • 17. Controllers After several tries, we ended up with... Basically one controller per full view Separate controllers for navigation etc. Consider caching (TTL, X-Location Header) Recommended: Move business logic to separate model Retrieve all needed data (location, children, ...) Prepare the data for easy processing in the templates #ezsummer · · · · · · 17/64 Learnings from Real eZ Publish 5 Projects 17 von 64 05.09.14 08:31
  • 18. Ways to Fetch Content LocationService::loadLocation( $id ) --> location ContentService::loadContent( $id ) --> content SearchService::findContent( $query ) --> list of content SearchService::findLocations( $query ) --> list of location LocationService::loadLocationChildren( $location ) --> list of location Legacy fetch functions #ezsummer · · · · · · 18/64 Learnings from Real eZ Publish 5 Projects 18 von 64 05.09.14 08:31
  • 19. SearchService::findContent() The only SearchService function you will find in DemoBundle ... returns full content objects with ALL attributes in ALL languages does not work well with multiple locations no as_objects flag as in eZ 4 scales very badly fetching a content tree with 116 locations took 30 seconds most of the time is spent in manipulating the SQL result in PHP Another test: 24 hits, PHP array 44'880 rows with 39 elements each, highly redundant http://share.ez.no/blogs/donat-fritschy/searchservice-performance #ezsummer · · · · · · · · 19/64 Learnings from Real eZ Publish 5 Projects 19 von 64 05.09.14 08:31
  • 20. SearchService::findLocations() Available from 2014.05 / 5.3 only Roughly equivalent to good old fetch( 'content', 'list' ) returns location objects with contentInfo only usually sufficient for building a menu use ContentService::loadContent() to fetch whole object Performance lower than legacy, but acceptable fetching a content tree with 116 locations took < 1 second scales very well #ezsummer · · · · · · 20/64 Learnings from Real eZ Publish 5 Projects 20 von 64 05.09.14 08:31
  • 21. Learnings from Real eZ Publish 5 Projects LocationService::loadLocationChildren() Think of LocationService::loadLocationChildren() as primarily intended for administration interface. Has no filtering capabilities. Further reading: http://www.netgenlabs.com/Blog/Fetching-content-in-eZ-Publish-5-using-Search-service #ezsummer 21/64 21 von 64 05.09.14 08:31
  • 22. Legacy Fetch Functions use eZFunctionHandler; ... $mySearchResults = $this->getLegacyKernel()->runCallback( function () use ( $searchPhrase, $sort, $contentTypeIdenfiers ) { // eZFunctionHandler::execute is the equivalent for a legacy template fetch function // The following is the same than fetch( 'ezfind', 'search', hash(...) ) return eZFunctionHandler::execute( #ezsummer 'ezfind', 'search', array( 'query' => $searchPhrase, 'sort_by' => $sort, 'class_id' => $contentTypeIdenfiers ) ); } ); PHP 22/64 Learnings from Real eZ Publish 5 Projects 22 von 64 05.09.14 08:31
  • 23. Templates How to transform a full view TPL with children to Symfony? full/folder.tpl <h1>{$node.data_map.title.content|wash()}</h1> {attribute_view_gui attribute=$node.data_map.short_description} ... {def $list_items=fetch( 'content', 'list', ... ) ) } {foreach $list_items as $child} {node_view_gui view=line content_node=$child} {/foreach} #ezsummer TPL 23/64 Learnings from Real eZ Publish 5 Projects 23 von 64 05.09.14 08:31
  • 24. Moving to TWIG Resources/view/full.html.twig <h1>{{ ez_render_field( content, 'title') }}</h1> {{ ez_render_field( content, 'short_description') }} ... {{ render( controller( "CjwBaseBundle:Default:subItems", {'locationId': location.id }) ) }} Controller/DefaultController.php #ezsummer TWIG public function subItemsAction( $locationId ) { $response = new Response; $locationList = $this->fetchLocationListIncludingContentTypes( $locationId, array() ); return $this->render( "CjwBaseBundle::sub_items.html.twig", array( "locationList" => $locationList ), $response ); } PHP 24/64 Learnings from Real eZ Publish 5 Projects 24 von 64 05.09.14 08:31
  • 25. Moving to TWIG Resources/view/sub_items.html.twig {% for location in locationList %} {{ render( controller( 'ez_content:viewLocation', {'locationId': location.id, 'viewType': 'line'} )) }} {% endfor %} #ezsummer TWIG 25/64 Learnings from Real eZ Publish 5 Projects 25 von 64 05.09.14 08:31
  • 26. Our approach Basically one template per full view Render children directly in the full view template Generalized full and line view templates for the easy stuff #ezsummer · · · 26/64 Learnings from Real eZ Publish 5 Projects 26 von 64 05.09.14 08:31
  • 27. How to organize Templates? The Symfony way... views ⌞ Customer CustomerDetail.html.twig ⌞ Product The classic eZ way... views ⌞ full customer.html.twig ⌞ line Two approaches, both valid. Follow your taste. #ezsummer 27/64 Learnings from Real eZ Publish 5 Projects 27 von 64 05.09.14 08:31
  • 28. Learnings from Real eZ Publish 5 Projects eZ View Cache vs. HTTP Caching 28 von 64 05.09.14 08:31
  • 29. eZ View Caching (Legacy) When the pagelayout is rendered, the {$module_result.content} part will be replaced with the actual output. If view caching is enabled, the entire result of the module will be cached. This means that the contents of the "module_result" variable will be put into a cache file (...) When a new version (...) of an object is published, the system will automatically clear the view cache for the following items: All published nodes of the object The parent nodes Related nodes (keywords, object relations) https://doc.ez.no/eZ-Publish/Technical-manual/4.x/Features/View-caching #ezsummer · · · 29/64 Learnings from Real eZ Publish 5 Projects 29 von 64 05.09.14 08:31
  • 30. HTTP Expiration and Validation (Symfony) The HTTP specification defines two caching models: With the expiration model, you simply specify how long a response should be considered "fresh" by including a Cache-Control and/or an Expires header. Caches that understand expiration will not make the same request until the cached version reaches its expiration time and becomes "stale"; When pages are really dynamic (i.e. their representation changes often), the validation model is often necessary. With this model, the cache stores the response, but asks the server on each request whether or not the cached response is still valid. The application uses a unique response identifier (the Etag header) and/or a timestamp (the Last-Modified header) to check if the page has changed since being cached. http://symfony.com/doc/current/book/http_cache.html #ezsummer · · 30/64 Learnings from Real eZ Publish 5 Projects 30 von 64 05.09.14 08:31
  • 31. In Short (and much simplified...) eZ View Cache caches content and content fragments Standard TTL is 2 hours Is purged on content modifications (with smart cache clearing rules) Symfony's HTTP Cache caches requests Let's dive in a bit deeper... #ezsummer · · eZ uses Expiration model by default Standard TTL is 60 seconds (86400 for tree menu!) Symfony Cache is purged from backend · · · 31/64 Learnings from Real eZ Publish 5 Projects 31 von 64 05.09.14 08:31
  • 32. ez 4 Cache Directives Code from ezpublish_legacy/kernel/private/classes/ezpkernelweb.php // send header information foreach ( eZHTTPHeader::headerOverrideArray( $this->uri ) + array( 'Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT', 'Last-Modified' => gmdate( 'D, d M Y H:i:s' ) . ' GMT', 'Cache-Control' => 'no-cache, must-revalidate', 'Pragma' => 'no-cache', ... ) as $key => $value This guarantees that every request is handled by eZ #ezsummer ){ header( $key . ': ' . $value ); } PHP 32/64 Learnings from Real eZ Publish 5 Projects 32 von 64 05.09.14 08:31
  • 33. eZ 5 Cache Directives Code from vendor/ezsystems/demobundle/EzSystems/DemoBundle /Controller/DemoController.php // Setting HTTP cache for the response to be public and with a TTL of 1 day. $response = new Response; $response->setPublic(); $response->setSharedMaxAge( 86400 ); // Menu will expire when top location cache expires. $response->headers->set( 'X-Location-Id', $rootLocationId ); // Menu might vary depending on user permissions, so make the cache vary on the user hash. $response->setVary( 'X-User-Hash' ); This effectively sets the Response free, out of the reach of eZ #ezsummer PHP 33/64 Learnings from Real eZ Publish 5 Projects 33 von 64 05.09.14 08:31
  • 34. Emulating eZ 4 Cache behaviour in eZ 5 This patch to index.php disables client and proxy caching without sacrificing the benefits of the Symfony HTTP cache. Use at own risk! $response = $kernel->handle( $request ); // Emulate eZ 4 cache control $response->headers->set( 'Cache-Control', 'no-cache, must-revalidate' ); $response->send(); $kernel->terminate( $request, $response ); #ezsummer PHP 34/64 Learnings from Real eZ Publish 5 Projects 34 von 64 05.09.14 08:31
  • 35. Cache Recommendations Read the specifications Use Shared Caches with caution Cave: setTtl() vs. setClientTtl Set TTL as high as possible Use Varnish http://tools.ietf.org/html/rfc2616#page-74 https://www.mnot.net/cache_docs/ #ezsummer · · · · · · · 35/64 Learnings from Real eZ Publish 5 Projects 35 von 64 05.09.14 08:31
  • 36. Cache per User - User Hash Definer src/Cjw/SiteCustomerBundle/Identity/UserHashDefiner.php namespace CjwSiteCustomerBundleIdentity; use eZPublishSPIUserIdentityAware; use eZPublishSPIUserIdentity; use eZPublishAPIRepositoryRepository; class UserHashDefiner implements IdentityAware { private $repository; public function __construct(Repository $repository) { $this->repository = $repository; } public function setIdentity(Identity $identity) { $current_user = $this->repository->getCurrentUser(); $identity->setInformation('UserID', $current_user->contentInfo->id); } #ezsummer } PHP 36/64 Learnings from Real eZ Publish 5 Projects 36 von 64 05.09.14 08:31
  • 37. Cache per User - yml config src/Cjw/SiteCustomerBundle/Ressources/config/services.yml parameters: cjw_site_customer.user_hash_definer.class: CjwSiteCustomerBundleIdentityUserHashDefiner services: cjw_site_customer.user_hash_definer: class: %cjw_site_customer.user_hash_definer.class% tags: - { name: ezpublish.identity_definer } arguments: [@ezpublish.api.repository] #ezsummer YML 37/64 Learnings from Real eZ Publish 5 Projects 37 von 64 05.09.14 08:31
  • 38. Cache per User - Controller src/Cjw/SiteCustomerBundle/Controller/CjwController.php public function sectionInternalAction($locationId, $viewType, $layout = false, array $params { $response = new Response(); $response->setPrivate(); $response->headers->set('X-Location-Id', $locationId); $response->setVary('X-User-Hash'); return $response; } #ezsummer PHP 38/64 Learnings from Real eZ Publish 5 Projects 38 von 64 05.09.14 08:31
  • 39. Cache per User - Location View Configuration src/Cjw/SiteCustomerBundle/Ressources/config/ezpublish /override.yml system: customer_user_de: location_view: #ezsummer full: section_internal: controller: "CjwSiteCustomerBundle:Cjw:sectionInternal" match: IdentifierSection: internal YML 39/64 Learnings from Real eZ Publish 5 Projects 39 von 64 05.09.14 08:31
  • 40. Learnings from Real eZ Publish 5 Projects Debugging Coping with blank screens 40 von 64 05.09.14 08:31
  • 41. Blank screen, "503 Service not available" PHP errors (Syntax error, Memory, Outdated Autoloads, ...) Configuration errors (DB connection, ...) Switch to DEV mode for better debugging Check the log files Check write permissions on log files! #ezsummer · · · · Apache/PHP Log ezpublish/logs/<env>.log ezpublish_legacy/var/log/* ezpublish_legacy/var/<siteaccess>/log/* · 41/64 Learnings from Real eZ Publish 5 Projects 41 von 64 05.09.14 08:31
  • 42. TwigBundle:Exception:error500.html.twig NEVER a Twig error! Caused by response 500 "Internal Server Error" and missing error template Checks as before #ezsummer · · · 42/64 Learnings from Real eZ Publish 5 Projects 42 von 64 05.09.14 08:31
  • 43. Twig Exception: Invalid variation "<variation>" Caused by problems when accessing images Check if the file exists Check permissions on ezpublish_legacy/var/<siteaccess>/storage Check log files Clear cache #ezsummer · · · · 43/64 Learnings from Real eZ Publish 5 Projects 43 von 64 05.09.14 08:31
  • 44. Class 'ezxFormToken' not found Usually found with fresh installations involving legacy extensions Regenerate Autoloads #ezsummer · · $ cd ezpublish_legacy $ php bin/php/ezpgenerateautoloads.php -e -p BASH 44/64 Learnings from Real eZ Publish 5 Projects 44 von 64 05.09.14 08:31
  • 45. Learnings from Real eZ Publish 5 Projects Pitfalls Avoid the traps... 45 von 64 05.09.14 08:31
  • 46. Memory limit exceeded in DEV mode DEV mode takes a lot of memory Stash Logging is the worst Disable Stash Logging in ezpublish.yml #ezsummer · · · stash: logging: false caches: default: handlers: - FileSystem inMemory: true registerDoctrineAdapter: false YML 46/64 Learnings from Real eZ Publish 5 Projects 46 von 64 05.09.14 08:31
  • 47. 414 Request-URI Too Long When doing subrequests, particularly ESI or Hinclude ones, current SiteAccess is transmitted in a serialized form, with its matcher. With a large number of configured SiteAccesses using MapHost or MapURI matcher (around 40, which is not uncommon for a multi-national, multi-lingual site) the URL can exceed the size of 8192 Bytes which most servers accept. As a result, the ESI/Hinclude call fails. Fixed in Version 5.3.3 (2014.07) https://jira.ez.no/browse/EZP-23168 https://github.com/ezsystems/ezpublish-kernel/pull/949 #ezsummer · · · 47/64 Learnings from Real eZ Publish 5 Projects 47 von 64 05.09.14 08:31
  • 48. Learnings from Real eZ Publish 5 Projects Multi-Site/Multi-Repository Setup 48 von 64 05.09.14 08:31
  • 49. Why a Multi-Site/Multi-Repository Setup? At CJW Network we have developed a multi-site/multi-repository setup for eZ Publish 4 several years ago This allows us to host many individual sites on a single eZ Publish installation Advantages: Disadvantages: #ezsummer · · Central site administration (site activation, cronjobs, ...) Easy deployment (update site extension with Subversion) Highly reduced maintenance costs (security patches, upgrades) Highly efficient use of hardware resources · · · · · Some Kernel patches needed 49/64 Learnings from Real eZ Publish 5 Projects 49 von 64 05.09.14 08:31
  • 50. Multi-Site/Multi-Repository Setup in eZ 5 First Approach (proven in production) Use different · ezpublish app directories to host the different sites Second approach (under development) · Use CJW MultiSiteBundle #ezsummer 50/64 Learnings from Real eZ Publish 5 Projects 50 von 64 05.09.14 08:31
  • 51. Directory structure - Multi-Site-Setup (old) ezpublish <-- not used ezpublish_legacy ⌞extension ⌞site_customer <-- each customer has its own extension and database ⌞site_customertwo ⌞var ⌞site_customer <-- each customer has its own var directory ⌞site_customertwo site_customer <-- each customer has its own Symfony app site_customertwo src ⌞CjwNetwork ⌞SiteCustomerBundle <-- each customer has its own bundle ⌞SiteCustomertwoBundle #ezsummer 51/64 Learnings from Real eZ Publish 5 Projects 51 von 64 05.09.14 08:31
  • 52. Multi-Site-Setup (old) Detail ezpublish_legacy ezpublish_legacy ⌞extension ⌞site_customer <-- each customer has its own extension ⌞classes ⌞design ⌞modules ⌞settings ⌞site.ini ⌞[DatabaseSettings] <-- each customer has its own database ⌞Database=database_site_customer ⌞site_customertwo ⌞[...] ⌞settings ⌞site.ini ⌞[DatabaseSettings] ⌞Database=database_site_customertwo ⌞var ⌞site_customer <-- each customer has its own var directory ⌞site_customertwo #ezsummer 52/64 Learnings from Real eZ Publish 5 Projects 52 von 64 05.09.14 08:31
  • 53. Detail site_customer App - Multi-Site-Setup (old) site_customer ⌞autoload.php ⌞bootstrap.php.cache ⌞cache ⌞check.php ⌞config <-- all yml files like ezpublish folder, (to improve) ⌞config.yml ⌞ezpublish.yml ⌞ parameters.yml ⌞console ⌞logs ⌞phpunit.xml.dist ⌞Resources ⌞sessions ⌞SiteCjwbaseCache.php ⌞SiteCjwbaseKernel.php ⌞SymfonyRequirements.php #ezsummer 53/64 Learnings from Real eZ Publish 5 Projects 53 von 64 05.09.14 08:31
  • 54. Scripts on Shell - Multi-Site-Setup (old) # Generate symlinks php site_customer/console assets:install --symlink web php site_customer/console ezpublish:legacy:assets_install --symlink web # Clear Cache php site_customer/console --env=prod cache:clear # Dump assets php site_customer/console assetic:dump --env=prod web # Run cronjobs php site_customer/console ezpublish:legacy:script runcronjobs.php --siteaccess customer_user_de cjw_newsletter #ezsummer BASH 54/64 Learnings from Real eZ Publish 5 Projects 54 von 64 05.09.14 08:31
  • 55. Multiple Apps: Multi-Site-Setup (old) You can use one development environment with many projects You can use one or more production servers or easily check out customer to different servers all customer are encapsulated apps solid and proven for more than 1,5 years Examples ... #ezsummer · · · · · · 55/64 Learnings from Real eZ Publish 5 Projects 55 von 64 05.09.14 08:31
  • 56. Introducing CJW MultiSiteBundle Although the first approach works fine, it has several drawbacks: Application code scattered at different places (site directory, bundle, legacy extension), hard to maintain in VCS, hard to deploy Redundancy in config files No global settings No central site activation/administration Goal: keep everything in one place! #ezsummer · · · · · 56/64 Learnings from Real eZ Publish 5 Projects 56 von 64 05.09.14 08:31
  • 57. CJW MultiSiteBundle Features Boots kernel and environment based on domain name mappings Handles local, staging and live domain names Allows for global activation of bundles Allows for global settings Provides a common console for all sites Caches domain name mappings Moves cache and log files away from the ezpublish folder more to come ... #ezsummer · · · · · · · · 57/64 Learnings from Real eZ Publish 5 Projects 57 von 64 05.09.14 08:31
  • 58. cjwpublish Directory The cjwpublish application directory sits next to the ezpublish directory. cjwpublish ⌞ config cjwpublish.yml <-- defines active bundles config.yml <-- allows for global settings CjwPublishKernel.php <-- inherits from CjwMultiSiteKernel.php CjwPublishCache.php <-- inherits from CjwMultiSiteCache.php console #ezsummer 58/64 Learnings from Real eZ Publish 5 Projects 58 von 64 05.09.14 08:31
  • 59. Symfony's app directory is back Site Bundle Directory Layout src ⌞ Cjw ⌞ SiteExampleBundle ⌞ app ⌞ config cjwpublish.yml <-- contains domain mappings config.yml ezpublish.yml ... CjwSiteExampleKernel.php <-- inherits from CjwPublishKernel.php CjwSiteExampleCache.php <-- inherits from CjwPublishCache.php ⌞ Controller ... #ezsummer 59/64 Learnings from Real eZ Publish 5 Projects 59 von 64 05.09.14 08:31
  • 60. Caveats Adjustments needed in config.yml to reflect different relative location of kernel assetic: ... read_from: %kernel.root_dir%/../../../../web write_to: %kernel.root_dir%/../../../../web ... ez_publish_legacy: ... root_dir: %kernel.root_dir%/../../../../ezpublish_legacy parameters: ezpublish.kernel.root_dir: %kernel.root_dir%/../../../../vendor/ezsystems/ezpublish-kernel More problems of this kind expected! #ezsummer YML 60/64 Learnings from Real eZ Publish 5 Projects 60 von 64 05.09.14 08:31
  • 61. Project Status Currently in private Beta, not yet released Ideas and Feedback welcome Public Beta in October info@cjw-network.com https://github.com/cjw-network/MultiSiteBundle #ezsummer · · · · · 61/64 Learnings from Real eZ Publish 5 Projects 61 von 64 05.09.14 08:31
  • 62. Ressources Slides as PDF see src/Cjw/SummerCampBundle/Resources/doc/learnings.pdf https://github.com/cjw-network/SummerCampBundle/Resources /doc/learnings.pdf Slides (Source) CJW MultiSiteBundle #ezsummer · · https://github.com/dfritschy/cjw-· summercamp-slides https://github.com/cjw-network/MultiSiteBundle info@cjw-network.com · · 62/64 Learnings from Real eZ Publish 5 Projects 62 von 64 05.09.14 08:31
  • 63. Learnings from Real eZ Publish 5 Projects http://vote.netgenlabs.com/ Please Vote! 63 von 64 05.09.14 08:31
  • 64. Learnings from Real eZ Publish 5 Projects <Thank You!> Ekkehard Dörre http://share.ez.no/community/profile/7431 @ekkeD http://www.coolscreen.de Donat Fritschy https://github.com/dfritschy http://share.ez.no/community/profile/10451 @webmanufaktur http://www.webmanufaktur.ch 64 von 64 05.09.14 08:31