TYPO3 Flow 2.0Robert Lemke_
TEXT HEREproject founder of TYPO3 Flow and TYPO3 Neosco-founder of the TYPO3 Associationcoach, coder, consultant36 years o...
72 new features177 bug fixes236 improvements
Composer
Installation via Composer$ curl -s https://getcomposer.org/installer | php$ sudo mv composer.phar /usr/local/bin/composer$...
Composer is forDevelopmentnot forDeployment
http://bit.ly/flow-composer-video
NativeSessions
written in pure PHP
for the cloud
/*** @FlowInject* @var TYPO3FlowSessionSessionManagerInterface*/protected $sessionManager;…$session = $this->sessionManage...
$session->putData(username, robert);$session->hasKey(username);$username = $session->getData(username);
$session = $this->sessionManager->getSession($sessionId);$username = $session->getData(username);
$session->addTag(user12345);…$session = $this->sessionManager->getSessionByTag(user12345);
Caches.yaml:Flow_Session_Storage:backend: TYPO3FlowCacheBackendApcBackend
404, 505
TYPO3:Flow:error:exceptionHandler:defaultRenderingOptions: []renderingGroups:notFoundExceptions:matchingStatusCodes: [404]...
PersistedRoles
roles:User: []Manager: [User]Editor: [User, TYPO3.Neos:Editor]
$role = $this->policyService->createRole(Vendor.Package:Role);$this->policyService->hasRole(Vendor.Package:Role);$role = $...
SafeRequestMethods
Network Working Group R. FieldingRequest for Comments: 2616 UC IrvineObsoletes: 2068 J. GettysCategory: Standards Track Co...
9.1 Safe and Idempotent Methods9.1.1 Safe MethodsImplementors should be aware that the software represents the user inthei...
no automatic persistence
speeds up link generation
LazyDependencyInjection
class BookController extends ActionController {/*** @FlowInject* @var BookRepository*/protected $bookRepository;}
class BookController extends ActionController {…public function myAction() {// $this->bookRepository is instance of Depend...
$greet = function($name) {printf("Hello %s", $name);};$greet(World);
class BookController extends BookController_Originalimplements ProxyInterface {/*** Autogenerated Proxy Method*/public fun...
$bookRepository_reference = &$this->bookRepository;$this->bookRepository =Bootstrap::$staticObjectManager->getLazyDependen...
class BookController extends ActionController {…public function myAction() {$this->bookRepository->findAll();}}
class DependencyProxy {…/*** Proxy magic call method which triggers the injection of the real dependency* and returns the ...
StaticMethodCompilation
/*** Returns a map of action method names and their parameters.** @return array Array of method parameters by action name*...
/*** Returns a map of action method names and their parameters.** @param TYPO3FlowObjectObjectManagerInterface $objectMana...
Speed
Uncached Welcome Screen
2.1
Cloud Resources
resource:# Definition of resource storages provided by the Flow core.# Storages are used for storing and retrieving resour...
Minifying & Filters
Routing: Request Methods
2.2
Page Cache & Reverse Proxy
Multi Persistence
Ask me anything
https://github.com/robertlemke
TYPO3 Flow Trainings andInhouse Workshops
Robert Lemke_robertlemke.com@robertlemke
TYPO3 Flow 2.0 (T3CON13 San Francisco)
TYPO3 Flow 2.0 (T3CON13 San Francisco)
TYPO3 Flow 2.0 (T3CON13 San Francisco)
Upcoming SlideShare
Loading in …5
×

TYPO3 Flow 2.0 (T3CON13 San Francisco)

2,263 views

Published on

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. Flow, probably being the most advanced PHP application framework on the market, brings back the joy of development and is especially well suited for enterprise applications. In this session you’ll get a compact introduction into the feature set of Flow 2.0 and what's coming up in the next version.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,263
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

TYPO3 Flow 2.0 (T3CON13 San Francisco)

  1. 1. TYPO3 Flow 2.0Robert Lemke_
  2. 2. TEXT HEREproject founder of TYPO3 Flow and TYPO3 Neosco-founder of the TYPO3 Associationcoach, coder, consultant36 years oldlives in Lübeck, Germany1 wife, 2 daughters, 1 espresso machinelikes drumming
  3. 3. 72 new features177 bug fixes236 improvements
  4. 4. Composer
  5. 5. Installation via Composer$ curl -s https://getcomposer.org/installer | php$ sudo mv composer.phar /usr/local/bin/composer$ composer create-project --stability="beta" --dev typo3/flow-base-distribution MyProject
  6. 6. Composer is forDevelopmentnot forDeployment
  7. 7. http://bit.ly/flow-composer-video
  8. 8. NativeSessions
  9. 9. written in pure PHP
  10. 10. for the cloud
  11. 11. /*** @FlowInject* @var TYPO3FlowSessionSessionManagerInterface*/protected $sessionManager;…$session = $this->sessionManager->getCurrentSession();$session->isStarted();$session->getId();
  12. 12. $session->putData(username, robert);$session->hasKey(username);$username = $session->getData(username);
  13. 13. $session = $this->sessionManager->getSession($sessionId);$username = $session->getData(username);
  14. 14. $session->addTag(user12345);…$session = $this->sessionManager->getSessionByTag(user12345);
  15. 15. Caches.yaml:Flow_Session_Storage:backend: TYPO3FlowCacheBackendApcBackend
  16. 16. 404, 505
  17. 17. 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
  18. 18. PersistedRoles
  19. 19. roles:User: []Manager: [User]Editor: [User, TYPO3.Neos:Editor]
  20. 20. $role = $this->policyService->createRole(Vendor.Package:Role);$this->policyService->hasRole(Vendor.Package:Role);$role = $this->policyService->getRole(Vendor.Package:Role);
  21. 21. SafeRequestMethods
  22. 22. 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
  23. 23. 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
  24. 24. no automatic persistence
  25. 25. speeds up link generation
  26. 26. LazyDependencyInjection
  27. 27. class BookController extends ActionController {/*** @FlowInject* @var BookRepository*/protected $bookRepository;}
  28. 28. class BookController extends ActionController {…public function myAction() {// $this->bookRepository is instance of Dependency Proxy$this->bookRepository->findAll();// $this->bookRepository is the real BookRepository}}
  29. 29. $greet = function($name) {printf("Hello %s", $name);};$greet(World);
  30. 30. class BookController extends BookController_Originalimplements ProxyInterface {/*** Autogenerated Proxy Method*/public function __construct() {$this->Flow_Proxy_injectProperties();}
  31. 31. $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);});}
  32. 32. class BookController extends ActionController {…public function myAction() {$this->bookRepository->findAll();}}
  33. 33. 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;}
  34. 34. StaticMethodCompilation
  35. 35. /*** 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;}}
  36. 36. /*** Returns a map of action method names and their parameters.** @param TYPO3FlowObjectObjectManagerInterface $objectManager* @return array Array of method parameters by action name* @FlowCompileStatic*/static public function getActionMethodParameters($objectManager) {$reflectionService = $objectManager->get(TYPO3FlowReflectionReflectionService);$className = get_called_class();$methodParameters = $reflectionService->getMethodParameters($className, get_class_methods($className));foreach ($methodParameters as $parameterName => $parameterInfo) {...}return $methodParameters;}
  37. 37. Speed
  38. 38. Uncached Welcome Screen
  39. 39. 2.1
  40. 40. Cloud Resources
  41. 41. 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
  42. 42. Minifying & Filters
  43. 43. Routing: Request Methods
  44. 44. 2.2
  45. 45. Page Cache & Reverse Proxy
  46. 46. Multi Persistence
  47. 47. Ask me anything
  48. 48. https://github.com/robertlemke
  49. 49. TYPO3 Flow Trainings andInhouse Workshops
  50. 50. Robert Lemke_robertlemke.com@robertlemke

×