SlideShare a Scribd company logo
1 of 42
Download to read offline
A quick start on
Zend Framework 2
by Enrico Zimuel (enrico@zend.com)

Senior Software Engineer
Zend Framework Core Team
Zend Technologies Ltd




                                     © All rights reserved. Zend Technologies, Inc.
About me

                        • Enrico Zimuel (@ezimuel)
                        • Software Engineer since 1996
                               – Assembly x86, C/C++, Java, Perl, PHP
                        • PHP Engineer at Zend Technologies in
  @ezimuel                           the Zend Framework Team
  enrico@zend.com       • International speaker on PHP and
                                     computer security topics
  www.zimuel.it
                        • Researcher programmer at
                                     Informatics Institute of University
                                     of Amsterdam
                        • Co-founder of the PUG Torino (Italy)


                    © All rights reserved. Zend Technologies, Inc.
ZF2 in a slide

●   New architecture
      ▶   MVC, Di, Events, Service, Module
●   Better performance
●   Requirement: PHP 5.3.3
●   No more CLA (Contributor License Agreement)
●   Git (GitHub) instead of SVN
●   Packaging system
      ▶   pyrus, composer


                    © All rights reserved. Zend Technologies, Inc.
A new core

●   The ZF1 way:
       ▶   Singleton, Registry, and
             Hard-Coded
             Dependencies
●   The ZF2 approach:
       ▶   Aspect Oriented Design
             and Dependency
             Injection




                      © All rights reserved. Zend Technologies, Inc.
MVC is event driven


●   Everything is an event



       bootstrap                  route                             dispatch




       Listeners


                   © All rights reserved. Zend Technologies, Inc.
Releases

●   ZF2.0.0beta4
●   Goal:
     ▶   beta5 at the end of June
     ▶   ZF 2.0 RC this summer!!!




                      © All rights reserved. Zend Technologies, Inc.
Quick start
Zend Skeleton Application




        © All rights reserved. Zend Technologies, Inc.
Zend Skeleton Application

●   A simple, skeleton application using the new MVC
    layer and the module system
●   How to install:
    $   cd my/project/dir
    $   git clone git://github.com/zendframework/ZendSkeletonApplication.git
    $   cd ZendSkeletonApplication
    $   php composer.phar install




                              © All rights reserved. Zend Technologies, Inc.
Output




         © All rights reserved. Zend Technologies, Inc.
Folder's tree

  config
  data
  module
  public
  vendor




                © All rights reserved. Zend Technologies, Inc.
Config folder

  config
         autoload
     application.config.php
  data
  module
  public
  vendor



                    © All rights reserved. Zend Technologies, Inc.
Data folder

  config
  data
         cache
  module
  public
  vendor




                 © All rights reserved. Zend Technologies, Inc.
Module folder
 module
     Application                          Name of the module
             config
                 module.config.php
             src
                    Application
                          Controller
                               IndexController.php
             view
                    application
                          index
                                 index.phtml
                    error
                    layout
          Module.php

                   © All rights reserved. Zend Technologies, Inc.
Public folder

  public
       images
       js
       css
     .htaccess
     index.php




                 © All rights reserved. Zend Technologies, Inc.
Vendor folder

  config
  data
  module
  public
  vendor
         zendframework




                 © All rights reserved. Zend Technologies, Inc.
configuration



    © All rights reserved. Zend Technologies, Inc.
/config/application.config.php




             © All rights reserved. Zend Technologies, Inc.
public folder



    © All rights reserved. Zend Technologies, Inc.
public/.htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]




                 © All rights reserved. Zend Technologies, Inc.
public/index.php




            © All rights reserved. Zend Technologies, Inc.
ZendServiceManager

 ●   The ServiceManager is a Service Locator
     implementation
 ●   A Service Locator is a well-known object in
     which you may register objects (more in
     general services) and later retrieve them
 ●   Driven by configuration




                    © All rights reserved. Zend Technologies, Inc.
Types of Services

 ●   Explicit (name => object pairs)
 ●   Invokables (name => class to instantiate)
 ●   Factories (name => callable returning object)
 ●   Aliases (name => some other name)
 ●   Abstract Factories (unknown services)
 ●   Scoped Containers (limit what can be created)
 ●   Shared (or not; you decide)



                   © All rights reserved. Zend Technologies, Inc.
