SlideShare una empresa de Scribd logo
1 de 91
Descargar para leer sin conexión
Applications for the
Enterprise with PHP
Solve complex problems with excellence
and get back the joy of software development.
@robertlemke

project founder of FLOW3 / TYPO3 Phoenix

co-founder of the TYPO3 Association

coach, coder, consultant

36 years old

lives in Lübeck, Germany

1 wife, 2 daughters, 1 espresso machine

likes drumming
PHP
Java
is_php_a_good_language() ?
       TRUE : FALSE;
inconsistent($needle, $haystack);
functional_toolbox::$lackingElegance;
The programming language
   is rarely the problem.
I♥PHP
I   PHP
Let me focus
on the fun part
10 Features
1   Controller
modelviewcontroller
<?php
namespace AcmeDemoController;
use TYPO3FLOW3MvcControllerActionController;

class HelloWorldController extends ActionController {

    /**
      * @return string
      */
    public function greetAction() {
         return '¡Hola mundo!';
    }

}
TEXT HERE
<?php
namespace AcmeDemoController;
use TYPO3FLOW3MvcControllerActionController;

class HelloWorldController extends ActionController {

    /**
      * @param string $name The name to mention
      * @return string
      */
    public function greetAction($name) {
         return "¡Hola $name!";
    }

}
<?php
namespace AcmeDemoController;
use TYPO3FLOW3MvcControllerActionController;
use AcmeDemoDomainModelPerson;

class HelloWorldController extends ActionController {

    /**
      * @param AcmeDemoDomainModelPerson $person
      * @return string
      */
    public function greetAction(Person $person) {
         return "¡Hola " . $person->getName() . "!";
    }
2   HTTP
Network Working Group                                           R. Fielding
Request for Comments: 2616                                        UC Irvine
Obsoletes: 2068                                                   J. Gettys
Category: Standards Track                                        Compaq/W3C
                                                                   J. Mogul
                                                                     Compaq
                                                                 H. Frystyk
                                                                    W3C/MIT
                                                                L. Masinter
                                                                      Xerox
                                                                   P. Leach
                                                                  Microsoft
                                                             T. Berners-Lee
                                                                    W3C/MIT
                                                                  June 1999




                   Hypertext Transfer Protocol -- HTTP/1.1


Status of this Memo


   This document specifies an Internet standards track protocol for the
   Internet community, and requests discussion and suggestions for
   improvements.     Please refer to the current edition of the "Internet
HTTP/1.1 has been designed to allow implementations of applications
                                                     /**
   that do not depend on knowledge of ranges.
                                                      * Represents a HTTP request
                                                      */
4 HTTP Message
                                                     class Request extends Message {

4.1 Message Types
                                                         /**
                                                           * @var string
   HTTP messages consist of requests from client to    server and responses
                                                           */
   from server to client.
                                                         protected $method = 'GET';

