SlideShare una empresa de Scribd logo
1 de 114
Descargar para leer sin conexión
symfony
                     An Open-Source Framework
                          for Professionals
                            Fabien Potencier



www.sensiolabs.com
Before we begin



              How many have already
             used symfony for a project,
         even a very small personal project?


www.sensiolabs.com
Before we begin




                          Do you want to do
                     the exercices on your laptop?



www.sensiolabs.com
Sensio
  • Sensio                                                    Sensio
                                                            Web Agency
         – Web Agency
                                                                           Internet
                                             Webmarketing
         – Founded in 1998                                               Technologies



         – 45 people dedicated to Web dev.


  • Open-Source Specialists                     symfony framework
                                                     creator



  • Big corporate customers

www.sensiolabs.com
symfony
  • PHP Web framework
  • Based on
         – 10 years of Sensio experience
         – Existing Open-Source projects


  • Built for :
         – Professional websites
         – Complex needs
         – Demanding environments

www.sensiolabs.com
Framework




www.sensiolabs.com
Whatever the application, a
                 framework is build to ease
               development by providing tools
               for recurrent and boring tasks.


www.sensiolabs.com
Maintainability & Evolutivity




www.sensiolabs.com
Structure & Standardisation




www.sensiolabs.com
MVC




www.sensiolabs.com
Model




www.sensiolabs.com
View




www.sensiolabs.com
Controller




www.sensiolabs.com
1



                                      Internet

                                  2

                                Controleur             6

                           3                 5

                       Modèle                    Vue

                       4

                     BDD
www.sensiolabs.com
Develop Faster & Better




www.sensiolabs.com
Write less code


                             less code
                                 
                          less complexity
                                 
                             less bugs
                                 
                         more productivity
                                 
                             more time


   More time for edge cases, business rules, …

www.sensiolabs.com
Each line of code has an initial cost

                                      Costinitial = Costdeveloppement + Costtests


         … and there is a cost to maintain the line


                                            Costmaintenance >> Costinitial




                     Costmaintenance = Costunderstanding + Costchange + Costtests + Costdeployment




                                           Kent Beck (based on Yourdon and Constantine)
www.sensiolabs.com
symfony




www.sensiolabs.com
An Open-Source Framework




www.sensiolabs.com
MIT Licence


           « It is a permissive license, meaning that it permits
                reuse within proprietary software on the condition
                that the license is distributed with that software. »




www.sensiolabs.com
An Open-Source Documentation




www.sensiolabs.com
•  Open-Source documentation
         –  The book (450 pages - GFDL)
         –  Askeet Tutorial (250 pages)


  •  Translation in 12 langages
         –           (Chinese)      – Polski
         –  Deutsch                 – Português
         –  Español                 – Russian
         –  Français                – Ukrainian
         –  Italiano                –  Čeština
         –             (Japanese)
                                    – Nederlands


www.sensiolabs.com
www.sensiolabs.com
A great Community




www.sensiolabs.com
Mailing-list support / forums / IRC

   240 available plugins

   300k unique visitors per month on the official
     website www.symfony-project.org




www.sensiolabs.com
« Entreprise » Version




www.sensiolabs.com
Version 1.0 released early 2007

   Maintained for 3 ans (early 2010)

   ~1 release a month (1.0.16 now)

          Bugs and security fixes, compatibility with upcoming
           PHP versions

          No new features

          Upgrading is simple and safe

www.sensiolabs.com
Let’s start a Project




www.sensiolabs.com
The Project
  • A simple blog system
         – Posts
         – Categories
         – Authors
         – Comments
  • Requirements
         – Maintainable
         – Customizable
         – Secure
  • Use symfony 1.1
www.sensiolabs.com
List of recent posts


                                  Excerpt



                                                     Categories
                                  Post information




www.sensiolabs.com
Sidebar customization


                     List of comments




www.sensiolabs.com   Add a comment
YUI stylesheets

                                  homepage



   Famfamfam icons



                     post




          http://www.symfony-project.org/get/design.tgz
www.sensiolabs.com
Project Initialization




www.sensiolabs.com
Bootstrap a symfony Project

  1.  Install symfony

  2.  Initialize a new project

  3.  Configure the Web Server

  4.  Start coding

www.sensiolabs.com
Installing symfony

  Sandbox: Ready-to-run symfony application

  PEAR: Install symfony globally on your machine

  Subversion: Be free to have several versions around




www.sensiolabs.com
symfony CLI
                     $ symfony




www.sensiolabs.com
Create a new Project

                $ mkdir blog
                $ cd blog
                $ symfony generate:project blog




www.sensiolabs.com
Create a new Application
                     ./symfony help generate:app




www.sensiolabs.com
Create a new secure Application
                     ./symfony generate:app frontend 
                              --escaping-strategy=on 
                              --csrf-secret=A$ecret




www.sensiolabs.com
Project, Application, Module, Action




www.sensiolabs.com
Which symfony Version?

         ./symfony -V




         config/ProjectConfiguration.class.php




www.sensiolabs.com
Configure the Web Server
  <VirtualHost *:80>
    ServerName myapp.example.com
    DocumentRoot "/path/to/blog/web"
    DirectoryIndex index.php

      <Directory "/path/to/blog/web">
        AllowOverride All
        Allow from All                  Web root directory is web/
      </Directory>
  </VirtualHost>




www.sensiolabs.com
symfony Assets
  Used by the default pages and the Web Debug Toolbar

  Configure the Web Server to serve symfony assets
                        <VirtualHost *:80>
                          …
                          Alias /sf /$sf_symfony_data_dir/web/sf
                          <Directory "/$sf_symfony_data_dir/web/sf">
                            AllowOverride All
                            Allow from All
                          </Directory>
                        </VirtualHost>


  Or, create a symlink
                     $ cd web/
                     $ ln -sf ../lib/vendor/symfony/data/web/sf sf
www.sensiolabs.com
Environments




www.sensiolabs.com
developers   customers      end users




         development        staging      production
         environment      environment   environment

www.sensiolabs.com
cache     cache         cache

                     debug     debug         debug

                     logs       logs          logs

                     stats      stats         stats


         development           staging      production
         environment         environment   environment

www.sensiolabs.com
Try a 404
dev environment
                                 prod environment




www.sensiolabs.com
Front Controllers
dev environment




                                   environment


                                         prod environment




                                      environment
