InspiringCon15: Bringing TYPO3 Legacy Applications into the Flow

InspiringCon15: Bringing TYPO3 Legacy Applications into the Flow

License: CC BY-SA

With the release of TYPO3 Flow in 2011 and TYPO3 Neos in 2012, a both flexible and powerful platform was introduced as a possible successor for TYPO3 CMS. However, migration from TYPO3 CMS to TYPO3 Flow and Neos still presents a challenge due to large conceptual differences between the two systems.

This talk will show how the theoretical concepts (which I presented at an earlier talk at T3CONEU14) can be implemented in software to automate a lot of the necessary steps of a TYPO3-to-Flow migration and also present some real-world applications and experiences.

2b68bc93708466a655a4c60458dc7955?s=128

Martin Helmich

March 28, 2015
Tweet

Transcript

  1. 1.

    CC BY-SA, James Hammond https://www.flickr.com/photos/jameshammond/8732132809 Bringing TYPO3 Legacy Applications into

    the Flow Martin Helmich m.helmich@mittwald.de @martin-helmich Inspiring Conference 2015, Kolbermoor March 28th, 2015
  2. 2.

    Martin Helmich Software Architect at Mittwald @martin-helmich @mittwald CC BY-SA,

    Wolfgang Wagner https://www.flickr.com/photos/wolfgang-wagner/16958684785
  3. 6.
  4. 20.

    namespace  My\Ext\Domain\Model;   use  TYPO3\Flow\Annotations  as  Flow;   use  Doctrine\ORM\Mapping

     as  ORM;   /**    *  @Flow\Entity    */   class  Car  {      /**        *  @var  string        *  @Flow\Validate('NotEmpty')        */      protected  $licenseNumber;      /**        *  @var  Manufacturer        *  @ORM\ManyToOne        */      protected  $manufacturer;   } class  Tx_MyExt_Domain_Model_Car  extends        Tx_Extbase_DomainObject_AbstractEntity  {      /**        *  @var  string        *  @validate  notempty        */      protected  $licenseNumber;      /**        *  @var  Tx_MyExt_Domain_Model_Manufacturer        */      protected  $manufacturer;   } TYPO3 CMS (Extbase) TYPO3 Flow
  5. 21.

    namespace  My\Ext\Domain\Model;   use  TYPO3\Flow\Annotations  as  Flow;   use  Doctrine\ORM\Mapping

     as  ORM;   /**    *  @Flow\Entity    */   class  Car  {      /**        *  @var  string        *  @Flow\Validate('NotEmpty')        */      protected  $licenseNumber;      /**        *  @var  Manufacturer        *  @ORM\ManyToOne        */      protected  $manufacturer;   } class  Tx_MyExt_Domain_Model_Car  extends        Tx_Extbase_DomainObject_AbstractEntity  {      /**        *  @var  string        *  @validate  notempty        */      protected  $licenseNumber;      /**        *  @var  Tx_MyExt_Domain_Model_Manufacturer        */      protected  $manufacturer;   } TYPO3 CMS (Extbase) TYPO3 Flow
  6. 22.

    namespace  My\Ext\Domain\Model;   use  TYPO3\Flow\Annotations  as  Flow;   use  Doctrine\ORM\Mapping

     as  ORM;   /**    *  @Flow\Entity    */   class  Car  {      /**        *  @var  string        *  @Flow\Validate('NotEmpty')        */      protected  $licenseNumber;      /**        *  @var  Manufacturer        *  @ORM\ManyToOne        */      protected  $manufacturer;   } class  Tx_MyExt_Domain_Model_Car  extends        Tx_Extbase_DomainObject_AbstractEntity  {      /**        *  @var  string        *  @validate  notempty        */      protected  $licenseNumber;      /**        *  @var  Tx_MyExt_Domain_Model_Manufacturer        */      protected  $manufacturer;   } TYPO3 CMS (Extbase) TYPO3 Flow
  7. 23.

    namespace  My\Ext\Domain\Model;   use  TYPO3\Flow\Annotations  as  Flow;   use  Doctrine\ORM\Mapping

     as  ORM;   /**    *  @Flow\Entity    */   class  Car  {      /**        *  @var  string        *  @Flow\Validate('NotEmpty')        */      protected  $licenseNumber;      /**        *  @var  Manufacturer        *  @ORM\ManyToOne        */      protected  $manufacturer;   } class  Tx_MyExt_Domain_Model_Car  extends        Tx_Extbase_DomainObject_AbstractEntity  {      /**        *  @var  string        *  @validate  notempty        */      protected  $licenseNumber;      /**        *  @var  Tx_MyExt_Domain_Model_Manufacturer        */      protected  $manufacturer;   } TYPO3 CMS (Extbase) TYPO3 Flow
  8. 32.

    <?php   class  FooTastic  {      public  function  

    hello($who)  {          echo  "Hello   $who!";      }   }   hello.php Input Source File
  9. 33.

    <?php   class  FooTastic  {      public  function  

    hello($who)  {          echo  "Hello   $who!";      }   }   hello.php Input Source File Parser
  10. 34.

    <?php   class  FooTastic  {      public  function  

    hello($who)  {          echo  "Hello   $who!";      }   }   hello.php Input Source File Parser Abstract Syntax Tree
  11. 35.

    class  Tx_MyExt_Domain_Model_Car  extends        Tx_Extbase_DomainObject_AbstractEntity  {    

     /**        *  @var  string        *  @validate  notempty        */      protected  $licenseNumber;      /**        *  @var  Tx_MyExt_Domain_Model_Manufacturer        */      protected  $manufacturer;   } Source Code
  12. 36.

    class  Tx_MyExt_Domain_Model_Car  extends        Tx_Extbase_DomainObject_AbstractEntity  {    

     /**        *  @var  string        *  @validate  notempty        */      protected  $licenseNumber;      /**        *  @var  Tx_MyExt_Domain_Model_Manufacturer        */      protected  $manufacturer;   } class name=Tx_..._Car abstract=false final=false extends name=Tx_..._AbstractEntity stmts property name=licenseNumber docComment="/**\n..." property name=manufacturer docComment="/**\n..." Source Code Syntax Tree
  13. 37.

    <?php   class  FooTastic  {      public  function  

    hello($who)  {          echo  "Hello   $who!";      }   }   hello.php Input Source File Parser Abstract Syntax Tree
  14. 38.

    <?php   class  FooTastic  {      public  function  

    hello($who)  {          echo  "Hello   $who!";      }   }   hello.php Input Source File Parser Transformation Rules Trans- former Abstract Syntax Tree
  15. 39.

    <?php   class  FooTastic  {      public  function  

    hello($who)  {          echo  "Hello   $who!";      }   }   hello.php Input Source File Parser Transformation Rules Trans- former Printer <?php   namespace  Foo;   class  FooTastic  {      /**  @Flow\Inject  */      protected  $greeter;      public  function   hello($who)  {          $this-­‐>greeter-­‐ >greet($who);      } hello_improved.php output Source File(s) Abstract Syntax Tree
  16. 40.

    <?php   class  FooTastic  {      public  function  

    hello($who)  {          echo  "Hello   $who!";      }   }   hello.php Input Source File Parser class  FooTastic:      def  hello(who):          print  "Hello  %s"\                                  %  who   hello.py Transformation Rules Trans- former Printer <?php   namespace  Foo;   class  FooTastic  {      /**  @Flow\Inject  */      protected  $greeter;      public  function   hello($who)  {          $this-­‐>greeter-­‐ >greet($who);      } hello_improved.php output Source File(s) Abstract Syntax Tree
  17. 41.

    namespace  My\Ext\Domain\Model;   use  TYPO3\Flow\Annotations  as  Flow;   use  Doctrine\ORM\Mapping

     as  ORM;   /**    *  @Flow\Entity    */   class  Car  {      /**        *  @var  string        *  @Flow\Validate('NotEmpty')        */      protected  $licenseNumber;      /**        *  @var  Manufacturer        *  @ORM\ManyToOne        */      protected  $manufacturer;   } class  Tx_MyExt_Domain_Model_Car  extends        Tx_Extbase_DomainObject_AbstractEntity  {      /**        *  @var  string        *  @validate  notempty        */      protected  $licenseNumber;      /**        *  @var  Tx_MyExt_Domain_Model_Manufacturer        */      protected  $manufacturer;   } TYPO3 CMS (Extbase) TYPO3 Flow
  18. 42.

    namespace name=Mw\MyExt\Domain\Model uses use name=Mw\...\AbstractVehicle alias=AbstractVehicle stmts class name=Car abstract=false

    final=false extends name=AbstractVehicle stmts BEFORE AFTER „Rename Tx_MyExt_Domain_Model_Car to Mw\MyExt\Domain\Model\Car“ class name=Tx_..._Car abstract=false final=false extends name=Tx_..._AbstractVehicle stmts property name=licenseNumber docComment="/**\n..." property name=manufacturer docComment="/**\n..."
  19. 43.
  20. 44.
  21. 52.

    Open Problems Proof of correctness „How do I know that

    the auto-generated code is correct?“
  22. 53.

    Open Problems Ease of Extensibility „I want to migrate from

    Zend to Flow, but writing new transformation rules is just too complex!“
  23. 57.

    Thank you This work is licensed under a Creative Commons

    Attribution- ShareAlike 4.0 International License. m.helmich@mittwald.de @martin-helmich https://github.com/martin-helmich https://github.com/mittwald/flow-metamorph