SlideShare a Scribd company logo
Plugins and making your own Lambert Beekhuis Lead developer at DOP
Why plugins? Re-use common functionality For yourself...in multiple projects Or better...for the symfony community Sharing/learning How should I build a Plugin?
Plugins as of today (ok, Thursday 11 th  of september) Stats 269  plugins 688  releases 134  developers 4104  users symfony 1.0 symfony 1.1 symfony 1.2 All 231 123 60 Bound to Propel 75 39 19 Bound to Doctrine 6 2 1
Popular plugins Popular Plugins  on 2007/08/14top-20-symfony-plugins (symfony-project blog top-20-symfony-plugins) 1. sfSimpleCMSPlugin 2. sfGuardPlugin 3. sfDoctrinePlugin 4. sfPropelActAsNestedSetBehaviorPlugin 5. sfMediaLibraryPlugin 6. sfSimpleBlogPlugin 7. sfSimpleForumPlugin 8. sfFeed2Plugin 9. sfgWidgetsPlugin 10. sfThumbnailPlugin 11. sfUJSPlugin 12. sfControlPanelPlugin 13. sfFormValidationPlugin 14. sfMogileFSPlugin 15. sfLightboxPlugin 16. sfCaptchaPlugin 17. sfNiftyPlugin 18. sfPrototypeWindowPlugin 19. sfPropelLoadbalancerPlugin 20. sfSavvyPlugin 21. sfYzClientSideValidationPlugin Today (2009/09/11) sfGuardPlugin Authorisation sfSimpleCMSPlugin Content Management sfDoctrinePlugin Doctrine ORM sfPropelActAsNestedSetBehaviorPlugin Propel-trees sfLucenePlugin Searching sfThumbnailPlugin Thumbnails/resizing sfMediaLibraryPlugin Manage web-assets (images, PDF, flash objects) sfExtjs2Plugin Possible to write external JavaScript
Top down development ‘ it works’ is not enough!  Good structure!
Developing cycles Development - cycle Idea or requirements Design/principle/philosofie Coding Testing Documentation Maintenance Comments.... Fun part Prior to coding or ...? Lot of focus (to much?) Do you test systematically? Essential! often ‘forgotten’! Not a fun part...but with the community is much better!
Talking as a consultant.... Urgent  Not urgent Important Not important
Used for development Urgent  Not urgent Important ‘ It works’ Debugging Software structure Documentation Refactoring Not important Features never used
Plugins Make a plugin: Independant of your application Upgradable Customizable PHP PHP Symfony Database ORM Your Application plugin plugin customize customize plugin customize
Plugin - basics A plugin can contains all options grouped,  (similar to in your application) Config Config.php Data Fixtures Lib Helper/ Model/ schema.yml: propel:   _attributes:  { package plugins.lbSaasPlugin.lib.model } Others (e.g. Filters) Modules Actions Templates Validate Config Module.yml View.yml Enable a plugin in your application Settings.yml Application-config/app.yml New in symfony 1.1 Handle plugin dependencies at installation Customizing the plugin-schema all: lb_saas_plugin: enable_saas_filter:  on  # switch the extra Saas-filter on/off saas_profile_class:  Client  # PHP-object name for Saas-object saas_profile_field_name:  saas_id all: .settings: enabled_modules:  [default, sfGuardAuth]
Installing a plugin - basics symfony 1.0 Install a plugin > cd myproject  > php symfony plugin-install channelName/pluginName  > php symfony cc Enable modules in your application: In: apps/ myApplication /config/settings.yml All:   .settings:   enabled_modules:  [  yourPluginModule ] Follow additional instructions from readme Clear cache > php symfony cc symfony 1.1 Install a plugin > cd myproject  > php symfony plugin:install pluginName
Based on the ‘SaasPlugin’ ‘ Software as a Service’ authentication User has access to one or more Saas-en Extension on sfGuardPlugin Clean URLs e.g.  www.application.com\saasOne\module\action (after yesterday: saasOne.application.com\module\action) Administration interfaces for  Application admin  ‘ saasAdmin’ Limit data-retrieval for the selected Saas (based on Propel right now)
Customizing a Plugin Rule never alter the code found in the plugins/ directory use settings  that can be changed in the application app.yml Replace functions in your application create a module of the same name in your own application. Allow replacing Create ‘empty’ actions/models in your plugin, e.g. Actions Model
Replacing model functions plugins/xxxPlugin/lib/model/om/BasexxxObject.php plugins/xxxPlugin/lib/model/map/xxxObjectMapBuilder.php plugins/xxxPlugin/lib/model/xxxObject.php plugins/xxxPlugin/lib/model/om/BasexxxObject.php plugins/xxxPlugin/lib/model/map/xxxObjectMapBuilder.php plugins/xxxPlugin/lib/model/xxxObject.php plugins/xxxPlugin/lib/model /plugin/ PluginxxxObject.php class pluginxxxObject extends BasexxxObject { // your plugin functions } class xxxObject extends pluginxxxObject { // empty } Generated by ORM (propel) (do not touch) Your functions Can be replaced in your application- module
Replacing plugin functions Add empty module in your application Add a template in this module Add security.yml in your application Add actions (requires proper plugin setup) Add model-classes in your application Requires proper plugin-setup
Other ways – routing/filters/... Routing ‘injection’, e.g. in ‘user’ public static function add_default_saas_routes {   $r = sfRouting::getInstance();   $r->prependRoute('saas_default', /:clientslug/s/:module/:action/*'); Use an additional filter for global functions (e.g. Filters the URL and checks against allowed Saas) Your appliction/config/filters.yml rendering: ~ web_debug: ~ saas:  class:  saasFilter condition: %APP_LB_SAAS_PLUGIN_ENABLE_SAAS_FILTER% security:  ~ # generally, you will want to insert your own filters here cache:  ~ common:  ~ flash:  ~ execution: ~
Deploying plugins For own purpose Use SVN:external for use in multiple projects Publish as symfony-project.org Define the new Plugin at  www.symfony-project.org/plugin/new Naming conventions Propel dependency E.g sfPropelActAsNestedSetBehaviorPlugin First two letters/initials can be your initials (or just use sf) E.g.  dwPrototypeTooltipPlugin   Define a proper readme! Select a license add a package.xml file at the root of the plug-in directory  Upload your PEAR package
Plugins - conclusions Powerfull way to extend the framework functions Many plugins available Usefullness and quality depends As of today, not easy to find usefullness and quality symfony-project.org Many options for customization If Plugin is developed correctly!

More Related Content

DOC
Weblogic.deployer usage
PDF
Laravel Forge: Hello World to Hello Production
PPTX
Automated testing with Drupal
PPTX
It’s your time to ask questions
KEY
Enterprise Build And Test In The Cloud
KEY
Enterprise Build And Test In The Cloud
PPTX
ADF 2.4.0 And Beyond
KEY
WordPress Bootcamp Part 2 - Extending WordPress
Weblogic.deployer usage
Laravel Forge: Hello World to Hello Production
Automated testing with Drupal
It’s your time to ask questions
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The Cloud
ADF 2.4.0 And Beyond
WordPress Bootcamp Part 2 - Extending WordPress

What's hot (20)

PDF
Session on Selenium Powertools by Unmesh Gundecha
PPTX
Play with Alfresco ADF 2.0.0 Angular
PPTX
MuleSoft ESB Testing Mule Application using MUnit Test Suite
PPT
Rails engines
PPTX
Maven 3 New Features
PDF
Web application testing with Selenium
PPT
The Emergence of Choice in the .NET Ecosystem
PPTX
Magento Meetup New Delhi- Console
PPT
Top 50 Interview Questions and Answers in CakePHP
PPTX
Laravel and artisan cli
PDF
Laravel 5.4
PDF
Automatic Functional Testing with Selenium and SauceLabs
PPT
PPT
Word press Plugins by WordPress Experts
PPTX
Session on Selenium 4 : What’s coming our way? by Hitesh Prajapati
PDF
Behaviour Driven Development con Behat & Drupal
ODP
5 Reasons Why Maven Sux
PDF
PHP on Google App Engine
PPT
Automated Web Testing Using Selenium
KEY
Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress Themes
Session on Selenium Powertools by Unmesh Gundecha
Play with Alfresco ADF 2.0.0 Angular
MuleSoft ESB Testing Mule Application using MUnit Test Suite
Rails engines
Maven 3 New Features
Web application testing with Selenium
The Emergence of Choice in the .NET Ecosystem
Magento Meetup New Delhi- Console
Top 50 Interview Questions and Answers in CakePHP
Laravel and artisan cli
Laravel 5.4
Automatic Functional Testing with Selenium and SauceLabs
Word press Plugins by WordPress Experts
Session on Selenium 4 : What’s coming our way? by Hitesh Prajapati
Behaviour Driven Development con Behat & Drupal
5 Reasons Why Maven Sux
PHP on Google App Engine
Automated Web Testing Using Selenium
Philip Arthur Moore: Best Practices — On Breaking and Fixing WordPress Themes
Ad

Viewers also liked (20)

PDF
OkAPI meet symfony, symfony meet OkAPI
PDF
PHP, Cloud And Microsoft Symfony Live 2010
PDF
Debugging With Symfony
PDF
Decoupling Content Management with Create.js and PHPCR
PPTX
Speed up your developments with Symfony2
PDF
Symfony As A Platform (Symfony Camp 2007)
PDF
The state of Symfony2 - SymfonyDay 2010
PDF
The new form framework
PPTX
What Symfony Has To Do With My Garage - Home Automation With PHP
PDF
Symfony Internals
PDF
Symfony in the Cloud
ODP
How to Clear Cache in a Symfony Cross Application
PDF
Apostrophe
PDF
Symfony2 and Doctrine2 Integration
PDF
Doctrine in the Real World
PDF
Developing for Developers
PDF
Symfony and eZ Publish
PDF
Doctrine Php Object Relational Mapper
PDF
Symfony2 revealed
PDF
Implementing a Symfony Based CMS in a Publishing Company
OkAPI meet symfony, symfony meet OkAPI
PHP, Cloud And Microsoft Symfony Live 2010
Debugging With Symfony
Decoupling Content Management with Create.js and PHPCR
Speed up your developments with Symfony2
Symfony As A Platform (Symfony Camp 2007)
The state of Symfony2 - SymfonyDay 2010
The new form framework
What Symfony Has To Do With My Garage - Home Automation With PHP
Symfony Internals
Symfony in the Cloud
How to Clear Cache in a Symfony Cross Application
Apostrophe
Symfony2 and Doctrine2 Integration
Doctrine in the Real World
Developing for Developers
Symfony and eZ Publish
Doctrine Php Object Relational Mapper
Symfony2 revealed
Implementing a Symfony Based CMS in a Publishing Company
Ad

Similar to Plugins And Making Your Own (20)

PDF
Write Plugins for symfony (Symfony Camp 2007)
PDF
Symfony workshop introductory slides
PPS
Simplify your professional web development with symfony
PDF
Myphp-busters: symfony framework (php|tek 09)
PDF
Symfony for non-techies
PDF
Myphp-busters: symfony framework
PDF
Improve your web and app development with the Symfony3 framework.
PDF
symfony_from_scratch
PDF
symfony_from_scratch
PDF
Symony2 A Next Generation PHP Framework
PPTX
Symfony Best Practices
PDF
Symfony2 - from the trenches
PDF
The Naked Bundle - Tryout
PDF
symfony: Simplify your professional web development with PHP (Symfony PHP Que...
PDF
AtoM feature development
PDF
Symfony2 from the Trenches
PDF
symfony: An Open-Source Framework for Professionals (PHP Day 2008)
PPTX
Symfony2 Introduction Presentation
PDF
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
PDF
Myphp-busters: symfony framework (PHPCon.it)
Write Plugins for symfony (Symfony Camp 2007)
Symfony workshop introductory slides
Simplify your professional web development with symfony
Myphp-busters: symfony framework (php|tek 09)
Symfony for non-techies
Myphp-busters: symfony framework
Improve your web and app development with the Symfony3 framework.
symfony_from_scratch
symfony_from_scratch
Symony2 A Next Generation PHP Framework
Symfony Best Practices
Symfony2 - from the trenches
The Naked Bundle - Tryout
symfony: Simplify your professional web development with PHP (Symfony PHP Que...
AtoM feature development
Symfony2 from the Trenches
symfony: An Open-Source Framework for Professionals (PHP Day 2008)
Symfony2 Introduction Presentation
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
Myphp-busters: symfony framework (PHPCon.it)

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Approach and Philosophy of On baking technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
A Presentation on Artificial Intelligence
PDF
Modernizing your data center with Dell and AMD
PDF
cuic standard and advanced reporting.pdf
PDF
Electronic commerce courselecture one. Pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Agricultural_Statistics_at_a_Glance_2022_0.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Empathic Computing: Creating Shared Understanding
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
Approach and Philosophy of On baking technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Dropbox Q2 2025 Financial Results & Investor Presentation
Unlocking AI with Model Context Protocol (MCP)
A Presentation on Artificial Intelligence
Modernizing your data center with Dell and AMD
cuic standard and advanced reporting.pdf
Electronic commerce courselecture one. Pdf
The AUB Centre for AI in Media Proposal.docx
Per capita expenditure prediction using model stacking based on satellite ima...
20250228 LYD VKU AI Blended-Learning.pptx
Digital-Transformation-Roadmap-for-Companies.pptx

Plugins And Making Your Own

  • 1. Plugins and making your own Lambert Beekhuis Lead developer at DOP
  • 2. Why plugins? Re-use common functionality For yourself...in multiple projects Or better...for the symfony community Sharing/learning How should I build a Plugin?
  • 3. Plugins as of today (ok, Thursday 11 th of september) Stats 269 plugins 688 releases 134 developers 4104 users symfony 1.0 symfony 1.1 symfony 1.2 All 231 123 60 Bound to Propel 75 39 19 Bound to Doctrine 6 2 1
  • 4. Popular plugins Popular Plugins on 2007/08/14top-20-symfony-plugins (symfony-project blog top-20-symfony-plugins) 1. sfSimpleCMSPlugin 2. sfGuardPlugin 3. sfDoctrinePlugin 4. sfPropelActAsNestedSetBehaviorPlugin 5. sfMediaLibraryPlugin 6. sfSimpleBlogPlugin 7. sfSimpleForumPlugin 8. sfFeed2Plugin 9. sfgWidgetsPlugin 10. sfThumbnailPlugin 11. sfUJSPlugin 12. sfControlPanelPlugin 13. sfFormValidationPlugin 14. sfMogileFSPlugin 15. sfLightboxPlugin 16. sfCaptchaPlugin 17. sfNiftyPlugin 18. sfPrototypeWindowPlugin 19. sfPropelLoadbalancerPlugin 20. sfSavvyPlugin 21. sfYzClientSideValidationPlugin Today (2009/09/11) sfGuardPlugin Authorisation sfSimpleCMSPlugin Content Management sfDoctrinePlugin Doctrine ORM sfPropelActAsNestedSetBehaviorPlugin Propel-trees sfLucenePlugin Searching sfThumbnailPlugin Thumbnails/resizing sfMediaLibraryPlugin Manage web-assets (images, PDF, flash objects) sfExtjs2Plugin Possible to write external JavaScript
  • 5. Top down development ‘ it works’ is not enough! Good structure!
  • 6. Developing cycles Development - cycle Idea or requirements Design/principle/philosofie Coding Testing Documentation Maintenance Comments.... Fun part Prior to coding or ...? Lot of focus (to much?) Do you test systematically? Essential! often ‘forgotten’! Not a fun part...but with the community is much better!
  • 7. Talking as a consultant.... Urgent Not urgent Important Not important
  • 8. Used for development Urgent Not urgent Important ‘ It works’ Debugging Software structure Documentation Refactoring Not important Features never used
  • 9. Plugins Make a plugin: Independant of your application Upgradable Customizable PHP PHP Symfony Database ORM Your Application plugin plugin customize customize plugin customize
  • 10. Plugin - basics A plugin can contains all options grouped, (similar to in your application) Config Config.php Data Fixtures Lib Helper/ Model/ schema.yml: propel: _attributes: { package plugins.lbSaasPlugin.lib.model } Others (e.g. Filters) Modules Actions Templates Validate Config Module.yml View.yml Enable a plugin in your application Settings.yml Application-config/app.yml New in symfony 1.1 Handle plugin dependencies at installation Customizing the plugin-schema all: lb_saas_plugin: enable_saas_filter: on # switch the extra Saas-filter on/off saas_profile_class: Client # PHP-object name for Saas-object saas_profile_field_name: saas_id all: .settings: enabled_modules: [default, sfGuardAuth]
  • 11. Installing a plugin - basics symfony 1.0 Install a plugin > cd myproject > php symfony plugin-install channelName/pluginName > php symfony cc Enable modules in your application: In: apps/ myApplication /config/settings.yml All: .settings: enabled_modules: [ yourPluginModule ] Follow additional instructions from readme Clear cache > php symfony cc symfony 1.1 Install a plugin > cd myproject > php symfony plugin:install pluginName
  • 12. Based on the ‘SaasPlugin’ ‘ Software as a Service’ authentication User has access to one or more Saas-en Extension on sfGuardPlugin Clean URLs e.g. www.application.com\saasOne\module\action (after yesterday: saasOne.application.com\module\action) Administration interfaces for Application admin ‘ saasAdmin’ Limit data-retrieval for the selected Saas (based on Propel right now)
  • 13. Customizing a Plugin Rule never alter the code found in the plugins/ directory use settings that can be changed in the application app.yml Replace functions in your application create a module of the same name in your own application. Allow replacing Create ‘empty’ actions/models in your plugin, e.g. Actions Model
  • 14. Replacing model functions plugins/xxxPlugin/lib/model/om/BasexxxObject.php plugins/xxxPlugin/lib/model/map/xxxObjectMapBuilder.php plugins/xxxPlugin/lib/model/xxxObject.php plugins/xxxPlugin/lib/model/om/BasexxxObject.php plugins/xxxPlugin/lib/model/map/xxxObjectMapBuilder.php plugins/xxxPlugin/lib/model/xxxObject.php plugins/xxxPlugin/lib/model /plugin/ PluginxxxObject.php class pluginxxxObject extends BasexxxObject { // your plugin functions } class xxxObject extends pluginxxxObject { // empty } Generated by ORM (propel) (do not touch) Your functions Can be replaced in your application- module
  • 15. Replacing plugin functions Add empty module in your application Add a template in this module Add security.yml in your application Add actions (requires proper plugin setup) Add model-classes in your application Requires proper plugin-setup
  • 16. Other ways – routing/filters/... Routing ‘injection’, e.g. in ‘user’ public static function add_default_saas_routes { $r = sfRouting::getInstance(); $r->prependRoute('saas_default', /:clientslug/s/:module/:action/*'); Use an additional filter for global functions (e.g. Filters the URL and checks against allowed Saas) Your appliction/config/filters.yml rendering: ~ web_debug: ~ saas: class: saasFilter condition: %APP_LB_SAAS_PLUGIN_ENABLE_SAAS_FILTER% security: ~ # generally, you will want to insert your own filters here cache: ~ common: ~ flash: ~ execution: ~
  • 17. Deploying plugins For own purpose Use SVN:external for use in multiple projects Publish as symfony-project.org Define the new Plugin at www.symfony-project.org/plugin/new Naming conventions Propel dependency E.g sfPropelActAsNestedSetBehaviorPlugin First two letters/initials can be your initials (or just use sf) E.g. dwPrototypeTooltipPlugin Define a proper readme! Select a license add a package.xml file at the root of the plug-in directory Upload your PEAR package
  • 18. Plugins - conclusions Powerfull way to extend the framework functions Many plugins available Usefullness and quality depends As of today, not easy to find usefullness and quality symfony-project.org Many options for customization If Plugin is developed correctly!