www.sensiolabs.com
Environment Configuration
                     apps/frontend/config/settings.yml

                           environment




                                Web debug toolbar




www.sensiolabs.com
Web Debug Toolbar

                           Web debug toolbar




www.sensiolabs.com
Create a Module for Posts
  Create a new ‘post’ module in the ‘frontend’
    application

                     $ php symfony generate:module frontend post




www.sensiolabs.com
Project, Application, Module, Action




www.sensiolabs.com
Action and Template Naming
  /frontend_dev.php/blog/index

                        module action

  // in apps/frontend/modules/blog/actions/actions.class.php
  <?php

  class blogActions extends sfActions
  {
    public function executeIndex()
    {
      // do things
    }
  }

  // in apps/frontend/modules/blog/templates/indexSuccess.php
  <!–- do things -->
www.sensiolabs.com
Browse
                     /frontend_dev.php/post/index




www.sensiolabs.com
Create the Blog Homepage
   apps/frontend/modules/post/templates/indexSuccess.php

  • Copy homepage.html into indexSuccess.php
  • Copy the images/ and css/ under web/
  • Add the base.css CSS in view.yml
  • Fix images and css paths
                                        /frontend_dev.php/post/index




www.sensiolabs.com
Create an Action to show a Post
    apps/frontend/modules/post/actions/actions.class.php

  • Create an empy executeShow() action
  • Copy post.html into showSuccess.php
  • Fix images and css paths
                                          /frontend_dev.php/post/show




www.sensiolabs.com
Project, Application, Module, Action




www.sensiolabs.com
Extract common Code

                                                 Post page specific content




                     Homepage specific content



www.sensiolabs.com
The Layout
                     A layout wraps the template content

                        header.php
                                                page content
                                      include

                                                   decoration

                       page content

             include


                        footer.php
                                                        layout.php
www.sensiolabs.com
The Layout
  Move the common code from homepage and post to
   the layout

                     apps/frontend/templates/layout.php




www.sensiolabs.com
Customize the Sidebar and the Title
                                        The title depends on the page




                     The sidebar depends on the page




www.sensiolabs.com
Layout with Several "holes"
          A slot content depends on the template context


                        Slot1
                                       Main
                                      content
              Slot 2




                        Main     +                =
                       content
                                       Slot 1
                                       Slot 2


                 Layout              Template         Rendered
                                     with slots         Page
www.sensiolabs.com
Create Slots for Title and Sidebar
      apps/frontend/templates/layout.php




www.sensiolabs.com
Fill the Slots
   apps/frontend/modules/blog/templates/showSuccess.php




www.sensiolabs.com
Passing Data from Action to Template
   apps/frontend/modules/blog/actions/actions.class.php




                     apps/frontend/modules/blog/templates/indexSuccess.php




www.sensiolabs.com
Make the Counter dynamic




www.sensiolabs.com
Database Schema


  A post has an author

  A post can be in a category

  A post can have comments




www.sensiolabs.com
Propel : The symfony ORM
  ORM = Object-Relational Mapping
  Mapping a relational database to an object-oriented
   model
  Database Abstraction

                       Relational    Object-Oriented
                     table           class
                     row, record     object
                     field, column   proterty
www.sensiolabs.com
Schema Conventions
  post:
    id:              #   primary key, autoincrement integer
    author_id:       #   foreign key to Author
    created_at:      #   timestamp, set to current time on creation
    updated_at:      #   timestamp, set to current time on update

      # column types
      published_at: timestamp
      title:         varchar(255)
      content:       longvarchar
      is_spam:       boolean

      # complex column definitions
      last_name:   { type: varchar(100), index: true, required: true }
      category_id:     { type: integer, foreignTable: category,
        foreignReference: id, required: false, onDelete: setnull }

www.sensiolabs.com
Database Schema
        config/schema.yml




www.sensiolabs.com
Build the Model Classes
        ./symfony propel:build-model




www.sensiolabs.com
From Schema to Object Model

                     $ ./symfony propel:build-model

   propel:                               lib/
     post:                                 model/
       id:   ~                                om/
       name: varchar(255)                       BasePost.php
                                                BasePostPeer.php
                                              Post.php
                                              PostPeer.php




                            1 table > 4 classes?

www.sensiolabs.com
Base and Custom Classes
  lib/                       Base classes
    model/
       om/                      Under model/om/, prefixed by Base
         BasePost.php
         BasePostPeer.php
                                Generated by Propel
       Post.php                 Overwritten each time the schema
       PostPeer.php
                                  changes and the model is generated
                                Never edit these files!
   lib/                       Custom classes
     model/
        om/                      Under model/, no prefix
          BasePost.php
          BasePostPeer.php
                                 Inherit from Base classes
        Post.php                 Never overwritten
        PostPeer.php
                                 Put custom methods here
www.sensiolabs.com
                                 Override base methods here
Peer and Object Classes
  lib/                       Peer classes
    model/
       om/                      Suffixed by Peer
         BasePost.php           Useful to retrieve a collection of objects
         BasePostPeer.php
      Post.php                  Methods return objects
       PostPeer.php
                                Only static methods (::, self)


   lib/                      Object classes
     model/
                                No suffix
        om/
          BasePost.php
                                Useful to create / inspect / update
          BasePostPeer.php      records
        Post.php                Methods return column values
       PostPeer.php             Only object methods (->, $this)

www.sensiolabs.com
Database Initialization


                     mysqladmin create phpday
                     ./symfony configure:database mysql://localhost/phpday




www.sensiolabs.com
Build the SQL queries
        ./symfony propel:build-sql




        ./symfony propel:insert-sql
www.sensiolabs.com
Shortcut for all the previous Tasks



                     ./symfony propel:build-all




www.sensiolabs.com
Initial Data
           data/fixtures/01-data.yml


                         Define PKs with names




                         Use names instead of Pks
                                        Dynamic values




www.sensiolabs.com
Load Data
        $ ./symfony propel:data-load frontend




www.sensiolabs.com
Summary of Code Generation

                           2                    Object model
                           propel:build-model   Base, Custom,
                                                Peer and object classes

   1
    schema.yml

                       3   propel:build-sql
                           propel:insert-sql
                                                Relational database
                                                Tables, columns, keys, indexes



www.sensiolabs.com
If the Database preexists the Project

                         3                     Object model
                          propel:build-model   Base, Custom,
                                               Peer and object classes

   2
    schema.yml

                     1
                         propel:build-schema
                                               Relational database
                                               Tables, columns, keys, indexes