module



 © All rights reserved. Zend Technologies, Inc.
Modules by default



 A module is all related code and assets
     that solve a specific problem.
Modules inform the MVC about services
          and event listeners




              © All rights reserved. Zend Technologies, Inc.
Modules for ZF2

●   The basic unit in a ZF2 application
    is a Module
●   Modules are “Plug and play” technology
●   Modules are simple:
       ▶   A namespace
       ▶   Containing a single classfile: Module.php




                      © All rights reserved. Zend Technologies, Inc.
Develop Modules

●   Modules contain all logic related to a
    discrete application problem.
       ▶   Controllers
       ▶   Entities
       ▶   Plugins
       ▶   Etc.
●   99% of the time, you will write modules


                      © All rights reserved. Zend Technologies, Inc.
moduleApplicationModule.php




            © All rights reserved. Zend Technologies, Inc.
/module/Application/config/module.config.php
(routing part)




                © All rights reserved. Zend Technologies, Inc.
/module/Application/config/module.config.php
(controller part)




                © All rights reserved. Zend Technologies, Inc.
/module/Application/config/module.config.php
(view)




                © All rights reserved. Zend Technologies, Inc.
/module/Application/src/Application/
    Controller/IndexController.php




                Passing array() of variables to the view


                 © All rights reserved. Zend Technologies, Inc.
Packaging system




     © All rights reserved. Zend Technologies, Inc.
Pyrus

●   http://packages.zendframework.com/
●   Download or use pyrus, a PEAR2 installer
●   Pyrus packages:
     ▶   Pyrus setup
     ▶   wget http://packages.zendframework.com/pyrus.phar
     ▶   pyrus.phar .
     ▶   pyrus.phar . channel­discover packages.zendframework.com

     ▶   Install a Zend_<component>
     ▶   pyrus.phar . install zf2/Zend_<component>




                        © All rights reserved. Zend Technologies, Inc.
Composer

●   New package management and distribution
    tool
●   http://packagist.org/
●   http://getcomposer.org/




                   © All rights reserved. Zend Technologies, Inc.
composer.json




          © All rights reserved. Zend Technologies, Inc.
From ZF1 to ZF2




     © All rights reserved. Zend Technologies, Inc.
From ZF1 to ZF2

●   Goal: migrate without rewriting much code!
●   Main steps
       ▶   Namespace: Zend_Foo => ZendFoo
       ▶   Autoloading: 3 options
       ▶   MVC: module, event based, dispatchable
       ▶   DB: new ZendDb
       ▶   Form: new ZendForm
●   Can run in parallel (instant migration!)


                     © All rights reserved. Zend Technologies, Inc.
Conclusion:
ZF2 rocks!



   © All rights reserved. Zend Technologies, Inc.
Why ZF2 rocks!

●   Based on solid architecture principles
●   Very fast (focused on optimization)
●   Open architecture (event driven)
●   Support of modules (reuse of the code)
●   Driven by the community
    (100% open source)
●   Completed tested (PHPUnit, Travis CI)
●   Packages (pyrus, composer)



                      © All rights reserved. Zend Technologies, Inc.
We want you!

●   How to contribute:
    ▶   Write code
    ▶   Documentation
    ▶   Testing
    ▶   Feedbacks/comments




         https://github.com/zendframework/zf2

                     © All rights reserved. Zend Technologies, Inc.
Helping out

●   http://framework.zend.com/zf2
●   http://github.com/zendframework
●   https://github.com/zendframework/ZendSkeletonApplication
●   Getting Started with Zend Framework 2
    by Rob Allen, http://www.akrabat.com
●   Weekly IRC meetings (#zf2-meeting on
    Freenode)
●   #zftalk.2 on Freenode IRC



                       © All rights reserved. Zend Technologies, Inc.
Thank you!

 ●   Comment this talk at:
       ▶   https://joind.in/6237
 ●   Direct contact:
       ▶   enrico@zend.com
       ▶   @ezimuel




                      © All rights reserved. Zend Technologies, Inc.

More Related Content

What's hot