       HTTP-message   = Request | Response       ; HTTP/1.1 messages
                                                        /**
                                                          * @var TYPO3FLOW3HttpUri
   Request   (section 5) and Response (section 6) messages use the generic
                                                          */
   message   format of RFC 822 [9] for transferring entities (the payload
                                                        protected $uri;
   of the message). Both types of message consist of a start-line, zero
   or more header fields (also known as "headers"), an empty line (i.e.,
                                                        /**
   a line with nothing preceding the CRLF) indicating   the end of the
                                                          * @var TYPO3FLOW3HttpUri
   header fields, and possibly a message-body.
                                                          */
                                                        protected $baseUri;
        generic-message = start-line
                            *(message-header CRLF)
                                                         /**
                            CRLF
                                                          * @var array
                            [ message-body ]
                                                          */
        start-line      = Request-Line | Status-Line
                                                         protected $arguments;
$request->getHeader('User-Agent'); # C64

$request->setHeader('X-Coffee', 'too few');
$now = new DateTime();
$response->setLastModified($now);
$response->getHeaders()
  ->setCacheControlDirective('s-max-age', 100);
# set cookie in response:
$response->setCookie(new Cookie('counter', 1));

  # retrieve cookie on next request:
$cookie = $request->getCookie('counter');
3   Templating
<html lang="en">
    <head>
        <title>Templating</title>
    </head>
    <body>

          Our templating engine
          is called

                         Fluid
    </body>
</html>
<?php
namespace AcmeDemoController;
use TYPO3FLOW3MvcControllerActionController;

class HelloWorldController extends ActionController {

    /**
      * @param string $name
      * @return void
      */
    public function greetAction($name) {
         $this->view->assign('name', $name);
    }

}
<html>
    <head>
        <title>Fluid Example</title>
    </head>
    <body>
        <p>Hello, {name}!</p>
    </body>
</html>
<?php
namespace AcmeDemoController;
use TYPO3FLOW3MvcControllerActionController;
use AcmeDemoDomainModelBook;

class BookController extends ActionController {

    /**
     * @return void
     */
    public function indexAction() {
        $book = new Book();
        $book->setTitle('Manual del Guerrero de la Luz');

        $books = array($book);

        $this->view->assign('books', $books);
    }

}
<ul>
   <f:for each="{books}" as="book">
       <li>{book.title}</li>
   </f:for>
</ul>
4   Model
public function createAction(Book $book) {
    if (!$this->securityManager->hasRole('BookAdmin')) {
        throw new Exception('Not allowed.');
    }

    $statementHandle = $this->databaseHandle->prepare(
        'INSERT INTO "books" ("identifier", "title", "isbn") ' .
        'VALUES (?, ?, ?)'
    );
    $result = $statementHandle->execute(
        array($book->getId(), $book->getTitle(), $book->getIsbn())
    );
    if ($result === FALSE) {
        throw new Exception('Could not create book.');
    }
}
class Book extends BaseModel {

    protected $id;
    protected $title;
    protected $isbn;
    …

    public function __construct() {
        $this->id = TYPO3FLOW3UtilityAlgorithms::generateUUID();
    }
    …

    public function getSalesVolume() {
        if (!$this->securityManager->hasRole('Management')) {
            throw new Exception('Access Denied');
        }

        $statementHandle = $this->databaseHandle->prepare(
            'SELECT "identifier" FROM "orders" WHERE "date">? AND "
        $result = $statementHandle->execute(array(time() - 604800));
        if ($result === FALSE) {
Tackling the Heart of Software Development

                                         /**
Domain-Driven Design                      * A Book
                                          *
                                          * @FLOW3Scope(“protot
                                                                 ype”)
                                          * @FLOW3Entity
A methodology which ...                   */
                                        class Book {

 • results in rich domain models        	    /**
                                        	     * @var string
                                        	     */
 • provides a common language           	    protected $title;

   across the project team          	       /**
                                    	        * @var string
                                    	        */
 • simplify the design of complex   	       protected $isbn;
   applications                     	       /**
                                    	        * @var string
                                    	        */
                                    	       protected $description
                                                                   ;
FLOW3 is the first PHP framework
                                    	       /**
tailored to Domain-Driven Design    	        * @var integer
                                    	        */
                                    	       protected $price;
namespace RoeBooksShopDomainModel;
use TYPO3FLOW3Annotations as FLOW3;

/**
 * A Book
 *
 * @FLOW3Entity
 */
class Book {

    /**
     * @var string
     */
    protected $title;

    /**
     * @var integer
     */
    protected $price;
/**
  * Get the Book's title
  *
  * @return string The Book's title
  */
public function getTitle() {
     return $this->title;
}

/**
  * Sets this Book's title
  *
  * @param string $title The Book's title
  * @return void
  */
public function setTitle($title) {
     $this->title = $title;
}
/**
  * Get the Book's Sales Volume
  *
  * @return integer The Book's sales volume
  */
public function getSalesVolume() {
     $time = new DateTime('last month');
     $total = $this->bookRepository->calculateTotalSalesSince($time);
     return $total;
}
interface RepositoryInterface {

    /**
     * Adds an object to this repository.
     * @param object $object The object to add
     * @return void
     */
    public function add($object);

    /**
     * Removes an object from this repository.
     * @param object $object The object to remove
     * @return void
     */
    public function remove($object);

    /**
     * Returns all objects of this repository.
     * @return TYPO3FLOW3PersistenceQueryResultInterface The que
     */
    public function findAll();
/**
 * A repository for Books
 *
 * @FLOW3Scope("singleton")
 */
class BookRepository extends Repository {

    /**
      * Returns the total sales volume
      *
      * @param DateTime $time
      */
    public function calculateTotalSalesSince(DateTime $time) {
         # implementation …
    }

}
/**
  * Adds the given new book object to the book repository
  *
  * @param AcmeDemoDomainModelBook $newBook A new book to ad
  * @return void
  */
public function createAction(Book $newBook) {
     $this->bookRepository->add($newBook);
     $this->redirect('index');
}
TEXT HERE
5   Resources
TEXT HERE
TEXT HERE
TEXT HERE
TEXT HERE
TEXT HERE
Dependency
6   Injection
class Foo {

    protected static $instance;

    public function getInstance() {
        if (self::$instance === NULL) {
            self::$instance = new self;
        }
        return self::$instance;
    }
}

class Bar {

    public function action() {
        $foo = Foo::getInstance();
    }
}
class ServiceLocator {

    protected static $services = array();

    public function get($serviceName) {
        return self::$services[$serviceName];
    }
}

class Bar {

    public function action() {
        $foo = ServiceLocator::get('Foo');
    }
}
class Bar {

    /**
     * @var Foo
     */
    protected $foo;

    /**
      * @param Foo $foo
      */
    public function __construct(Foo $foo) {
         $this->foo = $foo;
    }

    /**
      * @return string
      */
    public function action() {
         $this->foo->doSomething();
    }
}
class Bar {

    /**
     * @var Foo
     * @FLOW3Inject
     */
    protected $foo;




    /**
      * @return string
      */
    public function action() {
         $this->foo->doSomething();
    }
}
Object Management
Object Management

FLOW3's take on Dependency Injection
 • one of the first PHP implementations
   (started in 2006, improved ever since)
Object Management

FLOW3's take on Dependency Injection
 • one of the first PHP implementations
   (started in 2006, improved ever since)

 • object management for the whole lifecycle of all objects
Object Management

FLOW3's take on Dependency Injection
 • one of the first PHP implementations
   (started in 2006, improved ever since)

 • object management for the whole lifecycle of all objects

 • no unnecessary configuration if information can be
   gatered automatically (autowiring)
Object Management

FLOW3's take on Dependency Injection
 • one of the first PHP implementations
   (started in 2006, improved ever since)

 • object management for the whole lifecycle of all objects

 • no unnecessary configuration if information can be
   gatered automatically (autowiring)

 • intuitive use and no bad magical surprises
Object Management

FLOW3's take on Dependency Injection
 • one of the first PHP implementations
   (started in 2006, improved ever since)

 • object management for the whole lifecycle of all objects

 • no unnecessary configuration if information can be
   gatered automatically (autowiring)

 • intuitive use and no bad magical surprises

 • fast! (like hardcoded or faster)
Aspect-Oriented
7   Programming
<?php
namespace AcmeDemoController;
use TYPO3FLOW3MvcControllerActionController;

class HelloWorldController extends ActionController {

    /**
      * @param string $name The name to mention
      * @return string
      */
    public function greetAction($name) {
         return "¡Hola $name!";
    }

}
namespace AcmeDemoAspect;

use TYPO3FLOW3AopJoinPoint;
use TYPO3FLOW3AnnotationsAround;

class BetterWorldAspect {

    /**
      * Advice which tweaks the HelloWorld controller
      *
      * @param JoinPoint $joinPoint
      * @Around("method(.*Controller->greetAction())")
      */
    public function someAdvice(JoinPoint $joinPoint) {
         $name = $joinPoint->getMethodArgument('name');
         return sprintf("%s, you're running out of time!", $name);
    }

}
Robert, you’re running out of time!
8   Security
#
# Policy.yaml
#

resources:
  methods:
    DangerousMethods: 'method(.*Controller->(new|create|edit|
update|delete)Action))'

roles:
  User: []
  Administrator: [User]


acls:
  Administrator:
    methods:
      DangerousMethods: GRANT
TEXT HERE
9   Sessions
TEXT HERE
TEXT HERE
TEXT HERE
TEXT HERE
10   Command Line
/**
 * Kickstart a new action controller
 *
 * Generates an Action Controller with the given name in the specified package.
 * In its default mode it will create just the controller containing a sample
 * indexAction.
 *
 * By specifying the --generate-actions flag, this command will also create a
 * set of actions. If no model or repository exists which matches the
 * controller name (for example "CoffeeRepository" for "CoffeeController"),
 * an error will be shown.
 *
 * Likewise the command exits with an error if the specified package does not
 * exist. By using the --generate-related flag, a missing package, model or
 * repository can be created alongside, avoiding such an error.
 *
 * By specifying the --generate-templates flag, this command will also create
 * matching Fluid templates for the actions created. This option can only be
 * used in combination with --generate-actions.
 *
 * The default behavior is to not overwrite any existing code. This can be
 * overridden by specifying the --force flag.
* By specifying the --generate-templates flag, this command will also create
 * matching Fluid templates for the actions created. This option can only be
 * used in combination with --generate-actions.
 *
 * The default behavior is to not overwrite any existing code. This can be
 * overridden by specifying the --force flag.
 *
 * @param string $packageKey The package key of the package for the new controller with
 * @param string $controllerName The name for the new controller. This may also be a com
 * @param boolean $generateActions Also generate index, show, new, create, edit, update
 * @param boolean $generateTemplates Also generate the templates for each action.
 * @param boolean $generateRelated Also create the mentioned package, related model and
 * @param boolean $force Overwrite any existing controller or template code. Regardless
 * @return string
 * @see typo3.kickstart:kickstart:commandcontroller
 */
public function actionControllerCommand($packageKey, $controllerName, $generateActions =
     $subpackageName = '';
     if (strpos('/', $packageKey) !== FALSE) {
         list($packageKey, $subpackageName) = explode('/', $packageKey, 2);
     }
     if (!$this->packageManager->isPackageKeyValid($packageKey)) {
Rossmann
• second biggest drug store
  in Germany
• 5,13 billion € turnover
• 31,000 employees



Customer Database
Amadeus
• world’s biggest
  e-ticket provider
• 217 markets
• 948 million billable
  transactions / year
• 2,7 billion € revenue

Social Media Suite
At a Glance

FLOW3 is a web application platform
 • holistic concept for your apps

 • modular, extensible, package based

 • pedantically clean with focus on quality

 • puts a smile on developer’s faces


 • free & Open Source (LGPL v3)

 • backed by one of the largest Open Source projects
Foundation for the Next Generation CMS


TYPO3 “Phoenix” is the all-new
Enterprise CMS
 • content repository, workspaces,
   versions, i18n, modular UI ...

 • powered by FLOW3

 • compatible code base

 • use TYPO3 features in FLOW3
   standalone apps as you like
FLOW3 1.1 Release
   tomorrow!
Thanks for having me!

Slides:     http://slideshare.net/robertlemke

Examples:   http://github.com/robertlemke

Blog:       http://robertlemke.com

Twitter:    @robertlemke

Feedback:   robert@typo3.org

FLOW3:      http://flow3.typo3.org

Más contenido relacionado

Similar a Applications for the Enterprise with PHP (CPEurope)

Hands on FLOW3 (DPC12)
Hands on FLOW3 (DPC12)Hands on FLOW3 (DPC12)
Hands on FLOW3 (DPC12)Robert Lemke
 
Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)Robert Lemke
 
IPCSE12: Hands on FLOW3
IPCSE12: Hands on FLOW3IPCSE12: Hands on FLOW3
IPCSE12: Hands on FLOW3Robert Lemke
 
2012 08-11-flow3-northeast-php
2012 08-11-flow3-northeast-php2012 08-11-flow3-northeast-php
2012 08-11-flow3-northeast-phpJochen Rau
 
IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3Robert Lemke
 
Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Robert Lemke
 
Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Robert Lemke
 
FLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtFLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtRobert Lemke
 
Getting Into FLOW3 (TYPO312CA)
Getting Into FLOW3 (TYPO312CA)Getting Into FLOW3 (TYPO312CA)
Getting Into FLOW3 (TYPO312CA)Robert Lemke
 
TYPO3 Flow: Beyond the Blog Example (Inspiring Flow 2013)
TYPO3 Flow: Beyond the Blog Example (Inspiring Flow 2013)TYPO3 Flow: Beyond the Blog Example (Inspiring Flow 2013)
TYPO3 Flow: Beyond the Blog Example (Inspiring Flow 2013)Robert Lemke
 
The Beauty and the Beast
The Beauty and the BeastThe Beauty and the Beast
The Beauty and the BeastBastian Feder
 
The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09Bastian Feder
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Hugo Hamon
 
InspiringCon15: Bringing TYPO3 Legacy Applications into the Flow
InspiringCon15: Bringing TYPO3 Legacy Applications into the FlowInspiringCon15: Bringing TYPO3 Legacy Applications into the Flow
InspiringCon15: Bringing TYPO3 Legacy Applications into the Flowmhelmich
 
TYPO3 Flow 2.0 Workshop T3BOARD13
TYPO3 Flow 2.0 Workshop T3BOARD13TYPO3 Flow 2.0 Workshop T3BOARD13
TYPO3 Flow 2.0 Workshop T3BOARD13Robert Lemke
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2Hugo Hamon
 
Tips
TipsTips
Tipsmclee
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkChristian Trabold
 
Code Documentation. That ugly thing...
Code Documentation. That ugly thing...Code Documentation. That ugly thing...
Code Documentation. That ugly thing...Christos Manios
 

Similar a Applications for the Enterprise with PHP (CPEurope) (20)

Hands on FLOW3 (DPC12)
Hands on FLOW3 (DPC12)Hands on FLOW3 (DPC12)
Hands on FLOW3 (DPC12)
 
Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)
 
IPCSE12: Hands on FLOW3
IPCSE12: Hands on FLOW3IPCSE12: Hands on FLOW3
IPCSE12: Hands on FLOW3
 
2012 08-11-flow3-northeast-php
2012 08-11-flow3-northeast-php2012 08-11-flow3-northeast-php
2012 08-11-flow3-northeast-php
 
IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3
 
Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0
 
Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0
 
FLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtFLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 Frankfurt
 
Getting Into FLOW3 (TYPO312CA)
Getting Into FLOW3 (TYPO312CA)Getting Into FLOW3 (TYPO312CA)
Getting Into FLOW3 (TYPO312CA)
 
TYPO3 Flow: Beyond the Blog Example (Inspiring Flow 2013)
TYPO3 Flow: Beyond the Blog Example (Inspiring Flow 2013)TYPO3 Flow: Beyond the Blog Example (Inspiring Flow 2013)
TYPO3 Flow: Beyond the Blog Example (Inspiring Flow 2013)
 
Doctrine in FLOW3
Doctrine in FLOW3Doctrine in FLOW3
Doctrine in FLOW3
 
The Beauty and the Beast
The Beauty and the BeastThe Beauty and the Beast
The Beauty and the Beast
 
The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
 
InspiringCon15: Bringing TYPO3 Legacy Applications into the Flow
InspiringCon15: Bringing TYPO3 Legacy Applications into the FlowInspiringCon15: Bringing TYPO3 Legacy Applications into the Flow
InspiringCon15: Bringing TYPO3 Legacy Applications into the Flow
 
TYPO3 Flow 2.0 Workshop T3BOARD13
TYPO3 Flow 2.0 Workshop T3BOARD13TYPO3 Flow 2.0 Workshop T3BOARD13
TYPO3 Flow 2.0 Workshop T3BOARD13
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
 
Tips
TipsTips
Tips
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase framework
 
Code Documentation. That ugly thing...
Code Documentation. That ugly thing...Code Documentation. That ugly thing...
Code Documentation. That ugly thing...
 

Más de Robert Lemke

Neos Content Repository – Git for content
Neos Content Repository – Git for contentNeos Content Repository – Git for content
Neos Content Repository – Git for contentRobert Lemke
 
A General Purpose Docker Image for PHP
A General Purpose Docker Image for PHPA General Purpose Docker Image for PHP
A General Purpose Docker Image for PHPRobert Lemke
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesRobert Lemke
 
Flownative Beach - Neos Meetup Hamburg 2022
Flownative Beach - Neos Meetup Hamburg 2022Flownative Beach - Neos Meetup Hamburg 2022
Flownative Beach - Neos Meetup Hamburg 2022Robert Lemke
 
GitOps with Flux - IPC Munich 2022
GitOps with Flux - IPC Munich 2022GitOps with Flux - IPC Munich 2022
GitOps with Flux - IPC Munich 2022Robert Lemke
 
OpenID Connect with Neos and Flow
OpenID Connect with Neos and FlowOpenID Connect with Neos and Flow
OpenID Connect with Neos and FlowRobert Lemke
 
Neos Conference 2019 Keynote
Neos Conference 2019 KeynoteNeos Conference 2019 Keynote
Neos Conference 2019 KeynoteRobert Lemke
 
A practical introduction to Kubernetes (IPC 2018)
A practical introduction to Kubernetes (IPC 2018)A practical introduction to Kubernetes (IPC 2018)
A practical introduction to Kubernetes (IPC 2018)Robert Lemke
 
Neos Conference 2018 Welcome Keynote
Neos Conference 2018 Welcome KeynoteNeos Conference 2018 Welcome Keynote
Neos Conference 2018 Welcome KeynoteRobert Lemke
 
A practical introduction to Event Sourcing and CQRS
A practical introduction to Event Sourcing and CQRSA practical introduction to Event Sourcing and CQRS
A practical introduction to Event Sourcing and CQRSRobert Lemke
 
Neos Conference 2017 Welcome Keynote
Neos Conference 2017 Welcome KeynoteNeos Conference 2017 Welcome Keynote
Neos Conference 2017 Welcome KeynoteRobert Lemke
 
IPC16: A Practical Introduction to Kubernetes
IPC16: A Practical Introduction to Kubernetes IPC16: A Practical Introduction to Kubernetes
IPC16: A Practical Introduction to Kubernetes Robert Lemke
 
IPC 2016: Content Strategy for Developers
IPC 2016: Content Strategy for DevelopersIPC 2016: Content Strategy for Developers
IPC 2016: Content Strategy for DevelopersRobert Lemke
 
Docker in Production - IPC 2016
Docker in Production - IPC 2016Docker in Production - IPC 2016
Docker in Production - IPC 2016Robert Lemke
 
Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)
Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)
Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)Robert Lemke
 
The Neos Brand (Inspiring Conference 2016)
The Neos Brand (Inspiring Conference 2016)The Neos Brand (Inspiring Conference 2016)
The Neos Brand (Inspiring Conference 2016)Robert Lemke
 
Neos - past, present, future (Inspiring Conference 2016)
Neos - past, present, future (Inspiring Conference 2016)Neos - past, present, future (Inspiring Conference 2016)
Neos - past, present, future (Inspiring Conference 2016)Robert Lemke
 
Meet Neos Nürnberg 2016: Ja ich will!
Meet Neos Nürnberg 2016: Ja ich will!Meet Neos Nürnberg 2016: Ja ich will!
Meet Neos Nürnberg 2016: Ja ich will!Robert Lemke
 
Meet Neos Nürnberg 2016: Hallo Neos!
Meet Neos Nürnberg 2016: Hallo Neos!Meet Neos Nürnberg 2016: Hallo Neos!
Meet Neos Nürnberg 2016: Hallo Neos!Robert Lemke
 
Turning Neos inside out / React.js HH
Turning Neos inside out / React.js HHTurning Neos inside out / React.js HH
Turning Neos inside out / React.js HHRobert Lemke
 

Más de Robert Lemke (20)

Neos Content Repository – Git for content
Neos Content Repository – Git for contentNeos Content Repository – Git for content
Neos Content Repository – Git for content
 
A General Purpose Docker Image for PHP
A General Purpose Docker Image for PHPA General Purpose Docker Image for PHP
A General Purpose Docker Image for PHP
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in Kubernetes
 
Flownative Beach - Neos Meetup Hamburg 2022
Flownative Beach - Neos Meetup Hamburg 2022Flownative Beach - Neos Meetup Hamburg 2022
Flownative Beach - Neos Meetup Hamburg 2022
 
GitOps with Flux - IPC Munich 2022
GitOps with Flux - IPC Munich 2022GitOps with Flux - IPC Munich 2022
GitOps with Flux - IPC Munich 2022
 
OpenID Connect with Neos and Flow
OpenID Connect with Neos and FlowOpenID Connect with Neos and Flow
OpenID Connect with Neos and Flow
 
Neos Conference 2019 Keynote
Neos Conference 2019 KeynoteNeos Conference 2019 Keynote
Neos Conference 2019 Keynote
 
A practical introduction to Kubernetes (IPC 2018)
A practical introduction to Kubernetes (IPC 2018)A practical introduction to Kubernetes (IPC 2018)
A practical introduction to Kubernetes (IPC 2018)
 
Neos Conference 2018 Welcome Keynote
Neos Conference 2018 Welcome KeynoteNeos Conference 2018 Welcome Keynote
Neos Conference 2018 Welcome Keynote
 
A practical introduction to Event Sourcing and CQRS
A practical introduction to Event Sourcing and CQRSA practical introduction to Event Sourcing and CQRS
A practical introduction to Event Sourcing and CQRS
 
Neos Conference 2017 Welcome Keynote
Neos Conference 2017 Welcome KeynoteNeos Conference 2017 Welcome Keynote
Neos Conference 2017 Welcome Keynote
 
IPC16: A Practical Introduction to Kubernetes
IPC16: A Practical Introduction to Kubernetes IPC16: A Practical Introduction to Kubernetes
IPC16: A Practical Introduction to Kubernetes
 
IPC 2016: Content Strategy for Developers
IPC 2016: Content Strategy for DevelopersIPC 2016: Content Strategy for Developers
IPC 2016: Content Strategy for Developers
 
Docker in Production - IPC 2016
Docker in Production - IPC 2016Docker in Production - IPC 2016
Docker in Production - IPC 2016
 
Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)
Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)
Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)
 
The Neos Brand (Inspiring Conference 2016)
The Neos Brand (Inspiring Conference 2016)The Neos Brand (Inspiring Conference 2016)
The Neos Brand (Inspiring Conference 2016)
 
Neos - past, present, future (Inspiring Conference 2016)
Neos - past, present, future (Inspiring Conference 2016)Neos - past, present, future (Inspiring Conference 2016)
Neos - past, present, future (Inspiring Conference 2016)
 
Meet Neos Nürnberg 2016: Ja ich will!
Meet Neos Nürnberg 2016: Ja ich will!Meet Neos Nürnberg 2016: Ja ich will!
Meet Neos Nürnberg 2016: Ja ich will!
 
Meet Neos Nürnberg 2016: Hallo Neos!
Meet Neos Nürnberg 2016: Hallo Neos!Meet Neos Nürnberg 2016: Hallo Neos!
Meet Neos Nürnberg 2016: Hallo Neos!
 
Turning Neos inside out / React.js HH
Turning Neos inside out / React.js HHTurning Neos inside out / React.js HH
Turning Neos inside out / React.js HH
 

Último

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 

Applications for the Enterprise with PHP (CPEurope)