www.sensiolabs.com
Generated Methods of Object Classes
  Getter for columns                                CamelCase version
         $title     = $post->getTitle();
         $content   = $post->getContent();          of the column name
         $createdAt = $post->getCreatedAt();


  Some getters have special options
         $date       = $post->getCreatedAt($dateFormat);


  Getter by name
         $title      = $post->getByName('title');




www.sensiolabs.com
Generated Methods of Object Classes
  Manipulate primary keys
         $commentId = $comment->getId();
         // for composite keys, prefer
         $commentId = $comment->getPrimaryKey();



  Manipulate foreign keys
         $postId = $comment->getPostId();
         // in practice, these methods are not used much
         // use getter for foreign objects instead
         $post    = $comment->getPost();     // Post object
         // as the result is an object, you can chain method calls
         $content = $comment->getPost()->getContent();



  One-to-Many smart getters
         $comments   = $post->getCommments();   // Array of Comments
         $nb         = $post->countCommments(); // Integer

www.sensiolabs.com
Get the Posts from the Database




www.sensiolabs.com
What the Model Layer does
         Action                    Model                     Database


                PostPeer::doSelect(new Criteria())

                                        Criteria to SQL translation
                                        SELECT * FROM post


                                                                      Query execution
                                                      resultset


                                        Object hydrating
                Array of Post objects




www.sensiolabs.com
What the Model Layer does
         Template                   Model                   Database


                $post->getTitle()

                                        Looking up internal attribute
                       String




www.sensiolabs.com
Make the Post show Page dynamic

     /frontend_dev.php/post/show?id=1




www.sensiolabs.com
Make the Post show Page dynamic




                     Display a 404 error if the post does not exist




www.sensiolabs.com
Change the Date Format
  getPublishedAt() first argument accepts the date()
    format or the strftime() format

  symfony format_date() helper is i18n aware




www.sensiolabs.com
Helper Groups
  •  Tag
  •  URLs
  •  Assets (images, JavaScript, CSS, …)
  •  Subtemplate inclusion (slot, partial, component)
  •  Links
  •  Form
  •  Javascript and Ajax
  •  Text, number, date manipulation
  •  I18N
  •  …

www.sensiolabs.com
Permalinks
  • Many applications provide an alternative to
    functional URLs
  • Permalinks look like links to permanent content
    while the resource they reference is dynamically
    generated
  • Primarily focused at search engines, permalink
    often carry more readable data for end users

     http://www.symfony-project.org/blog/2008/05/21/new-symfony-security-policy




www.sensiolabs.com
Links to the Post Page
 apps/frontend/config/routing.yml




                                         lib/model/Post.php




www.sensiolabs.com
Links to the Post Page

apps/frontend/modules/post/templates/indexSuccess.php




                     apps/frontend/modules/post/actions/actions.class.php




www.sensiolabs.com
Link to the Homepage




www.sensiolabs.com
Add the Comments
             apps/frontend/modules/post/templates/showSuccess.php




www.sensiolabs.com
What the Model Layer does
         Template                  Model                   Database


                $post->getComments()


                                         SELECT * FROM comment
                                         WHERE comment.post_id= ?


                                                                    Query execution
                                                    resultset


              Array of Comment objects
                                         Object hydrating




www.sensiolabs.com
Comment Form
        $ ./symfony propel:build-forms




www.sensiolabs.com
Base and Custom Classes
  lib/                              Base classes
    form/
                                       Under form/base/, prefixed by Base
       base/
         BasePostForm.class.php        Generated by symfony
       PostForm.class.php
                                       Overwritten when the schema
                                         changes and the forms are
                                         generated
                                       Never edit these files!
    lib/                             Custom classes
      form/
        base/                           Under form/, no prefix
          BasePost.Form.class.php       Inherit from Base classes
        PostForm.class.php
                                        Never overwritten
                                        Put custom methods here
www.sensiolabs.com
                                        Override base methods here
Create a Comment Form
         apps/frontend/modules/post/actions/actions.class.php




         apps/frontend/modules/post/templates/showSuccess.php




www.sensiolabs.com
Create a Comment Form




www.sensiolabs.com
Propel Forms
  • Generated by propel:build-forms
  • 1 table = 1 form
  • Model introspection to determine
         – The widget
         – The validation rules
  • Automatically converts a form to a Propel object
    and save it to the database
  • Extensible

www.sensiolabs.com
Bind The Form to the Post




www.sensiolabs.com
Customize the Form
     lib/form/CommentForm.class.php




www.sensiolabs.com
Form Life Cycle




www.sensiolabs.com
Comments




www.sensiolabs.com
Security: XSS




www.sensiolabs.com
Security: CSRF




www.sensiolabs.com
Create the Category Page
    lib/model/PostPeer.class.php




                       apps/frontend/modules/blog/actions/actions.class.php




www.sensiolabs.com
Create the Category Page
     apps/frontend/config/routing.yml




                                        apps/frontend/templates/layout.php




www.sensiolabs.com
Create a Partial for the List
 apps/frontend/modules/blog/templates/_list.php




          apps/frontend/modules/blog/templates/listByCategorySuccess.php




www.sensiolabs.com
Create a Component
apps/frontend/modules/post/actions/components.class.php




apps/frontend/modules/post/templates/_categories.php




                                    apps/frontend/templates/layout.php




www.sensiolabs.com
Create a Web Service for Posts
    apps/frontend/config/routing.yml




                     apps/frontend/modules/post/templates/indexSuccess.xml.php




www.sensiolabs.com
If we have time…
  • Functional Tests

  • Cache

  • CRUD to manage posts




www.sensiolabs.com
Sensio S.A.
                             26, rue Salomon de Rothschild
                                 92 286 Suresnes Cedex
                                        FRANCE
                                 Tél. : +33 1 40 99 80 80
                                 Fax : +33 1 40 99 83 34

                                         Contact
                                    Fabien Potencier
                              fabien.potencier@sensio.com




        http://www.sensiolabs.com/                http://www.symfony-project.com/
www.sensiolabs.com

Más contenido relacionado

Destacado

Transforming IT with an Open Source Strategy
Transforming IT with an Open Source StrategyTransforming IT with an Open Source Strategy
Transforming IT with an Open Source StrategyInnoTech
 
