Your SlideShare is downloading. ×
  • Like
  • Save
TYPO3 Flow 2.0 (International PHP Conference 2013)
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

TYPO3 Flow 2.0 (International PHP Conference 2013)


Just one year after its 1.0 release, TYPO3 Flow (formerly known as FLOW3) raises the version number to introduce a couple of new major features. In this session you’ll get a compact introduction into …

Just one year after its 1.0 release, TYPO3 Flow (formerly known as FLOW3) raises the version number to introduce a couple of new major features. In this session you’ll get a compact introduction into the comprehensive Composer support, automatic code migration, distributed session handling and new features coming up in the next version of Flow.

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • Excellent Presentation!
    Are you sure you want to
    Your message goes here
No Downloads


Total Views
On SlideShare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. Robert Lemke_2.0
  • 2. TEXT HEREproject founder of TYPO3 Flow and TYPO3 Neosco-founder of the TYPO3 Associationcoach, coder, consultant37 years oldlives in Lübeck, Germany1 wife, 2 daughters, 1 espresso machinelikes drumming
  • 3. 2005
  • 4. 2.0
  • 5. 72 new major features236 improvements177 bug fixes
  • 6. Speed
  • 7. FLOW3 1.1
  • 8. Uncached Welcome Screen
  • 9. Uncached Welcome Screen
  • 10. Flow 2.0 beta 3
  • 11. 26 msUncached Welcome Screen27 ms
  • 12. Composer
  • 13. $ curl -s | php$ sudo mv composer.phar /usr/local/bin/composer
  • 14. $ composer create-project --stability="beta" --dev typo3/flow-base-distribution
  • 15. Composer is aDevelopment Tool
  • 16. ApplicationMy Flow AppAcme.DemoClassesConfigurationNative Flow PackageControllerHelloWorldController.phpCoolProductController.phpAwesomeSauceController.phpMediocreCoffeeController.phpDomain……PackagesResources
  • 17. LibrariesMy Flow AppsymfonyyamlSymfonyStandalone Packagecomposer.jsonDumper.phpEscaper.phpParser.phpPackagesComponentYaml phpunit.xml.distREADME.MDimaginedoctrine
  • 18.
  • 19. NativeSessions
  • 20. written in pure PHPbased on our HTTP foundation
  • 21. for the cloud
  • 22. /*** @FlowInject* @var TYPO3FlowSessionSessionManagerInterface*/protected $sessionManager;…$session = $this->sessionManager->getCurrentSession();$session->isStarted();$session->getId();
  • 23. $session->putData(username, robert);$session->hasKey(username);$username = $session->getData(username);
  • 24. $session = $this->sessionManager->getSession($sessionId);$username = $session->getData(username);
  • 25. $session->addTag(user12345);…$session = $this->sessionManager->getSessionByTag(user12345);
  • 26. Caches.yaml:Flow_Session_Storage:backend: TYPO3FlowCacheBackendApcBackend
  • 27. based on Flow cache system
  • 28. 404, 505
  • 29. TYPO3:Flow:error:exceptionHandler:defaultRenderingOptions: []renderingGroups:notFoundExceptions:matchingStatusCodes: [404]options:templatePathAndFilename: resource://TYPO3.Flow/Private/Templates/Evariables:errorDescription: Sorry, the page you requested was not found.databaseConnectionExceptions:matchingExceptionClassNames: [TYPO3FlowPersistenceDoctrineDatabaoptions:templatePathAndFilename: resource://TYPO3.Flow/Private/Templates/Evariables:errorDescription: Sorry, the database connection couldnt be es
  • 30. PersistedRoles
  • 31. roles:User: []Manager: [User]Editor: [User, TYPO3.Neos:Editor]
  • 32. $role = $this->policyService->createRole(Vendor.Package:Role);$this->policyService->hasRole(Vendor.Package:Role);$role = $this->policyService->getRole(Vendor.Package:Role);
  • 33. SafeRequestMethods
  • 34. Network Working Group R. FieldingRequest for Comments: 2616 UC IrvineObsoletes: 2068 J. GettysCategory: Standards Track Compaq/W3CJ. MogulCompaqH. FrystykW3C/MITL. MasinterXeroxP. LeachMicrosoftT. Berners-LeeW3C/MITJune 1999Hypertext Transfer Protocol -- HTTP/1.1Status of this MemoThis document specifies an Internet standards track protocol for theInternet community, and requests discussion and suggestions forimprovements. Please refer to the current edition of the "Internet
  • 35. 9.1 Safe and Idempotent Methods9.1.1 Safe MethodsImplementors should be aware that the software represents the user intheir interactions over the Internet, and should be careful to allow theuser to be aware of any actions they might take which may have anunexpected significance to themselves or others.In particular, the convention has been established that the GET and HEADmethods SHOULD NOT have the significance of taking an action other thanretrieval. These methods ought to be considered "safe". This allows useragents to represent other methods, such as POST, PUT and DELETE, in aspecial way, so that the user is made aware of the fact that a possiblyunsafe action is being requested.Naturally, it is not possible to ensure that the server does not generateside-effects as a result of performing a GET request; in fact, somedynamic resources consider that a feature. The important distinction hereis that the user did not request the side-effects, so therefore cannot beheld accountable for them.9.1.2 Idempotent Methods
  • 36. no automatic persistence
  • 37. speeds up link generation
  • 38. StaticMethodCompilation
  • 39. /*** Returns a map of action method names and their parameters.** @return array Array of method parameters by action name*/public function getActionMethodParameters() {$methodParameters = $this->reflectionService->getMethodParameters(get_class($this), $this->actionMethodName);foreach ($methodParameters as $parameterName => $parameterInfo) {...}return $methodParameters;}}
  • 40. /*** @return integer*/public function getNumberOfMethods() {return $class_methods = get_class_methods(myclass);}
  • 41. /*** @return integer* @FlowCompileStatic*/public function getNumberOfMethods() {return $class_methods = get_class_methods(myclass);}
  • 42. /*** @return integer* @FlowCompileStatic*/public function getNumberOfMethods() {return $class_methods = get_class_methods(myclass);}
  • 43. /*** @return integer*/public function getNumberOfMethods() {return 42;}
  • 44. LazyDependencyInjection
  • 45. class BookController extends ActionController {/*** @FlowInject* @var BookRepository*/protected $bookRepository;}
  • 46. class BookController extends ActionController {…public function myAction() {// $this->bookRepository is instance of Dependency Proxy$this->bookRepository->findAll();// $this->bookRepository is the real BookRepository}}
  • 47. class BookController extends ActionController {/*** @FlowInject(lazy = false)* @var BookRepository*/protected $bookRepository;}
  • 48. // $this->bookRepository is maybe instance of Dependency Proxyif ($this->bookRepository instanceof DependencyProxy) {$this->bookRepository->_activateDependency();}// $this->bookRepository is the real BookRepository$this->otherService->otherMethod($this->bookRepository);
  • 49. 2.1
  • 50. Cloud Resources
  • 51. resource:# Definition of resource storages provided by the Flow core.# Storages are used for storing and retrieving resources.storages:#defaultPersistentResourcesStorage:storage: TYPO3FlowResourceStorageFileSystemStoragestorageOptions:path: %FLOW_PATH_DATA%Persistent/Resources/# Definition of the default resource collections.# Collections are used to bundle / group static or persistent resources# for common processing and publication.collections:# Collection which contains all persistent resourcespersistentResources:sources:-storage: defaultPersistentResourcesStoragetarget: localWebDirectoryPersistentResourcesTarget# Definition of the basic resource publication targets.targets:# Target for publishing persistent resources to the local web directorylocalWebDirectoryPersistentResourcesTarget:target: TYPO3FlowResourceTargetFileSystemTargettargetOptions:path: %FLOW_PATH_WEB%_Resources/Persistent/baseUri: _Resources/Persistent/mirrorMode: link
  • 52. Minifying & Filters
  • 53. Routing: Request Methods
  • 54. 2.2
  • 55. Page Cache & Reverse Proxy
  • 56. Multi Persistence
  • 57.
  • 58. Questions?
  • 59.
  • 60. TYPO3 Flow Trainings andInhouse Workshops
  • 61. Robert
  • 62. LazyDependencyInjectionBehind theScenes
  • 63. class BookController extends ActionController {/*** @FlowInject* @var BookRepository*/protected $bookRepository;}
  • 64. class BookController extends ActionController {…public function myAction() {// $this->bookRepository is instance of Dependency Proxy$this->bookRepository->findAll();// $this->bookRepository is the real BookRepository}}
  • 65. $greet = function($name) {printf("Hello %s", $name);};$greet(World);
  • 66. class BookController extends BookController_Originalimplements ProxyInterface {/*** Autogenerated Proxy Method*/public function __construct() {$this->Flow_Proxy_injectProperties();}
  • 67. $bookRepository_reference = &$this->bookRepository;$this->bookRepository =Bootstrap::$staticObjectManager->getLazyDependencyByHash(d0e87f8f658d7866eec63db44a6918b4, $bookRepository_reference);if ($this->bookRepository === NULL) {$this->bookRepository = Bootstrap::$staticObjectManager->createLazyDependency(d0e87f8f658d7866eec63db44a6918b4, $bookRepository_reference,RobertLemkeExampleBookshopDomainRepositoryBookRepository,function() {return Bootstrap::$staticObjectManager->get(RobertLemkeExampleBookshopDomainRepositoryBookRepository);});}
  • 68. class BookController extends ActionController {…public function myAction() {$this->bookRepository->findAll();}}
  • 69. class DependencyProxy {…/*** Proxy magic call method which triggers the injection of the real dependency* and returns the result of a call to the original method in the dependency** @param string $methodName Name of the method to be called* @param array $arguments An array of arguments to be passed to the method* @return mixed*/public function __call($methodName, array $arguments) {return call_user_func_array(array($this->_activateDependency(), $methodName),$arguments);}/*** Activate the dependency and set it in the object.** @return object The real dependency object* @api*/public function _activateDependency() {$realDependency = $this->builder->__invoke();foreach($this->propertyVariables as &$propertyVariable) {$propertyVariable = $realDependency;}return $realDependency;}