Cryptography with Zend Framework
Cryptography with Zend FrameworkCryptography with Zend Framework
Cryptography with Zend FrameworkEnrico Zimuel
 
ZF2 Modular Architecture - Taking advantage of it
ZF2 Modular Architecture - Taking advantage of itZF2 Modular Architecture - Taking advantage of it
ZF2 Modular Architecture - Taking advantage of itSteve Maraspin
 
ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)
ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)
ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)ZFConf Conference
 
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)Enrico Zimuel
 
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)ZFConf Conference
 
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf Conference
 
Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2Stefano Valle
 
Zend Framework 2 - presentation
Zend Framework 2 - presentationZend Framework 2 - presentation
Zend Framework 2 - presentationyamcsha
 
ZFConf 2012: Реализация доступа к СУБД IBM DB2 посредством встраиваемого SQL ...
ZFConf 2012: Реализация доступа к СУБД IBM DB2 посредством встраиваемого SQL ...ZFConf 2012: Реализация доступа к СУБД IBM DB2 посредством встраиваемого SQL ...
ZFConf 2012: Реализация доступа к СУБД IBM DB2 посредством встраиваемого SQL ...ZFConf Conference
 
When dynamic becomes static
When dynamic becomes staticWhen dynamic becomes static
When dynamic becomes staticWim Godden
 
20120722 word press
20120722 word press20120722 word press
20120722 word pressSeungmin Sun
 
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"Fwdays
 
A Zend Architecture presentation
A Zend Architecture presentationA Zend Architecture presentation
A Zend Architecture presentationtechweb08
 
How to build customizable multitenant web applications - PHPBNL11
How to build customizable multitenant web applications - PHPBNL11How to build customizable multitenant web applications - PHPBNL11
How to build customizable multitenant web applications - PHPBNL11Stephan Hochdörfer
 
Authentication with zend framework
Authentication with zend frameworkAuthentication with zend framework
Authentication with zend frameworkGeorge Mihailov
 
Zend\Expressive - höher, schneller, weiter
Zend\Expressive - höher, schneller, weiterZend\Expressive - höher, schneller, weiter
Zend\Expressive - höher, schneller, weiterRalf Eggert
 

What's hot (20)

Cryptography with Zend Framework
Cryptography with Zend FrameworkCryptography with Zend Framework
Cryptography with Zend Framework
 
ZF2 Modular Architecture - Taking advantage of it
ZF2 Modular Architecture - Taking advantage of itZF2 Modular Architecture - Taking advantage of it
ZF2 Modular Architecture - Taking advantage of it
 
ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)
ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)
ZFConf 2012: Zend Framework 2, a quick start (Enrico Zimuel)
 
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
Manage cloud infrastructures in PHP using Zend Framework 2 (and 1)
 
Zend Framework 2 Patterns
Zend Framework 2 PatternsZend Framework 2 Patterns
Zend Framework 2 Patterns
 
ZF2 Presentation @PHP Tour 2011 in Lille
ZF2 Presentation @PHP Tour 2011 in LilleZF2 Presentation @PHP Tour 2011 in Lille
ZF2 Presentation @PHP Tour 2011 in Lille
 
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)
 
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
 
Introduction to Zend Framework
Introduction to Zend FrameworkIntroduction to Zend Framework
Introduction to Zend Framework
 
Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2
 
Zend Framework 2 - presentation
Zend Framework 2 - presentationZend Framework 2 - presentation
Zend Framework 2 - presentation
 
ZFConf 2012: Реализация доступа к СУБД IBM DB2 посредством встраиваемого SQL ...
ZFConf 2012: Реализация доступа к СУБД IBM DB2 посредством встраиваемого SQL ...ZFConf 2012: Реализация доступа к СУБД IBM DB2 посредством встраиваемого SQL ...
ZFConf 2012: Реализация доступа к СУБД IBM DB2 посредством встраиваемого SQL ...
 
When dynamic becomes static
When dynamic becomes staticWhen dynamic becomes static
When dynamic becomes static
 
20120722 word press
20120722 word press20120722 word press
20120722 word press
 
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"
 
2007 Zend Con Mvc Edited Irmantas
2007 Zend Con Mvc Edited Irmantas2007 Zend Con Mvc Edited Irmantas
2007 Zend Con Mvc Edited Irmantas
 