Open Source as IT and Business Strategy
Open Source as IT and Business StrategyOpen Source as IT and Business Strategy
Open Source as IT and Business StrategyKarim Baïna
 
112 - The Role of Mentoring and Project Characteristics for Onboarding in Ope...
112 - The Role of Mentoring and Project Characteristics for Onboarding in Ope...112 - The Role of Mentoring and Project Characteristics for Onboarding in Ope...
112 - The Role of Mentoring and Project Characteristics for Onboarding in Ope...ESEM 2014
 
The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...
The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...
The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...Elena Williams
 
Defining an Open Source Software Trustworthiness Model
Defining an Open Source Software Trustworthiness Model Defining an Open Source Software Trustworthiness Model
Defining an Open Source Software Trustworthiness Model Davide Taibi
 
Open source software development
Open source software developmentOpen source software development
Open source software developmentSagar Raravi
 
Open Source as an Element of Corporate Strategy
Open Source as an Element of Corporate StrategyOpen Source as an Element of Corporate Strategy
Open Source as an Element of Corporate StrategySamsung Open Source Group
 
An Open Source Workshop
An Open Source WorkshopAn Open Source Workshop
An Open Source Workshophalehmahbod
 
Open Source Software Needs You!
Open Source Software Needs You!Open Source Software Needs You!
Open Source Software Needs You!Charles Nutter
 
Free and Open Source Software
Free and Open Source SoftwareFree and Open Source Software
Free and Open Source SoftwareMoinuddin Ahmed
 
"IBMs Open Source Strategy" by Adam Jollans @ eLiberatica 2009
"IBMs Open Source Strategy" by Adam Jollans @ eLiberatica 2009"IBMs Open Source Strategy" by Adam Jollans @ eLiberatica 2009
"IBMs Open Source Strategy" by Adam Jollans @ eLiberatica 2009eLiberatica
 
Open Source as an Element of Corporate Strategy
Open Source as an Element of Corporate StrategyOpen Source as an Element of Corporate Strategy
Open Source as an Element of Corporate StrategyBlack Duck by Synopsys
 
Open Source Software - A Guide to Innovation
Open Source Software - A Guide to InnovationOpen Source Software - A Guide to Innovation
Open Source Software - A Guide to InnovationKonstantyn Spasokukotskiy
 
10 Reasons To Use Open Source Software-Defined Networking
10 Reasons To Use Open Source Software-Defined Networking10 Reasons To Use Open Source Software-Defined Networking
10 Reasons To Use Open Source Software-Defined NetworkingVala Afshar
 
Open Source Software Presentation
Open Source Software PresentationOpen Source Software Presentation
Open Source Software PresentationHenry Briggs
 
Open Source Software - Avoiding Common Pitfalls
Open Source Software - Avoiding Common PitfallsOpen Source Software - Avoiding Common Pitfalls
Open Source Software - Avoiding Common PitfallsAnsel Halliburton
 
Opensource Powerpoint Review.Ppt
Opensource Powerpoint Review.PptOpensource Powerpoint Review.Ppt
Opensource Powerpoint Review.PptViet NguyenHoang
 
An Open Source Strategy for NASA
An Open Source Strategy for NASAAn Open Source Strategy for NASA
An Open Source Strategy for NASAChris Mattmann
 
OPEN SOURCE SEMINAR PRESENTATION
OPEN SOURCE SEMINAR PRESENTATIONOPEN SOURCE SEMINAR PRESENTATION
OPEN SOURCE SEMINAR PRESENTATIONRitwick Halder
 
Big Data Analytics 2014
Big Data Analytics 2014Big Data Analytics 2014
Big Data Analytics 2014Stratebi
 

Destacado (20)

Transforming IT with an Open Source Strategy
Transforming IT with an Open Source StrategyTransforming IT with an Open Source Strategy
Transforming IT with an Open Source Strategy
 
Open Source as IT and Business Strategy
Open Source as IT and Business StrategyOpen Source as IT and Business Strategy
Open Source as IT and Business Strategy
 
112 - The Role of Mentoring and Project Characteristics for Onboarding in Ope...
112 - The Role of Mentoring and Project Characteristics for Onboarding in Ope...112 - The Role of Mentoring and Project Characteristics for Onboarding in Ope...
112 - The Role of Mentoring and Project Characteristics for Onboarding in Ope...
 
The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...
The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...
The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...
 
Defining an Open Source Software Trustworthiness Model
Defining an Open Source Software Trustworthiness Model Defining an Open Source Software Trustworthiness Model
Defining an Open Source Software Trustworthiness Model
 
Open source software development
Open source software developmentOpen source software development
Open source software development
 
Open Source as an Element of Corporate Strategy
Open Source as an Element of Corporate StrategyOpen Source as an Element of Corporate Strategy
Open Source as an Element of Corporate Strategy
 
An Open Source Workshop
An Open Source WorkshopAn Open Source Workshop
An Open Source Workshop
 
Open Source Software Needs You!
Open Source Software Needs You!Open Source Software Needs You!
Open Source Software Needs You!
 
Free and Open Source Software
Free and Open Source SoftwareFree and Open Source Software
Free and Open Source Software
 
"IBMs Open Source Strategy" by Adam Jollans @ eLiberatica 2009
"IBMs Open Source Strategy" by Adam Jollans @ eLiberatica 2009"IBMs Open Source Strategy" by Adam Jollans @ eLiberatica 2009
"IBMs Open Source Strategy" by Adam Jollans @ eLiberatica 2009
 
Open Source as an Element of Corporate Strategy
Open Source as an Element of Corporate StrategyOpen Source as an Element of Corporate Strategy
Open Source as an Element of Corporate Strategy
 
Open Source Software - A Guide to Innovation
Open Source Software - A Guide to InnovationOpen Source Software - A Guide to Innovation
Open Source Software - A Guide to Innovation
 
10 Reasons To Use Open Source Software-Defined Networking
10 Reasons To Use Open Source Software-Defined Networking10 Reasons To Use Open Source Software-Defined Networking
10 Reasons To Use Open Source Software-Defined Networking
 
Open Source Software Presentation
Open Source Software PresentationOpen Source Software Presentation
Open Source Software Presentation
 
Open Source Software - Avoiding Common Pitfalls
Open Source Software - Avoiding Common PitfallsOpen Source Software - Avoiding Common Pitfalls
Open Source Software - Avoiding Common Pitfalls
 
