SlideShare a Scribd company logo
1 of 23
Download to read offline
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
symfony
Write Plugins
Fabien Potencier
http://www.symfony-project.com/
http://www.sensiolabs.com/
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
What is a Plugin?
• Directory structure convention
•Classes
•Filters
•Mixins
•Helpers
•Configuration
•Tasks
•Modules
•Schemas
•Model Extensions
•Fixtures
•Web Assets
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
What for?
•To contribute back a symfony extension
•Another way to package your code
•To share code between projects
Portability
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Let’s build a plugin
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Plugin Creation
• Choose a name
– Choose a prefix (sf is only for Official Plugins) - Your
initials for example
– If it depends on Propel or Doctrine, add it to the prefix
– Choose a main name
– Add the « Plugin » suffix
• For our simple plugin: fpPropelSimplePlugin
• Create a folder plugins/fpPropelSimplePlugin
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Add some Web Assets
• Put assets in a web/ folder
– web/js
– web/css
– web/images
• symfony plugin-install …
– Creates a symlink on *nix
– Copies all files on Windows
in the web/fpPropelSimplePlugin folder
plugins/fpPropelSimplePlugin/web/images/test.png
>
http://localhost/fpPropelSimplePlugin/images/test.png
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Add some Model Classes
• config/schema.[xml|yml]
<database name="propel"
package="plugins.fpPropelSimplePlugin.lib.model" ...>
propel:
_attributes:
package: plugins.fpPropelSimplePlugin.lib.model
• You can have foreign keys between plugins and
the main application
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Example
sfSimpleBlogPlugin
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Add some Configuration
• Make your plugin customizable
– apps/APP/config/app.yml
– Prefix with the plugin name
– sfConfig::get(‘app_fpPropelSimplePlugin_XXX’);
• config/config.php
– Do whatever configuration you want
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Example
• sfGuardPlugin
config/config.php
apps/APP/config/app.yml
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Propel Behaviors
• sfPropelParanoidBehaviorPlugin
config/config.php
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Add some Modules
• Same structure as a « normal » module
– You can move module from your application to the
modules/ plugin folder
– But you must « enable » it in settings.yml
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Example
• sfGuardPlugin: Admin Generated modules
• sfSimpleCMSPlugin
– Actions inheritance
– Templates inheritance
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Don’t Reinvent the Wheel
• Don’t add a security mechanism
– Rely on symfony built-in credentials
– Use other plugins (sfGuardPlugin)
• Don’t add a media library
– Use sfMediaLibraryPlugin
• Don’t create yet another plugin to do client side
validation
– Try to enhance existing ones
– Contact the main author to discuss your
enhancements
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Add a LICENSE file
• Choose an Open-Source license
– MIT
– BSD
– LGPL
– GPL
– …
• Add a LICENSE file in the root folder
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Add a README file
• README structure
– Installation
– Configuration
– Customization
– Known Limitations
– Todo List
– Change Log
• Trac Wiki Format
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Package a Plugin
• A symfony Plugin package is a PEAR package
• Add a package.xml
– Name
– Description
– Summary
– Author(s)
– Version
– Stability
– Dependencies
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Publish It
• For private usage
– Host it somewhere
symfony plugin-install http://plugins.xxx.com/fpPropelSimplePlugin-1.0.0.tgz
• Host it on symfony-project.com
– Must be released under an Open-Source license
– The community helps you fix bugs and enhance it
– Fame
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
On symfony-project.com
• Create a trac account
• Create a new Wiki page named after your plugin
name
• Attach the PEAR package
• Ask Fabien for SVN access
• Spread the word… post on the mailing-list & the
forum
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Next symfony Workshops
En français : Paris, France - Dec 05, 2007
In English : Paris, France - Feb 13, 2008
More info on www.sensiolabs.com
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
Join Us
• Sensio Labs is recruiting in France
– project managers
– web developers
• You have a passion for the web?
– Web Developer : You have a minimum of 3 years experience in
web development with Open-Source projects and you wish to
participate to development of Web 2.0 sites using the best
frameworks available.
– Project Manager : You have more than 5 years experience as a
developer and/or a project manager and you want to manage
complex Web projects for prestigious clients.
Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com 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/

More Related Content

Similar to Write Plugins for symfony (Symfony Camp 2007)

symfony: An Open-Source Framework for Professionals (PHP Day 2008)
symfony: An Open-Source Framework for Professionals (PHP Day 2008)symfony: An Open-Source Framework for Professionals (PHP Day 2008)
symfony: An Open-Source Framework for Professionals (PHP Day 2008)Fabien Potencier
 
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
 