A Zend Architecture presentation
A Zend Architecture presentationA Zend Architecture presentation
A Zend Architecture presentation
 
How to build customizable multitenant web applications - PHPBNL11
How to build customizable multitenant web applications - PHPBNL11How to build customizable multitenant web applications - PHPBNL11
How to build customizable multitenant web applications - PHPBNL11
 
Authentication with zend framework
Authentication with zend frameworkAuthentication with zend framework
Authentication with zend framework
 
Zend\Expressive - höher, schneller, weiter
Zend\Expressive - höher, schneller, weiterZend\Expressive - höher, schneller, weiter
Zend\Expressive - höher, schneller, weiter
 

Similar to Quick start on Zend Framework 2

How to Manage Cloud Infrastructures using Zend Framework
How to Manage Cloud Infrastructures using Zend FrameworkHow to Manage Cloud Infrastructures using Zend Framework
How to Manage Cloud Infrastructures using Zend FrameworkZend by Rogue Wave Software
 
Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...
Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...
Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...Zend by Rogue Wave Software
 
How to scale PHP applications
How to scale PHP applicationsHow to scale PHP applications
How to scale PHP applicationsEnrico Zimuel
 
High performance PHP: Scaling and getting the most out of your infrastructure
High performance PHP: Scaling and getting the most out of your infrastructureHigh performance PHP: Scaling and getting the most out of your infrastructure
High performance PHP: Scaling and getting the most out of your infrastructuremkherlakian
 
Better Bug Stomping with Zend Studio and Zend Server
Better Bug Stomping with Zend Studio and Zend ServerBetter Bug Stomping with Zend Studio and Zend Server
Better Bug Stomping with Zend Studio and Zend ServerZend by Rogue Wave Software
 
Zend Framework 1.8 workshop
Zend Framework 1.8 workshopZend Framework 1.8 workshop
Zend Framework 1.8 workshopNick Belhomme
 
PHP QA Tools
PHP QA ToolsPHP QA Tools
PHP QA Toolsrjsmelo
 
Zend Products and PHP for IBMi
Zend Products and PHP for IBMi  Zend Products and PHP for IBMi
Zend Products and PHP for IBMi Shlomo Vanunu
 
Building and managing applications fast for IBM i
Building and managing applications fast for IBM iBuilding and managing applications fast for IBM i
Building and managing applications fast for IBM iZend by Rogue Wave Software
 
Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Bastian Feder
 
Model serving made easy using Kedro pipelines - Mariusz Strzelecki, GetInData
Model serving made easy using Kedro pipelines - Mariusz Strzelecki, GetInDataModel serving made easy using Kedro pipelines - Mariusz Strzelecki, GetInData
Model serving made easy using Kedro pipelines - Mariusz Strzelecki, GetInDataGetInData
 
Zend MVC pattern based Framework – Best for Enterprise web applications
Zend MVC pattern based Framework – Best for Enterprise web applicationsZend MVC pattern based Framework – Best for Enterprise web applications
Zend MVC pattern based Framework – Best for Enterprise web applicationsEtisbew Technology Group
 
Multiconf - Python Configuration API
Multiconf - Python Configuration APIMulticonf - Python Configuration API
Multiconf - Python Configuration APIlarshni
 
PhpStorm: Symfony2 Plugin
PhpStorm: Symfony2 PluginPhpStorm: Symfony2 Plugin
PhpStorm: Symfony2 PluginHaehnchen
 
Turbocharging php applications with zend server
Turbocharging php applications with zend serverTurbocharging php applications with zend server
Turbocharging php applications with zend serverEric Ritchie
 

Similar to Quick start on Zend Framework 2 (20)

How to Manage Cloud Infrastructures using Zend Framework
How to Manage Cloud Infrastructures using Zend FrameworkHow to Manage Cloud Infrastructures using Zend Framework
How to Manage Cloud Infrastructures using Zend Framework
 
Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...
Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...
Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...
 
How to scale PHP applications
How to scale PHP applicationsHow to scale PHP applications
How to scale PHP applications
 
Zend
ZendZend
Zend
 
green
greengreen
green
 