Opensource Powerpoint Review.Ppt
Opensource Powerpoint Review.PptOpensource Powerpoint Review.Ppt
Opensource Powerpoint Review.Ppt
 
An Open Source Strategy for NASA
An Open Source Strategy for NASAAn Open Source Strategy for NASA
An Open Source Strategy for NASA
 
OPEN SOURCE SEMINAR PRESENTATION
OPEN SOURCE SEMINAR PRESENTATIONOPEN SOURCE SEMINAR PRESENTATION
OPEN SOURCE SEMINAR PRESENTATION
 
Big Data Analytics 2014
Big Data Analytics 2014Big Data Analytics 2014
Big Data Analytics 2014
 

Similar a symfony: An Open-Source Framework for Professionals (PHP Day 2008)

symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...Fabien Potencier
 
Continuous Integration Step-by-step
Continuous Integration Step-by-stepContinuous Integration Step-by-step
Continuous Integration Step-by-stepMichelangelo van Dam
 
Write Plugins for symfony (Symfony Camp 2007)
Write Plugins for symfony (Symfony Camp 2007)Write Plugins for symfony (Symfony Camp 2007)
Write Plugins for symfony (Symfony Camp 2007)Fabien Potencier
 
Virtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitVirtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitAndreas Heim
 
Phonegap Development & Debugging
Phonegap Development & DebuggingPhonegap Development & Debugging
Phonegap Development & DebuggingIvano Malavolta
 
Django simplified : by weever mbakaya
Django simplified : by weever mbakayaDjango simplified : by weever mbakaya
Django simplified : by weever mbakayaMbakaya Kwatukha
 
Movendo aplicações .NET para plataformas abertas
Movendo aplicações .NET para plataformas abertasMovendo aplicações .NET para plataformas abertas
Movendo aplicações .NET para plataformas abertasPedro Alves Jr.
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?AFUP_Limoges
 
Minko - Scripting 3D apps with Lua and C++
Minko - Scripting 3D apps with Lua and C++Minko - Scripting 3D apps with Lua and C++
Minko - Scripting 3D apps with Lua and C++Minko3D
 
WebAssembly with Rust
WebAssembly with RustWebAssembly with Rust
WebAssembly with RustKnoldus Inc.
 
Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014André Rømcke
 
Getting started with PhoneGap
Getting started with PhoneGapGetting started with PhoneGap
Getting started with PhoneGapMihai Corlan
 
Symfony 1.1 - Fabien Potencier
Symfony 1.1 - Fabien PotencierSymfony 1.1 - Fabien Potencier
Symfony 1.1 - Fabien Potencierdpc
 
OpenStack Murano introduction
OpenStack Murano introductionOpenStack Murano introduction
OpenStack Murano introductionVictor Zhang
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo Godel
 
Devoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesDevoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesEric Bottard
 
Samuel Asher Rivello - PureMVC Hands On Part 2
Samuel Asher Rivello - PureMVC Hands On Part 2Samuel Asher Rivello - PureMVC Hands On Part 2
Samuel Asher Rivello - PureMVC Hands On Part 2360|Conferences
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaAmazon Web Services
 
MEIC - Fennec presentation 2008-03-06
MEIC - Fennec presentation 2008-03-06MEIC - Fennec presentation 2008-03-06
MEIC - Fennec presentation 2008-03-06Madhava Enros
 

Similar a symfony: An Open-Source Framework for Professionals (PHP Day 2008) (20)

symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
symfony: Simplify your professional web development with PHP (IPC Frankfurt 2...
 
Continuous Integration Step-by-step
Continuous Integration Step-by-stepContinuous Integration Step-by-step
Continuous Integration Step-by-step
 
Write Plugins for symfony (Symfony Camp 2007)
Write Plugins for symfony (Symfony Camp 2007)Write Plugins for symfony (Symfony Camp 2007)
Write Plugins for symfony (Symfony Camp 2007)
 
Virtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitVirtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profit
 
Symfony for non-techies
Symfony for non-techiesSymfony for non-techies
Symfony for non-techies
 
Phonegap Development & Debugging
Phonegap Development & DebuggingPhonegap Development & Debugging
Phonegap Development & Debugging
 
Django simplified : by weever mbakaya
Django simplified : by weever mbakayaDjango simplified : by weever mbakaya
Django simplified : by weever mbakaya
 
Movendo aplicações .NET para plataformas abertas
Movendo aplicações .NET para plataformas abertasMovendo aplicações .NET para plataformas abertas
Movendo aplicações .NET para plataformas abertas
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
 
Minko - Scripting 3D apps with Lua and C++
Minko - Scripting 3D apps with Lua and C++Minko - Scripting 3D apps with Lua and C++
Minko - Scripting 3D apps with Lua and C++
 
WebAssembly with Rust
WebAssembly with RustWebAssembly with Rust
WebAssembly with Rust
 
Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014
 
Getting started with PhoneGap
Getting started with PhoneGapGetting started with PhoneGap
Getting started with PhoneGap
 
Symfony 1.1 - Fabien Potencier
Symfony 1.1 - Fabien PotencierSymfony 1.1 - Fabien Potencier
Symfony 1.1 - Fabien Potencier
 
OpenStack Murano introduction
OpenStack Murano introductionOpenStack Murano introduction
OpenStack Murano introduction
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Devoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesDevoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best Practices
 
Samuel Asher Rivello - PureMVC Hands On Part 2
Samuel Asher Rivello - PureMVC Hands On Part 2Samuel Asher Rivello - PureMVC Hands On Part 2
Samuel Asher Rivello - PureMVC Hands On Part 2
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
MEIC - Fennec presentation 2008-03-06
MEIC - Fennec presentation 2008-03-06MEIC - Fennec presentation 2008-03-06
MEIC - Fennec presentation 2008-03-06
 

Más de Fabien Potencier

Dependency injection in PHP 5.3/5.4
Dependency injection in PHP 5.3/5.4Dependency injection in PHP 5.3/5.4
Dependency injection in PHP 5.3/5.4Fabien Potencier
 
Dependency injection-zendcon-2010
Dependency injection-zendcon-2010Dependency injection-zendcon-2010
Dependency injection-zendcon-2010Fabien Potencier
 
Design patterns revisited with PHP 5.3
Design patterns revisited with PHP 5.3Design patterns revisited with PHP 5.3
Design patterns revisited with PHP 5.3Fabien Potencier
 
The state of Symfony2 - SymfonyDay 2010
The state of Symfony2 - SymfonyDay 2010The state of Symfony2 - SymfonyDay 2010
The state of Symfony2 - SymfonyDay 2010Fabien Potencier
 
Dependency injection - phpday 2010
Dependency injection - phpday 2010Dependency injection - phpday 2010
Dependency injection - phpday 2010Fabien Potencier
 
Dependency Injection IPC 201
Dependency Injection IPC 201Dependency Injection IPC 201
Dependency Injection IPC 201Fabien Potencier
 
Caching on the Edge with Symfony2
Caching on the Edge with Symfony2Caching on the Edge with Symfony2
Caching on the Edge with Symfony2Fabien Potencier
 
Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2Fabien Potencier
 
News of the Symfony2 World
News of the Symfony2 WorldNews of the Symfony2 World
News of the Symfony2 WorldFabien Potencier
 
Dependency Injection - ConFoo 2010
Dependency Injection - ConFoo 2010Dependency Injection - ConFoo 2010
Dependency Injection - ConFoo 2010Fabien Potencier
 

Más de Fabien Potencier (20)

Varnish
VarnishVarnish
Varnish
 
Look beyond PHP
Look beyond PHPLook beyond PHP
Look beyond PHP
 
Dependency injection in PHP 5.3/5.4
Dependency injection in PHP 5.3/5.4Dependency injection in PHP 5.3/5.4
Dependency injection in PHP 5.3/5.4
 
Dependency injection-zendcon-2010
Dependency injection-zendcon-2010Dependency injection-zendcon-2010
Dependency injection-zendcon-2010
 
Caching on the Edge
Caching on the EdgeCaching on the Edge
Caching on the Edge
 
Design patterns revisited with PHP 5.3
Design patterns revisited with PHP 5.3Design patterns revisited with PHP 5.3
Design patterns revisited with PHP 5.3
 
The state of Symfony2 - SymfonyDay 2010
The state of Symfony2 - SymfonyDay 2010The state of Symfony2 - SymfonyDay 2010
The state of Symfony2 - SymfonyDay 2010
 
PhpBB meets Symfony2
PhpBB meets Symfony2PhpBB meets Symfony2
PhpBB meets Symfony2
 
Dependency injection - phpday 2010
Dependency injection - phpday 2010Dependency injection - phpday 2010
Dependency injection - phpday 2010
 
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
 
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
 
Symfony2 - OSIDays 2010
Symfony2 - OSIDays 2010Symfony2 - OSIDays 2010
Symfony2 - OSIDays 2010
 
Dependency Injection IPC 201
Dependency Injection IPC 201Dependency Injection IPC 201
Dependency Injection IPC 201
 
Caching on the Edge with Symfony2
Caching on the Edge with Symfony2Caching on the Edge with Symfony2
Caching on the Edge with Symfony2
 
Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2
 
News of the Symfony2 World
News of the Symfony2 WorldNews of the Symfony2 World
News of the Symfony2 World
 
Dependency Injection - ConFoo 2010
Dependency Injection - ConFoo 2010Dependency Injection - ConFoo 2010
Dependency Injection - ConFoo 2010
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
Symfony Components
Symfony ComponentsSymfony Components
Symfony Components
 
PHP 5.3 in practice
PHP 5.3 in practicePHP 5.3 in practice
PHP 5.3 in practice
 

Último

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Último (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

symfony: An Open-Source Framework for Professionals (PHP Day 2008)

  • 1. symfony An Open-Source Framework for Professionals Fabien Potencier www.sensiolabs.com
  • 2. Before we begin How many have already used symfony for a project, even a very small personal project? www.sensiolabs.com
  • 3. Before we begin Do you want to do the exercices on your laptop? www.sensiolabs.com
  • 4. Sensio • Sensio Sensio Web Agency – Web Agency Internet Webmarketing – Founded in 1998 Technologies – 45 people dedicated to Web dev. • Open-Source Specialists symfony framework creator • Big corporate customers www.sensiolabs.com
  • 5. symfony • PHP Web framework • Based on – 10 years of Sensio experience – Existing Open-Source projects • Built for : – Professional websites – Complex needs – Demanding environments www.sensiolabs.com
  • 7. Whatever the application, a framework is build to ease development by providing tools for recurrent and boring tasks. www.sensiolabs.com
  • 14. 1 Internet 2 Controleur 6 3 5 Modèle Vue 4 BDD www.sensiolabs.com
  • 15. Develop Faster & Better www.sensiolabs.com
  • 16. Write less code less code  less complexity  less bugs  more productivity  more time More time for edge cases, business rules, … www.sensiolabs.com
  • 17. Each line of code has an initial cost Costinitial = Costdeveloppement + Costtests … and there is a cost to maintain the line Costmaintenance >> Costinitial Costmaintenance = Costunderstanding + Costchange + Costtests + Costdeployment Kent Beck (based on Yourdon and Constantine) www.sensiolabs.com
  • 20. MIT Licence « It is a permissive license, meaning that it permits reuse within proprietary software on the condition that the license is distributed with that software. » www.sensiolabs.com
  • 22. •  Open-Source documentation –  The book (450 pages - GFDL) –  Askeet Tutorial (250 pages) •  Translation in 12 langages –  (Chinese) – Polski –  Deutsch – Português –  Español – Russian –  Français – Ukrainian –  Italiano –  Čeština –  (Japanese) – Nederlands www.sensiolabs.com
  • 25. Mailing-list support / forums / IRC 240 available plugins 300k unique visitors per month on the official website www.symfony-project.org www.sensiolabs.com
  • 27. Version 1.0 released early 2007 Maintained for 3 ans (early 2010) ~1 release a month (1.0.16 now) Bugs and security fixes, compatibility with upcoming PHP versions No new features Upgrading is simple and safe www.sensiolabs.com
  • 28. Let’s start a Project www.sensiolabs.com
  • 29. The Project • A simple blog system – Posts – Categories – Authors – Comments • Requirements – Maintainable – Customizable – Secure • Use symfony 1.1 www.sensiolabs.com
  • 30. List of recent posts Excerpt Categories Post information www.sensiolabs.com
  • 31. Sidebar customization List of comments www.sensiolabs.com Add a comment
  • 32. YUI stylesheets homepage Famfamfam icons post http://www.symfony-project.org/get/design.tgz www.sensiolabs.com
  • 34. Bootstrap a symfony Project 1.  Install symfony 2.  Initialize a new project 3.  Configure the Web Server 4.  Start coding www.sensiolabs.com
  • 35. Installing symfony Sandbox: Ready-to-run symfony application PEAR: Install symfony globally on your machine Subversion: Be free to have several versions around www.sensiolabs.com
  • 36. symfony CLI $ symfony www.sensiolabs.com
  • 37. Create a new Project $ mkdir blog $ cd blog $ symfony generate:project blog www.sensiolabs.com
  • 38. Create a new Application ./symfony help generate:app www.sensiolabs.com
  • 39. Create a new secure Application ./symfony generate:app frontend --escaping-strategy=on --csrf-secret=A$ecret www.sensiolabs.com
  • 40. Project, Application, Module, Action www.sensiolabs.com
  • 41. Which symfony Version? ./symfony -V config/ProjectConfiguration.class.php www.sensiolabs.com
  • 42. Configure the Web Server <VirtualHost *:80> ServerName myapp.example.com DocumentRoot "/path/to/blog/web" DirectoryIndex index.php <Directory "/path/to/blog/web"> AllowOverride All Allow from All Web root directory is web/ </Directory> </VirtualHost> www.sensiolabs.com
  • 43. symfony Assets Used by the default pages and the Web Debug Toolbar Configure the Web Server to serve symfony assets <VirtualHost *:80> … Alias /sf /$sf_symfony_data_dir/web/sf <Directory "/$sf_symfony_data_dir/web/sf"> AllowOverride All Allow from All </Directory> </VirtualHost> Or, create a symlink $ cd web/ $ ln -sf ../lib/vendor/symfony/data/web/sf sf www.sensiolabs.com
  • 45. developers customers end users development staging production environment environment environment www.sensiolabs.com
  • 46. cache cache cache debug debug debug logs logs logs stats stats stats development staging production environment environment environment www.sensiolabs.com
  • 47. Try a 404 dev environment prod environment www.sensiolabs.com
  • 48. Front Controllers dev environment environment prod environment environment www.sensiolabs.com
  • 49. Environment Configuration apps/frontend/config/settings.yml environment Web debug toolbar www.sensiolabs.com
  • 50. Web Debug Toolbar Web debug toolbar www.sensiolabs.com
  • 51. Create a Module for Posts Create a new ‘post’ module in the ‘frontend’ application $ php symfony generate:module frontend post www.sensiolabs.com
  • 52. Project, Application, Module, Action www.sensiolabs.com
  • 53. Action and Template Naming /frontend_dev.php/blog/index module action // in apps/frontend/modules/blog/actions/actions.class.php <?php class blogActions extends sfActions { public function executeIndex() { // do things } } // in apps/frontend/modules/blog/templates/indexSuccess.php <!–- do things --> www.sensiolabs.com
  • 54. Browse /frontend_dev.php/post/index www.sensiolabs.com
  • 55. Create the Blog Homepage apps/frontend/modules/post/templates/indexSuccess.php • Copy homepage.html into indexSuccess.php • Copy the images/ and css/ under web/ • Add the base.css CSS in view.yml • Fix images and css paths /frontend_dev.php/post/index www.sensiolabs.com
  • 56. Create an Action to show a Post apps/frontend/modules/post/actions/actions.class.php • Create an empy executeShow() action • Copy post.html into showSuccess.php • Fix images and css paths /frontend_dev.php/post/show www.sensiolabs.com
  • 57. Project, Application, Module, Action www.sensiolabs.com
  • 58. Extract common Code Post page specific content Homepage specific content www.sensiolabs.com
  • 59. The Layout A layout wraps the template content header.php page content include decoration page content include footer.php layout.php www.sensiolabs.com
  • 60. The Layout Move the common code from homepage and post to the layout apps/frontend/templates/layout.php www.sensiolabs.com
  • 61. Customize the Sidebar and the Title The title depends on the page The sidebar depends on the page www.sensiolabs.com
  • 62. Layout with Several "holes" A slot content depends on the template context Slot1 Main content Slot 2 Main + = content Slot 1 Slot 2 Layout Template Rendered with slots Page www.sensiolabs.com
  • 63. Create Slots for Title and Sidebar apps/frontend/templates/layout.php www.sensiolabs.com
  • 64. Fill the Slots apps/frontend/modules/blog/templates/showSuccess.php www.sensiolabs.com
  • 65. Passing Data from Action to Template apps/frontend/modules/blog/actions/actions.class.php apps/frontend/modules/blog/templates/indexSuccess.php www.sensiolabs.com
  • 66. Make the Counter dynamic www.sensiolabs.com
  • 67. Database Schema A post has an author A post can be in a category A post can have comments www.sensiolabs.com
  • 68. Propel : The symfony ORM ORM = Object-Relational Mapping Mapping a relational database to an object-oriented model Database Abstraction Relational Object-Oriented table class row, record object field, column proterty www.sensiolabs.com
  • 69. Schema Conventions post: id: # primary key, autoincrement integer author_id: # foreign key to Author created_at: # timestamp, set to current time on creation updated_at: # timestamp, set to current time on update # column types published_at: timestamp title: varchar(255) content: longvarchar is_spam: boolean # complex column definitions last_name: { type: varchar(100), index: true, required: true } category_id: { type: integer, foreignTable: category, foreignReference: id, required: false, onDelete: setnull } www.sensiolabs.com
  • 70. Database Schema config/schema.yml www.sensiolabs.com
  • 71. Build the Model Classes ./symfony propel:build-model www.sensiolabs.com
  • 72. From Schema to Object Model $ ./symfony propel:build-model propel: lib/ post: model/ id: ~ om/ name: varchar(255) BasePost.php BasePostPeer.php Post.php PostPeer.php 1 table > 4 classes? www.sensiolabs.com
  • 73. Base and Custom Classes lib/ Base classes model/ om/ Under model/om/, prefixed by Base BasePost.php BasePostPeer.php Generated by Propel Post.php Overwritten each time the schema PostPeer.php changes and the model is generated Never edit these files! lib/ Custom classes model/ om/ Under model/, no prefix BasePost.php BasePostPeer.php Inherit from Base classes Post.php Never overwritten PostPeer.php Put custom methods here www.sensiolabs.com Override base methods here
  • 74. Peer and Object Classes lib/ Peer classes model/ om/ Suffixed by Peer BasePost.php Useful to retrieve a collection of objects BasePostPeer.php Post.php Methods return objects PostPeer.php Only static methods (::, self) lib/ Object classes model/ No suffix om/ BasePost.php Useful to create / inspect / update BasePostPeer.php records Post.php Methods return column values PostPeer.php Only object methods (->, $this) www.sensiolabs.com
  • 75. Database Initialization mysqladmin create phpday ./symfony configure:database mysql://localhost/phpday www.sensiolabs.com
  • 76. Build the SQL queries ./symfony propel:build-sql ./symfony propel:insert-sql www.sensiolabs.com
  • 77. Shortcut for all the previous Tasks ./symfony propel:build-all www.sensiolabs.com
  • 78. Initial Data data/fixtures/01-data.yml Define PKs with names Use names instead of Pks Dynamic values www.sensiolabs.com
  • 79. Load Data $ ./symfony propel:data-load frontend www.sensiolabs.com
  • 80. Summary of Code Generation 2 Object model propel:build-model Base, Custom, Peer and object classes 1 schema.yml 3 propel:build-sql propel:insert-sql Relational database Tables, columns, keys, indexes www.sensiolabs.com
  • 81. If the Database preexists the Project 3 Object model propel:build-model Base, Custom, Peer and object classes 2 schema.yml 1 propel:build-schema Relational database Tables, columns, keys, indexes www.sensiolabs.com
  • 82. Generated Methods of Object Classes Getter for columns CamelCase version $title = $post->getTitle(); $content = $post->getContent(); of the column name $createdAt = $post->getCreatedAt(); Some getters have special options $date = $post->getCreatedAt($dateFormat); Getter by name $title = $post->getByName('title'); www.sensiolabs.com
  • 83. Generated Methods of Object Classes Manipulate primary keys $commentId = $comment->getId(); // for composite keys, prefer $commentId = $comment->getPrimaryKey(); Manipulate foreign keys $postId = $comment->getPostId(); // in practice, these methods are not used much // use getter for foreign objects instead $post = $comment->getPost(); // Post object // as the result is an object, you can chain method calls $content = $comment->getPost()->getContent(); One-to-Many smart getters $comments = $post->getCommments(); // Array of Comments $nb = $post->countCommments(); // Integer www.sensiolabs.com
  • 84. Get the Posts from the Database www.sensiolabs.com
  • 85. What the Model Layer does Action Model Database PostPeer::doSelect(new Criteria()) Criteria to SQL translation SELECT * FROM post Query execution resultset Object hydrating Array of Post objects www.sensiolabs.com
  • 86. What the Model Layer does Template Model Database $post->getTitle() Looking up internal attribute String www.sensiolabs.com
  • 87. Make the Post show Page dynamic /frontend_dev.php/post/show?id=1 www.sensiolabs.com
  • 88. Make the Post show Page dynamic Display a 404 error if the post does not exist www.sensiolabs.com
  • 89. Change the Date Format getPublishedAt() first argument accepts the date() format or the strftime() format symfony format_date() helper is i18n aware www.sensiolabs.com
  • 90. Helper Groups •  Tag •  URLs •  Assets (images, JavaScript, CSS, …) •  Subtemplate inclusion (slot, partial, component) •  Links •  Form •  Javascript and Ajax •  Text, number, date manipulation •  I18N •  … www.sensiolabs.com
  • 91. Permalinks • Many applications provide an alternative to functional URLs • Permalinks look like links to permanent content while the resource they reference is dynamically generated • Primarily focused at search engines, permalink often carry more readable data for end users http://www.symfony-project.org/blog/2008/05/21/new-symfony-security-policy www.sensiolabs.com
  • 92. Links to the Post Page apps/frontend/config/routing.yml lib/model/Post.php www.sensiolabs.com
  • 93. Links to the Post Page apps/frontend/modules/post/templates/indexSuccess.php apps/frontend/modules/post/actions/actions.class.php www.sensiolabs.com
  • 94. Link to the Homepage www.sensiolabs.com
  • 95. Add the Comments apps/frontend/modules/post/templates/showSuccess.php www.sensiolabs.com
  • 96. What the Model Layer does Template Model Database $post->getComments() SELECT * FROM comment WHERE comment.post_id= ? Query execution resultset Array of Comment objects Object hydrating www.sensiolabs.com
  • 97. Comment Form $ ./symfony propel:build-forms www.sensiolabs.com
  • 98. Base and Custom Classes lib/ Base classes form/ Under form/base/, prefixed by Base base/ BasePostForm.class.php Generated by symfony PostForm.class.php Overwritten when the schema changes and the forms are generated Never edit these files! lib/ Custom classes form/ base/ Under form/, no prefix BasePost.Form.class.php Inherit from Base classes PostForm.class.php Never overwritten Put custom methods here www.sensiolabs.com Override base methods here
  • 99. Create a Comment Form apps/frontend/modules/post/actions/actions.class.php apps/frontend/modules/post/templates/showSuccess.php www.sensiolabs.com
  • 100. Create a Comment Form www.sensiolabs.com
  • 101. Propel Forms • Generated by propel:build-forms • 1 table = 1 form • Model introspection to determine – The widget – The validation rules • Automatically converts a form to a Propel object and save it to the database • Extensible www.sensiolabs.com
  • 102. Bind The Form to the Post www.sensiolabs.com
  • 103. Customize the Form lib/form/CommentForm.class.php www.sensiolabs.com
  • 108. Create the Category Page lib/model/PostPeer.class.php apps/frontend/modules/blog/actions/actions.class.php www.sensiolabs.com
  • 109. Create the Category Page apps/frontend/config/routing.yml apps/frontend/templates/layout.php www.sensiolabs.com
  • 110. Create a Partial for the List apps/frontend/modules/blog/templates/_list.php apps/frontend/modules/blog/templates/listByCategorySuccess.php www.sensiolabs.com
  • 112. Create a Web Service for Posts apps/frontend/config/routing.yml apps/frontend/modules/post/templates/indexSuccess.xml.php www.sensiolabs.com
  • 113. If we have time… • Functional Tests • Cache • CRUD to manage posts www.sensiolabs.com
  • 114. Sensio S.A. 26, rue Salomon de Rothschild 92 286 Suresnes Cedex FRANCE Tél. : +33 1 40 99 80 80 Fax : +33 1 40 99 83 34 Contact Fabien Potencier fabien.potencier@sensio.com http://www.sensiolabs.com/ http://www.symfony-project.com/ www.sensiolabs.com