  • 1. Applications for the Enterprise with PHP Solve complex problems with excellence and get back the joy of software development.
  • 2. @robertlemke project founder of FLOW3 / TYPO3 Phoenix co-founder of the TYPO3 Association coach, coder, consultant 36 years old lives in Lübeck, Germany 1 wife, 2 daughters, 1 espresso machine likes drumming
  • 3. PHP
  • 7. The programming language is rarely the problem.
  • 9. I PHP
  • 10. Let me focus on the fun part
  • 11.
  • 13. 1 Controller
  • 15.
  • 16. <?php namespace AcmeDemoController; use TYPO3FLOW3MvcControllerActionController; class HelloWorldController extends ActionController { /** * @return string */ public function greetAction() { return '¡Hola mundo!'; } }
  • 18. <?php namespace AcmeDemoController; use TYPO3FLOW3MvcControllerActionController; class HelloWorldController extends ActionController { /** * @param string $name The name to mention * @return string */ public function greetAction($name) { return "¡Hola $name!"; } }
  • 19.
  • 20.
  • 21. <?php namespace AcmeDemoController; use TYPO3FLOW3MvcControllerActionController; use AcmeDemoDomainModelPerson; class HelloWorldController extends ActionController { /** * @param AcmeDemoDomainModelPerson $person * @return string */ public function greetAction(Person $person) { return "¡Hola " . $person->getName() . "!"; }
  • 22.
  • 23. 2 HTTP
  • 24. Network Working Group R. Fielding Request for Comments: 2616 UC Irvine Obsoletes: 2068 J. Gettys Category: Standards Track Compaq/W3C J. Mogul Compaq H. Frystyk W3C/MIT L. Masinter Xerox P. Leach Microsoft T. Berners-Lee W3C/MIT June 1999 Hypertext Transfer Protocol -- HTTP/1.1 Status of this Memo This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet
  • 25. HTTP/1.1 has been designed to allow implementations of applications /** that do not depend on knowledge of ranges. * Represents a HTTP request */ 4 HTTP Message class Request extends Message { 4.1 Message Types /** * @var string HTTP messages consist of requests from client to server and responses */ from server to client. protected $method = 'GET'; HTTP-message = Request | Response ; HTTP/1.1 messages /** * @var TYPO3FLOW3HttpUri Request (section 5) and Response (section 6) messages use the generic */ message format of RFC 822 [9] for transferring entities (the payload protected $uri; of the message). Both types of message consist of a start-line, zero or more header fields (also known as "headers"), an empty line (i.e., /** a line with nothing preceding the CRLF) indicating the end of the * @var TYPO3FLOW3HttpUri header fields, and possibly a message-body. */ protected $baseUri; generic-message = start-line *(message-header CRLF) /** CRLF * @var array [ message-body ] */ start-line = Request-Line | Status-Line protected $arguments;
  • 27. $now = new DateTime(); $response->setLastModified($now);
  • 29. # set cookie in response: $response->setCookie(new Cookie('counter', 1)); # retrieve cookie on next request: $cookie = $request->getCookie('counter');
  • 30. 3 Templating
  • 31. <html lang="en"> <head> <title>Templating</title> </head> <body> Our templating engine is called Fluid </body> </html>
  • 32. <?php namespace AcmeDemoController; use TYPO3FLOW3MvcControllerActionController; class HelloWorldController extends ActionController { /** * @param string $name * @return void */ public function greetAction($name) { $this->view->assign('name', $name); } }
  • 33. <html> <head> <title>Fluid Example</title> </head> <body> <p>Hello, {name}!</p> </body> </html>
  • 34. <?php namespace AcmeDemoController; use TYPO3FLOW3MvcControllerActionController; use AcmeDemoDomainModelBook; class BookController extends ActionController { /** * @return void */ public function indexAction() { $book = new Book(); $book->setTitle('Manual del Guerrero de la Luz'); $books = array($book); $this->view->assign('books', $books); } }
  • 35. <ul> <f:for each="{books}" as="book"> <li>{book.title}</li> </f:for> </ul>
  • 36. 4 Model
  • 37. public function createAction(Book $book) { if (!$this->securityManager->hasRole('BookAdmin')) { throw new Exception('Not allowed.'); } $statementHandle = $this->databaseHandle->prepare( 'INSERT INTO "books" ("identifier", "title", "isbn") ' . 'VALUES (?, ?, ?)' ); $result = $statementHandle->execute( array($book->getId(), $book->getTitle(), $book->getIsbn()) ); if ($result === FALSE) { throw new Exception('Could not create book.'); } }
  • 38. class Book extends BaseModel { protected $id; protected $title; protected $isbn; … public function __construct() { $this->id = TYPO3FLOW3UtilityAlgorithms::generateUUID(); } … public function getSalesVolume() { if (!$this->securityManager->hasRole('Management')) { throw new Exception('Access Denied'); } $statementHandle = $this->databaseHandle->prepare( 'SELECT "identifier" FROM "orders" WHERE "date">? AND " $result = $statementHandle->execute(array(time() - 604800)); if ($result === FALSE) {
  • 39. Tackling the Heart of Software Development /** Domain-Driven Design * A Book * * @FLOW3Scope(“protot ype”) * @FLOW3Entity A methodology which ... */ class Book { • results in rich domain models /** * @var string */ • provides a common language protected $title; across the project team /** * @var string */ • simplify the design of complex protected $isbn; applications /** * @var string */ protected $description ; FLOW3 is the first PHP framework /** tailored to Domain-Driven Design * @var integer */ protected $price;
  • 40. namespace RoeBooksShopDomainModel; use TYPO3FLOW3Annotations as FLOW3; /** * A Book * * @FLOW3Entity */ class Book { /** * @var string */ protected $title; /** * @var integer */ protected $price;
  • 41. /** * Get the Book's title * * @return string The Book's title */ public function getTitle() { return $this->title; } /** * Sets this Book's title * * @param string $title The Book's title * @return void */ public function setTitle($title) { $this->title = $title; }
  • 42. /** * Get the Book's Sales Volume * * @return integer The Book's sales volume */ public function getSalesVolume() { $time = new DateTime('last month'); $total = $this->bookRepository->calculateTotalSalesSince($time); return $total; }
  • 43. interface RepositoryInterface { /** * Adds an object to this repository. * @param object $object The object to add * @return void */ public function add($object); /** * Removes an object from this repository. * @param object $object The object to remove * @return void */ public function remove($object); /** * Returns all objects of this repository. * @return TYPO3FLOW3PersistenceQueryResultInterface The que */ public function findAll();
  • 44. /** * A repository for Books * * @FLOW3Scope("singleton") */ class BookRepository extends Repository { /** * Returns the total sales volume * * @param DateTime $time */ public function calculateTotalSalesSince(DateTime $time) { # implementation … } }
  • 45. /** * Adds the given new book object to the book repository * * @param AcmeDemoDomainModelBook $newBook A new book to ad * @return void */ public function createAction(Book $newBook) { $this->bookRepository->add($newBook); $this->redirect('index'); }
  • 47. 5 Resources
  • 53. Dependency 6 Injection
  • 54. class Foo { protected static $instance; public function getInstance() { if (self::$instance === NULL) { self::$instance = new self; } return self::$instance; } } class Bar { public function action() { $foo = Foo::getInstance(); } }
  • 55. class ServiceLocator { protected static $services = array(); public function get($serviceName) { return self::$services[$serviceName]; } } class Bar { public function action() { $foo = ServiceLocator::get('Foo'); } }
  • 56. class Bar { /** * @var Foo */ protected $foo; /** * @param Foo $foo */ public function __construct(Foo $foo) { $this->foo = $foo; } /** * @return string */ public function action() { $this->foo->doSomething(); } }
  • 57. class Bar { /** * @var Foo * @FLOW3Inject */ protected $foo; /** * @return string */ public function action() { $this->foo->doSomething(); } }
  • 59. Object Management FLOW3's take on Dependency Injection • one of the first PHP implementations (started in 2006, improved ever since)
  • 60. Object Management FLOW3's take on Dependency Injection • one of the first PHP implementations (started in 2006, improved ever since) • object management for the whole lifecycle of all objects
  • 61. Object Management FLOW3's take on Dependency Injection • one of the first PHP implementations (started in 2006, improved ever since) • object management for the whole lifecycle of all objects • no unnecessary configuration if information can be gatered automatically (autowiring)
  • 62. Object Management FLOW3's take on Dependency Injection • one of the first PHP implementations (started in 2006, improved ever since) • object management for the whole lifecycle of all objects • no unnecessary configuration if information can be gatered automatically (autowiring) • intuitive use and no bad magical surprises
  • 63. Object Management FLOW3's take on Dependency Injection • one of the first PHP implementations (started in 2006, improved ever since) • object management for the whole lifecycle of all objects • no unnecessary configuration if information can be gatered automatically (autowiring) • intuitive use and no bad magical surprises • fast! (like hardcoded or faster)
  • 64. Aspect-Oriented 7 Programming
  • 65. <?php namespace AcmeDemoController; use TYPO3FLOW3MvcControllerActionController; class HelloWorldController extends ActionController { /** * @param string $name The name to mention * @return string */ public function greetAction($name) { return "¡Hola $name!"; } }
  • 66.
  • 67. namespace AcmeDemoAspect; use TYPO3FLOW3AopJoinPoint; use TYPO3FLOW3AnnotationsAround; class BetterWorldAspect { /** * Advice which tweaks the HelloWorld controller * * @param JoinPoint $joinPoint * @Around("method(.*Controller->greetAction())") */ public function someAdvice(JoinPoint $joinPoint) { $name = $joinPoint->getMethodArgument('name'); return sprintf("%s, you're running out of time!", $name); } }
  • 68. Robert, you’re running out of time!
  • 69. 8 Security
  • 70.
  • 71. # # Policy.yaml # resources: methods: DangerousMethods: 'method(.*Controller->(new|create|edit| update|delete)Action))' roles: User: [] Administrator: [User] acls: Administrator: methods: DangerousMethods: GRANT
  • 72.
  • 74. 9 Sessions
  • 79. 10 Command Line
  • 80.
  • 81.
  • 82.
  • 83. /** * Kickstart a new action controller * * Generates an Action Controller with the given name in the specified package. * In its default mode it will create just the controller containing a sample * indexAction. * * By specifying the --generate-actions flag, this command will also create a * set of actions. If no model or repository exists which matches the * controller name (for example "CoffeeRepository" for "CoffeeController"), * an error will be shown. * * Likewise the command exits with an error if the specified package does not * exist. By using the --generate-related flag, a missing package, model or * repository can be created alongside, avoiding such an error. * * By specifying the --generate-templates flag, this command will also create * matching Fluid templates for the actions created. This option can only be * used in combination with --generate-actions. * * The default behavior is to not overwrite any existing code. This can be * overridden by specifying the --force flag.
  • 84. * By specifying the --generate-templates flag, this command will also create * matching Fluid templates for the actions created. This option can only be * used in combination with --generate-actions. * * The default behavior is to not overwrite any existing code. This can be * overridden by specifying the --force flag. * * @param string $packageKey The package key of the package for the new controller with * @param string $controllerName The name for the new controller. This may also be a com * @param boolean $generateActions Also generate index, show, new, create, edit, update * @param boolean $generateTemplates Also generate the templates for each action. * @param boolean $generateRelated Also create the mentioned package, related model and * @param boolean $force Overwrite any existing controller or template code. Regardless * @return string * @see typo3.kickstart:kickstart:commandcontroller */ public function actionControllerCommand($packageKey, $controllerName, $generateActions = $subpackageName = ''; if (strpos('/', $packageKey) !== FALSE) { list($packageKey, $subpackageName) = explode('/', $packageKey, 2); } if (!$this->packageManager->isPackageKeyValid($packageKey)) {
  • 85.
  • 86. Rossmann • second biggest drug store in Germany • 5,13 billion € turnover • 31,000 employees Customer Database
  • 87. Amadeus • world’s biggest e-ticket provider • 217 markets • 948 million billable transactions / year • 2,7 billion € revenue Social Media Suite
  • 88. At a Glance FLOW3 is a web application platform • holistic concept for your apps • modular, extensible, package based • pedantically clean with focus on quality • puts a smile on developer’s faces • free & Open Source (LGPL v3) • backed by one of the largest Open Source projects
  • 89. Foundation for the Next Generation CMS TYPO3 “Phoenix” is the all-new Enterprise CMS • content repository, workspaces, versions, i18n, modular UI ... • powered by FLOW3 • compatible code base • use TYPO3 features in FLOW3 standalone apps as you like
  • 90. FLOW3 1.1 Release tomorrow!
  • 91. Thanks for having me! Slides: http://slideshare.net/robertlemke Examples: http://github.com/robertlemke Blog: http://robertlemke.com Twitter: @robertlemke Feedback: robert@typo3.org FLOW3: http://flow3.typo3.org