High performance PHP: Scaling and getting the most out of your infrastructure
High performance PHP: Scaling and getting the most out of your infrastructureHigh performance PHP: Scaling and getting the most out of your infrastructure
High performance PHP: Scaling and getting the most out of your infrastructure
 
Better Bug Stomping with Zend Studio and Zend Server
Better Bug Stomping with Zend Studio and Zend ServerBetter Bug Stomping with Zend Studio and Zend Server
Better Bug Stomping with Zend Studio and Zend Server
 
Zend Framework 1.8 workshop
Zend Framework 1.8 workshopZend Framework 1.8 workshop
Zend Framework 1.8 workshop
 
PHP QA Tools
PHP QA ToolsPHP QA Tools
PHP QA Tools
 
Zend Products and PHP for IBMi
Zend Products and PHP for IBMi  Zend Products and PHP for IBMi
Zend Products and PHP for IBMi
 
Building and managing applications fast for IBM i
Building and managing applications fast for IBM iBuilding and managing applications fast for IBM i
Building and managing applications fast for IBM i
 
Zend framework 01 - introduction
Zend framework 01 - introductionZend framework 01 - introduction
Zend framework 01 - introduction
 
Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1
 
Model serving made easy using Kedro pipelines - Mariusz Strzelecki, GetInData
Model serving made easy using Kedro pipelines - Mariusz Strzelecki, GetInDataModel serving made easy using Kedro pipelines - Mariusz Strzelecki, GetInData
Model serving made easy using Kedro pipelines - Mariusz Strzelecki, GetInData
 
Zend MVC pattern based Framework – Best for Enterprise web applications
Zend MVC pattern based Framework – Best for Enterprise web applicationsZend MVC pattern based Framework – Best for Enterprise web applications
Zend MVC pattern based Framework – Best for Enterprise web applications
 
Cryptography in PHP: Some Use Cases
Cryptography in PHP: Some Use CasesCryptography in PHP: Some Use Cases
Cryptography in PHP: Some Use Cases
 
Multiconf - Python Configuration API
Multiconf - Python Configuration APIMulticonf - Python Configuration API
Multiconf - Python Configuration API
 
Dev & Prod - PHP Applications in the Cloud
Dev & Prod - PHP Applications in the CloudDev & Prod - PHP Applications in the Cloud
Dev & Prod - PHP Applications in the Cloud
 
PhpStorm: Symfony2 Plugin
PhpStorm: Symfony2 PluginPhpStorm: Symfony2 Plugin
PhpStorm: Symfony2 Plugin
 
Turbocharging php applications with zend server
Turbocharging php applications with zend serverTurbocharging php applications with zend server
Turbocharging php applications with zend server
 

More from Enrico Zimuel

Password (in)security
Password (in)securityPassword (in)security
Password (in)securityEnrico Zimuel
 
Integrare Zend Framework in Wordpress
Integrare Zend Framework in WordpressIntegrare Zend Framework in Wordpress
Integrare Zend Framework in WordpressEnrico Zimuel
 
Introduzione alla Posta Elettronica Certificata (PEC): le regole tecniche
Introduzione alla Posta Elettronica Certificata (PEC): le regole tecnicheIntroduzione alla Posta Elettronica Certificata (PEC): le regole tecniche
Introduzione alla Posta Elettronica Certificata (PEC): le regole tecnicheEnrico Zimuel
 
Cryptography in PHP: use cases
Cryptography in PHP: use casesCryptography in PHP: use cases
Cryptography in PHP: use casesEnrico Zimuel
 
Framework software e Zend Framework
Framework software e Zend FrameworkFramework software e Zend Framework
Framework software e Zend FrameworkEnrico Zimuel
 
Strong cryptography in PHP
Strong cryptography in PHPStrong cryptography in PHP
Strong cryptography in PHPEnrico Zimuel
 
Velocizzare Joomla! con Zend Server Community Edition
Velocizzare Joomla! con Zend Server Community EditionVelocizzare Joomla! con Zend Server Community Edition
Velocizzare Joomla! con Zend Server Community EditionEnrico Zimuel
 
Zend_Cache: how to improve the performance of PHP applications
Zend_Cache: how to improve the performance of PHP applicationsZend_Cache: how to improve the performance of PHP applications
Zend_Cache: how to improve the performance of PHP applicationsEnrico Zimuel
 