symfony: Simplify your professional web development with PHP (Symfony PHP Que...
symfony: Simplify your professional web development with PHP (Symfony PHP Que...symfony: Simplify your professional web development with PHP (Symfony PHP Que...
symfony: Simplify your professional web development with PHP (Symfony PHP Que...Fabien Potencier
 
Myphp-busters: symfony framework
Myphp-busters: symfony frameworkMyphp-busters: symfony framework
Myphp-busters: symfony frameworkStefan Koopmanschap
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)Fabien Potencier
 
Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Stefan Koopmanschap
 
Symfony 1.1 - Fabien Potencier
Symfony 1.1 - Fabien PotencierSymfony 1.1 - Fabien Potencier
Symfony 1.1 - Fabien Potencierdpc
 
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...Les-Tilleuls.coop
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fwdays
 
Symfony on steroids
: Vue.js, Mercure, Panther
Symfony on steroids
: Vue.js, Mercure, PantherSymfony on steroids
: Vue.js, Mercure, Panther
Symfony on steroids
: Vue.js, Mercure, PantherLes-Tilleuls.coop
 
Migration of a legacy project to Symfony
Migration of a legacy project to SymfonyMigration of a legacy project to Symfony
Migration of a legacy project to SymfonyPixel Federation
 
Sympal - Symfony CMS Preview
Sympal - Symfony CMS PreviewSympal - Symfony CMS Preview
Sympal - Symfony CMS PreviewJonathan Wage
 
How composer saved PHP
How composer saved PHPHow composer saved PHP
How composer saved PHPRyan Kilfedder
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkRyan Weaver
 
Myphp-busters: symfony framework (php|tek 09)
Myphp-busters: symfony framework (php|tek 09)Myphp-busters: symfony framework (php|tek 09)
Myphp-busters: symfony framework (php|tek 09)Stefan Koopmanschap
 
Symfony4 - Deep dive
Symfony4 - Deep diveSymfony4 - Deep dive
Symfony4 - Deep diveSalma Ghareeb
 
Symfony: A Brief Introduction
Symfony: A Brief IntroductionSymfony: A Brief Introduction
Symfony: A Brief IntroductionCraig Willis
 
Artificial Neural Networks with PHP & Symfony con 2014
Artificial Neural Networks with PHP & Symfony con 2014Artificial Neural Networks with PHP & Symfony con 2014
Artificial Neural Networks with PHP & Symfony con 2014Eduardo Gulias Davis
 

Similar to Write Plugins for symfony (Symfony Camp 2007) (20)

symfony: An Open-Source Framework for Professionals (PHP Day 2008)
symfony: An Open-Source Framework for Professionals (PHP Day 2008)symfony: An Open-Source Framework for Professionals (PHP Day 2008)
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...
 
symfony: Simplify your professional web development with PHP (Symfony PHP Que...
symfony: Simplify your professional web development with PHP (Symfony PHP Que...symfony: Simplify your professional web development with PHP (Symfony PHP Que...
symfony: Simplify your professional web development with PHP (Symfony PHP Que...
 
Myphp-busters: symfony framework
Myphp-busters: symfony frameworkMyphp-busters: symfony framework
Myphp-busters: symfony framework
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
 
Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)
 
Symfony 1.1 - Fabien Potencier
Symfony 1.1 - Fabien PotencierSymfony 1.1 - Fabien Potencier
Symfony 1.1 - Fabien Potencier
 
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"
 
Symfony on steroids
: Vue.js, Mercure, Panther
Symfony on steroids
: Vue.js, Mercure, PantherSymfony on steroids
: Vue.js, Mercure, Panther
Symfony on steroids
: Vue.js, Mercure, Panther
 
Migration of a legacy project to Symfony
Migration of a legacy project to SymfonyMigration of a legacy project to Symfony
Migration of a legacy project to Symfony
 
Sympal - Symfony CMS Preview
Sympal - Symfony CMS PreviewSympal - Symfony CMS Preview
Sympal - Symfony CMS Preview
 
How composer saved PHP
How composer saved PHPHow composer saved PHP
How composer saved PHP
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 Framework
 
Myphp-busters: symfony framework (php|tek 09)
Myphp-busters: symfony framework (php|tek 09)Myphp-busters: symfony framework (php|tek 09)
Myphp-busters: symfony framework (php|tek 09)
 
Running Symfony
Running SymfonyRunning Symfony
Running Symfony
 
Symfony4 - Deep dive
Symfony4 - Deep diveSymfony4 - Deep dive
Symfony4 - Deep dive
 
Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3
 
Symfony: A Brief Introduction
Symfony: A Brief IntroductionSymfony: A Brief Introduction
Symfony: A Brief Introduction
 
Artificial Neural Networks with PHP & Symfony con 2014
Artificial Neural Networks with PHP & Symfony con 2014Artificial Neural Networks with PHP & Symfony con 2014
Artificial Neural Networks with PHP & Symfony con 2014
 

More from 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
 

More from 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
 

Recently uploaded

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

Write Plugins for symfony (Symfony Camp 2007)

  • 1. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com symfony Write Plugins Fabien Potencier http://www.symfony-project.com/ http://www.sensiolabs.com/
  • 2. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com What is a Plugin? • Directory structure convention •Classes •Filters •Mixins •Helpers •Configuration •Tasks •Modules •Schemas •Model Extensions •Fixtures •Web Assets
  • 3. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com What for? •To contribute back a symfony extension •Another way to package your code •To share code between projects Portability
  • 4. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Let’s build a plugin
  • 5. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Plugin Creation • Choose a name – Choose a prefix (sf is only for Official Plugins) - Your initials for example – If it depends on Propel or Doctrine, add it to the prefix – Choose a main name – Add the « Plugin » suffix • For our simple plugin: fpPropelSimplePlugin • Create a folder plugins/fpPropelSimplePlugin
  • 6. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Add some Web Assets • Put assets in a web/ folder – web/js – web/css – web/images • symfony plugin-install … – Creates a symlink on *nix – Copies all files on Windows in the web/fpPropelSimplePlugin folder plugins/fpPropelSimplePlugin/web/images/test.png > http://localhost/fpPropelSimplePlugin/images/test.png
  • 7. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Add some Model Classes • config/schema.[xml|yml] <database name="propel" package="plugins.fpPropelSimplePlugin.lib.model" ...> propel: _attributes: package: plugins.fpPropelSimplePlugin.lib.model • You can have foreign keys between plugins and the main application
  • 8. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Example sfSimpleBlogPlugin
  • 9. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Add some Configuration • Make your plugin customizable – apps/APP/config/app.yml – Prefix with the plugin name – sfConfig::get(‘app_fpPropelSimplePlugin_XXX’); • config/config.php – Do whatever configuration you want
  • 10. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Example • sfGuardPlugin config/config.php apps/APP/config/app.yml
  • 11. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Propel Behaviors • sfPropelParanoidBehaviorPlugin config/config.php
  • 12. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Add some Modules • Same structure as a « normal » module – You can move module from your application to the modules/ plugin folder – But you must « enable » it in settings.yml
  • 13. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Example • sfGuardPlugin: Admin Generated modules • sfSimpleCMSPlugin – Actions inheritance – Templates inheritance
  • 14. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Don’t Reinvent the Wheel • Don’t add a security mechanism – Rely on symfony built-in credentials – Use other plugins (sfGuardPlugin) • Don’t add a media library – Use sfMediaLibraryPlugin • Don’t create yet another plugin to do client side validation – Try to enhance existing ones – Contact the main author to discuss your enhancements
  • 15. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Add a LICENSE file • Choose an Open-Source license – MIT – BSD – LGPL – GPL – … • Add a LICENSE file in the root folder
  • 16. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Add a README file • README structure – Installation – Configuration – Customization – Known Limitations – Todo List – Change Log • Trac Wiki Format
  • 17. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Package a Plugin • A symfony Plugin package is a PEAR package • Add a package.xml – Name – Description – Summary – Author(s) – Version – Stability – Dependencies
  • 18. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com
  • 19. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Publish It • For private usage – Host it somewhere symfony plugin-install http://plugins.xxx.com/fpPropelSimplePlugin-1.0.0.tgz • Host it on symfony-project.com – Must be released under an Open-Source license – The community helps you fix bugs and enhance it – Fame
  • 20. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com On symfony-project.com • Create a trac account • Create a new Wiki page named after your plugin name • Attach the PEAR package • Ask Fabien for SVN access • Spread the word… post on the mailing-list & the forum
  • 21. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Next symfony Workshops En français : Paris, France - Dec 05, 2007 In English : Paris, France - Feb 13, 2008 More info on www.sensiolabs.com
  • 22. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com www.sensiolabs.com Join Us • Sensio Labs is recruiting in France – project managers – web developers • You have a passion for the web? – Web Developer : You have a minimum of 3 years experience in web development with Open-Source projects and you wish to participate to development of Web 2.0 sites using the best frameworks available. – Project Manager : You have more than 5 years experience as a developer and/or a project manager and you want to manage complex Web projects for prestigious clients.
  • 23. Symfony Camp 2007 www.symfony-project.com fabien.potencier@sensio.com 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/