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

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
 
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
 
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
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
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
 
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsFact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsZilliz
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Recently uploaded (20)

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
 
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
 
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
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
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
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
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
 
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsFact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

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.