XCheck a benchmark checker for XML query processors
XCheck a benchmark checker for XML query processorsXCheck a benchmark checker for XML query processors
XCheck a benchmark checker for XML query processorsEnrico Zimuel
 
Introduzione alle tabelle hash
Introduzione alle tabelle hashIntroduzione alle tabelle hash
Introduzione alle tabelle hashEnrico Zimuel
 
Crittografia quantistica: fantascienza o realtà?
Crittografia quantistica: fantascienza o realtà?Crittografia quantistica: fantascienza o realtà?
Crittografia quantistica: fantascienza o realtà?Enrico Zimuel
 
Introduzione alla crittografia
Introduzione alla crittografiaIntroduzione alla crittografia
Introduzione alla crittografiaEnrico Zimuel
 
Crittografia è sinonimo di sicurezza?
Crittografia è sinonimo di sicurezza?Crittografia è sinonimo di sicurezza?
Crittografia è sinonimo di sicurezza?Enrico Zimuel
 
Sviluppo di applicazioni sicure
Sviluppo di applicazioni sicureSviluppo di applicazioni sicure
Sviluppo di applicazioni sicureEnrico Zimuel
 
Misure minime di sicurezza informatica
Misure minime di sicurezza informaticaMisure minime di sicurezza informatica
Misure minime di sicurezza informaticaEnrico Zimuel
 
La sicurezza delle applicazioni in PHP
La sicurezza delle applicazioni in PHPLa sicurezza delle applicazioni in PHP
La sicurezza delle applicazioni in PHPEnrico Zimuel
 

More from Enrico Zimuel (20)

Password (in)security
Password (in)securityPassword (in)security
Password (in)security
 
Integrare Zend Framework in Wordpress
Integrare Zend Framework in WordpressIntegrare Zend Framework in Wordpress
Integrare Zend Framework in Wordpress
 
Introduzione alla Posta Elettronica Certificata (PEC): le regole tecniche
Introduzione alla Posta Elettronica Certificata (PEC): le regole tecnicheIntroduzione alla Posta Elettronica Certificata (PEC): le regole tecniche
Introduzione alla Posta Elettronica Certificata (PEC): le regole tecniche
 
PHP goes mobile
PHP goes mobilePHP goes mobile
PHP goes mobile
 
Zend Framework 2
Zend Framework 2Zend Framework 2
Zend Framework 2
 
Cryptography in PHP: use cases
Cryptography in PHP: use casesCryptography in PHP: use cases
Cryptography in PHP: use cases
 
Framework software e Zend Framework
Framework software e Zend FrameworkFramework software e Zend Framework
Framework software e Zend Framework
 
Strong cryptography in PHP
Strong cryptography in PHPStrong cryptography in PHP
Strong cryptography in PHP
 
Velocizzare Joomla! con Zend Server Community Edition
Velocizzare Joomla! con Zend Server Community EditionVelocizzare Joomla! con Zend Server Community Edition
Velocizzare Joomla! con Zend Server Community Edition
 
Zend_Cache: how to improve the performance of PHP applications
Zend_Cache: how to improve the performance of PHP applicationsZend_Cache: how to improve the performance of PHP applications
Zend_Cache: how to improve the performance of PHP applications
 
XCheck a benchmark checker for XML query processors
XCheck a benchmark checker for XML query processorsXCheck a benchmark checker for XML query processors
XCheck a benchmark checker for XML query processors
 
Introduzione alle tabelle hash
Introduzione alle tabelle hashIntroduzione alle tabelle hash
Introduzione alle tabelle hash
 
Crittografia quantistica: fantascienza o realtà?
Crittografia quantistica: fantascienza o realtà?Crittografia quantistica: fantascienza o realtà?
Crittografia quantistica: fantascienza o realtà?
 
Introduzione alla crittografia
Introduzione alla crittografiaIntroduzione alla crittografia
Introduzione alla crittografia
 
Crittografia è sinonimo di sicurezza?
Crittografia è sinonimo di sicurezza?Crittografia è sinonimo di sicurezza?
Crittografia è sinonimo di sicurezza?
 
Sviluppo di applicazioni sicure
Sviluppo di applicazioni sicureSviluppo di applicazioni sicure
Sviluppo di applicazioni sicure
 
