outline - cu-boulder computer science
TRANSCRIPT
![Page 1: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/1.jpg)
A PHP5 Open-Source FrameworkA PHP5 Open-Source FrameworkA PHP5 Open-Source FrameworkA PHP5 Open-Source Framework
By Hanchao Wu By Hanchao Wu By Hanchao Wu By Hanchao Wu
![Page 2: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/2.jpg)
OutlineOutlineOutlineOutline� Introduction� Why Symfony� Architecture� Configurability� ORM� Admin Generator� Functional Tests� Debugging tools� Community Plugins� Summary
![Page 3: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/3.jpg)
IntroductionIntroductionIntroductionIntroduction� Sensio(Frech), Oct. 2005� PHP5 Web Framework� Open-Source
� MIT license� LAMP full Stack
� Make heavy use of open-source php projects
� M-V-C
LicenceMIT
![Page 4: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/4.jpg)
DonDonDonDon’’’’t reinvent the wheelt reinvent the wheelt reinvent the wheelt reinvent the wheel� Follow best practices� MVC Pattern : Model / View / Controller� Unit and functional test framework� Environment and deployment support� Security (XSS protection by default)� Extensible (plugin system)
![Page 5: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/5.jpg)
Popular PHP frameworksPopular PHP frameworksPopular PHP frameworksPopular PHP frameworks� CakePHPCakePHPCakePHPCakePHP
� Documentation is somewhat lacking� Apparently difficult for beginners
� KiwiPHPKiwiPHPKiwiPHPKiwiPHP� Powerful, but still unstable
� SymfonySymfonySymfonySymfony� Great documentation and community� Easy to get started
� ZendZendZendZend� Supported by Zend (official PHP company)� More of a library than complete framework
![Page 6: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/6.jpg)
Symfony Main Selling PointsSymfony Main Selling PointsSymfony Main Selling PointsSymfony Main Selling Points� Configurability� XSS protection� Debugging tools� Functional tests� Extensibility : Plugins� Admin Generator� ORM : Propel or Doctrine� i18n / l10n
StandardPHP 5MVC
RoutingCache
![Page 7: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/7.jpg)
ArchitectureArchitectureArchitectureArchitecture
![Page 8: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/8.jpg)
PackagesPackagesPackagesPackages
![Page 9: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/9.jpg)
ConfigurabilityConfigurabilityConfigurabilityConfigurability� cmd
� YAML
![Page 10: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/10.jpg)
ORMORMORMORM� Doctrine & Propel
� PHP Open-Source Project� Object Relation Model Layer� One of Doctrine's key features is the option to
write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL) inspired by Hibernate's HQL.
� YAML --> Database tables
![Page 11: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/11.jpg)
DoctrineDoctrineDoctrineDoctrine
![Page 12: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/12.jpg)
ORM Example(Doctrine)ORM Example(Doctrine)ORM Example(Doctrine)ORM Example(Doctrine)� Examples:� $user = new User();� $user->name = "john";� $user->password = "doe";� $user->save();� echo "The user with id $user->id has been
saved.";
![Page 13: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/13.jpg)
Admin GeneratorAdmin GeneratorAdmin GeneratorAdmin Generator� Code Generation Based on the
Model(CRUD)� Creation of a record� Retrieval of records� Update of a record (and modification of its
columns)� Deletion of a record
![Page 14: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/14.jpg)
Admin Generator Cont.Admin Generator Cont.Admin Generator Cont.Admin Generator Cont.� Automatic creation of an Administration Backend,
ready for production• Lists • Pagination• Sorting
• Filters• Validation• CRUD
![Page 15: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/15.jpg)
Admin Generator Cont.Admin Generator Cont.Admin Generator Cont.Admin Generator Cont.� Example:
![Page 16: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/16.jpg)
Admin Generator Cont.Admin Generator Cont.Admin Generator Cont.Admin Generator Cont.� Pagination & CRUD�
![Page 17: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/17.jpg)
Functional TestsFunctional TestsFunctional TestsFunctional Tests� Functional tests are a great tool to test your
application from end to end: from the request made by a browser to the response sent by the server. They test all the layers of an application: the routing, the model, the actions, and the templates.
![Page 18: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/18.jpg)
Functional Tests Cont.Functional Tests Cont.Functional Tests Cont.Functional Tests Cont.
![Page 19: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/19.jpg)
Functional Tests Cont.Functional Tests Cont.Functional Tests Cont.Functional Tests Cont.
![Page 20: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/20.jpg)
Debugging ToolsDebugging ToolsDebugging ToolsDebugging Tools
![Page 21: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/21.jpg)
Debugging Tool Cont.Debugging Tool Cont.Debugging Tool Cont.Debugging Tool Cont.� Web Debugging tool
![Page 22: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/22.jpg)
Debugging Tools Cont.Debugging Tools Cont.Debugging Tools Cont.Debugging Tools Cont.
![Page 23: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/23.jpg)
Community Plugin(Recomended)Community Plugin(Recomended)Community Plugin(Recomended)Community Plugin(Recomended)
� SfDoctrinGuardPlugin.� Identity management plugin
� SfJequeryReloadedPlugin.� Easy integration of jQuery
� sfAdminThemejRollerPlugin� Admin generator theme based on jQuery UI
ThemeRoller
![Page 24: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/24.jpg)
Community Plugins Cont.Community Plugins Cont.Community Plugins Cont.Community Plugins Cont.� CMS
� apostrophePlugin� Apostrophe is a Symfony and Doctrine-based CMS that
emphasizes in-context editing. All slot types are implemented as Symfony modules, with all the flexibility that implies. Version control is implemented, permitting easy rollback of all edits. jQuery is used to implement AJAX features.
� sfSympalPlugin� Sympal is an extension of symfony that provides a content
management framework layer on top of all the greatness you get with symfony. It is a nice plug n' play architecture so other Sympal plugins can interact with the core and manipulate things with events.
![Page 25: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/25.jpg)
Community Plugins Cont.Community Plugins Cont.Community Plugins Cont.Community Plugins Cont.� Web Service:
� sfDoctrineRestGeneratorPlugin� This plugin permits to generate REST modules bound to
Doctrine models. It allows to easily create REST webservices, and provides an extensible framework for data exchange. Here are some key features : REST module generation "à la admin-generator" easy-to-customize generator.yml configuration file validation of the parameters passed to the service using symfony validators serialization as XML or JSON feeds possibility to embed related models possibility to embed extra fields ability to limit the number of results, with ou without pagination support for constraints unions (ie., http://api.example.org/city?city_id=12,13,14) hookable through events and filters abstract and replaceable objects serialization full HTTP support (GET, POST, PUT, DELETE)
![Page 26: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/26.jpg)
SummarySummarySummarySummary
� A framework, not a toolbox� Highly configurable, only functionality
for developing a web app� Should be used together with plugins
![Page 27: Outline - CU-Boulder Computer Science](https://reader031.vdocuments.mx/reader031/viewer/2022020621/61ea73f8c39ede7f0e567384/html5/thumbnails/27.jpg)
Q&A?Q&A?Q&A?Q&A?� Thanks.