Misure minime di sicurezza informatica
Misure minime di sicurezza informaticaMisure minime di sicurezza informatica
Misure minime di sicurezza informatica
 
PHP e crittografia
PHP e crittografiaPHP e crittografia
PHP e crittografia
 
La sicurezza delle applicazioni in PHP
La sicurezza delle applicazioni in PHPLa sicurezza delle applicazioni in PHP
La sicurezza delle applicazioni in PHP
 
Firma digitale
Firma digitaleFirma digitale
Firma digitale
 

Recently uploaded

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
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
 
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
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
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
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
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
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 

Recently uploaded (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
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
 
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
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
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!
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
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
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 

Quick start on Zend Framework 2

  • 1. A quick start on Zend Framework 2 by Enrico Zimuel (enrico@zend.com) Senior Software Engineer Zend Framework Core Team Zend Technologies Ltd © All rights reserved. Zend Technologies, Inc.
  • 2. About me • Enrico Zimuel (@ezimuel) • Software Engineer since 1996 – Assembly x86, C/C++, Java, Perl, PHP • PHP Engineer at Zend Technologies in @ezimuel the Zend Framework Team enrico@zend.com • International speaker on PHP and computer security topics www.zimuel.it • Researcher programmer at Informatics Institute of University of Amsterdam • Co-founder of the PUG Torino (Italy) © All rights reserved. Zend Technologies, Inc.
  • 3. ZF2 in a slide ● New architecture ▶ MVC, Di, Events, Service, Module ● Better performance ● Requirement: PHP 5.3.3 ● No more CLA (Contributor License Agreement) ● Git (GitHub) instead of SVN ● Packaging system ▶ pyrus, composer © All rights reserved. Zend Technologies, Inc.
  • 4. A new core ● The ZF1 way: ▶ Singleton, Registry, and Hard-Coded Dependencies ● The ZF2 approach: ▶ Aspect Oriented Design and Dependency Injection © All rights reserved. Zend Technologies, Inc.
  • 5. MVC is event driven ● Everything is an event bootstrap route dispatch Listeners © All rights reserved. Zend Technologies, Inc.
  • 6. Releases ● ZF2.0.0beta4 ● Goal: ▶ beta5 at the end of June ▶ ZF 2.0 RC this summer!!! © All rights reserved. Zend Technologies, Inc.
  • 7. Quick start Zend Skeleton Application © All rights reserved. Zend Technologies, Inc.
  • 8. Zend Skeleton Application ● A simple, skeleton application using the new MVC layer and the module system ● How to install: $ cd my/project/dir $ git clone git://github.com/zendframework/ZendSkeletonApplication.git $ cd ZendSkeletonApplication $ php composer.phar install © All rights reserved. Zend Technologies, Inc.
  • 9. Output © All rights reserved. Zend Technologies, Inc.
  • 10. Folder's tree config data module public vendor © All rights reserved. Zend Technologies, Inc.
  • 11. Config folder config autoload application.config.php data module public vendor © All rights reserved. Zend Technologies, Inc.
  • 12. Data folder config data cache module public vendor © All rights reserved. Zend Technologies, Inc.
  • 13. Module folder module Application Name of the module config module.config.php src Application Controller IndexController.php view application index index.phtml error layout Module.php © All rights reserved. Zend Technologies, Inc.
  • 14. Public folder public images js css .htaccess index.php © All rights reserved. Zend Technologies, Inc.
  • 15. Vendor folder config data module public vendor zendframework © All rights reserved. Zend Technologies, Inc.
  • 16. configuration © All rights reserved. Zend Technologies, Inc.
  • 17. /config/application.config.php © All rights reserved. Zend Technologies, Inc.
  • 18. public folder © All rights reserved. Zend Technologies, Inc.
  • 19. public/.htaccess RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] © All rights reserved. Zend Technologies, Inc.
  • 20. public/index.php © All rights reserved. Zend Technologies, Inc.
  • 21. ZendServiceManager ● The ServiceManager is a Service Locator implementation ● A Service Locator is a well-known object in which you may register objects (more in general services) and later retrieve them ● Driven by configuration © All rights reserved. Zend Technologies, Inc.
  • 22. Types of Services ● Explicit (name => object pairs) ● Invokables (name => class to instantiate) ● Factories (name => callable returning object) ● Aliases (name => some other name) ● Abstract Factories (unknown services) ● Scoped Containers (limit what can be created) ● Shared (or not; you decide) © All rights reserved. Zend Technologies, Inc.
  • 23. module © All rights reserved. Zend Technologies, Inc.
  • 24. Modules by default A module is all related code and assets that solve a specific problem. Modules inform the MVC about services and event listeners © All rights reserved. Zend Technologies, Inc.
  • 25. Modules for ZF2 ● The basic unit in a ZF2 application is a Module ● Modules are “Plug and play” technology ● Modules are simple: ▶ A namespace ▶ Containing a single classfile: Module.php © All rights reserved. Zend Technologies, Inc.
  • 26. Develop Modules ● Modules contain all logic related to a discrete application problem. ▶ Controllers ▶ Entities ▶ Plugins ▶ Etc. ● 99% of the time, you will write modules © All rights reserved. Zend Technologies, Inc.
  • 27. moduleApplicationModule.php © All rights reserved. Zend Technologies, Inc.
  • 28. /module/Application/config/module.config.php (routing part) © All rights reserved. Zend Technologies, Inc.
  • 29. /module/Application/config/module.config.php (controller part) © All rights reserved. Zend Technologies, Inc.
  • 30. /module/Application/config/module.config.php (view) © All rights reserved. Zend Technologies, Inc.
  • 31. /module/Application/src/Application/ Controller/IndexController.php Passing array() of variables to the view © All rights reserved. Zend Technologies, Inc.
  • 32. Packaging system © All rights reserved. Zend Technologies, Inc.
  • 33. Pyrus ● http://packages.zendframework.com/ ● Download or use pyrus, a PEAR2 installer ● Pyrus packages: ▶ Pyrus setup ▶ wget http://packages.zendframework.com/pyrus.phar ▶ pyrus.phar . ▶ pyrus.phar . channel­discover packages.zendframework.com ▶ Install a Zend_<component> ▶ pyrus.phar . install zf2/Zend_<component> © All rights reserved. Zend Technologies, Inc.
  • 34. Composer ● New package management and distribution tool ● http://packagist.org/ ● http://getcomposer.org/ © All rights reserved. Zend Technologies, Inc.
  • 35. composer.json © All rights reserved. Zend Technologies, Inc.
  • 36. From ZF1 to ZF2 © All rights reserved. Zend Technologies, Inc.
  • 37. From ZF1 to ZF2 ● Goal: migrate without rewriting much code! ● Main steps ▶ Namespace: Zend_Foo => ZendFoo ▶ Autoloading: 3 options ▶ MVC: module, event based, dispatchable ▶ DB: new ZendDb ▶ Form: new ZendForm ● Can run in parallel (instant migration!) © All rights reserved. Zend Technologies, Inc.
  • 38. Conclusion: ZF2 rocks! © All rights reserved. Zend Technologies, Inc.
  • 39. Why ZF2 rocks! ● Based on solid architecture principles ● Very fast (focused on optimization) ● Open architecture (event driven) ● Support of modules (reuse of the code) ● Driven by the community (100% open source) ● Completed tested (PHPUnit, Travis CI) ● Packages (pyrus, composer) © All rights reserved. Zend Technologies, Inc.
  • 40. We want you! ● How to contribute: ▶ Write code ▶ Documentation ▶ Testing ▶ Feedbacks/comments https://github.com/zendframework/zf2 © All rights reserved. Zend Technologies, Inc.
  • 41. Helping out ● http://framework.zend.com/zf2 ● http://github.com/zendframework ● https://github.com/zendframework/ZendSkeletonApplication ● Getting Started with Zend Framework 2 by Rob Allen, http://www.akrabat.com ● Weekly IRC meetings (#zf2-meeting on Freenode) ● #zftalk.2 on Freenode IRC © All rights reserved. Zend Technologies, Inc.
  • 42. Thank you! ● Comment this talk at: ▶ https://joind.in/6237 ● Direct contact: ▶ enrico@zend.com ▶ @ezimuel © All rights reserved. Zend Technologies, Inc.