Your SlideShare is downloading. ×
  • Like
PHP Indonesia Meetup - What's New in Yii2 and PHP5.5
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

PHP Indonesia Meetup - What's New in Yii2 and PHP5.5


My presentation at PHP Indonesia Iftar event, July 20th 2013 at Microsoft Indonesia HQ. The presentation is about several new features for the upcoming Yii2 and the newly released PHP5.5. …

My presentation at PHP Indonesia Iftar event, July 20th 2013 at Microsoft Indonesia HQ. The presentation is about several new features for the upcoming Yii2 and the newly released PHP5.5.
Video can be accessed here:

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads


Total Views
On SlideShare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. What's New InWhat's New In Yii2 & PHP5.5Yii2 & PHP5.5 Petra Novandi Barus Chief Technology Officer PHP Indonesia MeetupPHP Indonesia Meetup
  • 2. Who Am IWho Am I ● 2009 Graduated from Informatics Eng. ITB – Activities: OS and Internet programming lecture assistant, table tennis unit, etc. ● 2011 Graduated from Master Informatics Eng. ITB – Specialize in distributed systems and parallel programming ● 2011 Recruited as CTO for Contact Me: - mail: - twitter: @petrabarus - linkedin:
  • 3. UrbanIndoUrbanIndo ● A real-estate marketplace for Indonesia: house, land, apartment, commercial, room. ● Board members consist of professionals from Silicon Valley: Apple, Google, Yahoo. ● Launched November 2011 ● Got investment from East Ventures 4 months later ● Got investment from Gree Ventures & IMJ Fenox in 2013 ● Currently listing – 16 thousand registered users – 7 thousand agents – 100 thousand properties
  • 4. UrbanIndo Technology StackUrbanIndo Technology Stack elasticsearchelasticsearch
  • 5. What I'm Going To Talk AboutWhat I'm Going To Talk About ●Yii2 ● PHP 5.5 (Not really related with Yii2, just filling some time for the Iftar)
  • 6. Let's talk about Yii firstLet's talk about Yii first ● A macro PHP framework ● A lot of functionalities ● Great design ● Easy to extend ● Easy to configure ● But hard learning-curve
  • 7. Yii FeaturesYii Features ● MVC ● DAO, Active Record, Database Migration ● Authentication/Authorization ● Skinning/Theming ● Web Services ● I18n, L10N ● Cache ● And many more
  • 8. Yii2Yii2 ● Yii2 is now in public preview. – It's not even alpha – Don't use it for production – Not all functionalities from Yii1.1 has been imported. ● Supports PHP5.3+ ● Most of the changes are in redesigning the architecture.
  • 9. What's new inWhat's new in Yii2?Yii2?
  • 10. NamespaceNamespace ● Actually Yii1.1 has support namespace usage in user's code (since 1.1.5) using autoloading ● For PHP5.3+ usage only (Yii1.1 still supports PHP5.2) ● Support PSR-0 Better IDE support Can easily be mistaken with other Strings
  • 11. NamespaceNamespace ● Yii1.1 classes has to be in global namespaces ● To prevent conflict, all classes in Yii1.1 use 'C' prefix.
  • 12. Namespace in Yii2Namespace in Yii2 ● Better namespace organization – e.g. we used to have – – – – – No more long class name
  • 13. Components and ObjectComponents and Object ● In Yii1.1, we have CComponents – Getter/Setter through magic __get, __set, __call – Behavior – Event. ● In Yii2 we have Object and Component – Object, basic data structure, getter/setter, toArray, object configuration, className (added in PHP5.5). – Component, extends Object, added event and behavior
  • 14. Object ConfigurationObject Configuration ● In Yii1.1 ● ● ● ● In Yii2
  • 15. Event HandlerEvent Handler ● More straightforward using jQuery-like event handler
  • 16. View ObjectView Object ● In Yii1.1 'view' is implemented as plain php file.
  • 17. View ObjectView Object ● In Yii2, the view is implemented as a View object
  • 18. View ObjectView Object ● Controller and Widget now accessed as View's context ● Easily do view-rendering every where, not just in controller ● CClientScript responsibility is now part of View object. ● Fragment cache moved from Controller to View object ● Supports multiple non-native renderer like Smarty and Twig
  • 19. ModelsModels ● Yii2 introduces formName – Yii1.1 uses hardcoded class name
  • 20. ModelsModels
  • 21. ModelModel ● Easy loading (mass attribute assignment from $_POST or $_GET)
  • 22. ModelModel ● Mass object assignment, e.g. Tabular Input
  • 23. WidgetsWidgets ● In Yii1.1, Widget helps a lot. But declaring one can give great pain. ● Bad IDE support
  • 24. WidgetsWidgets ● In Yii2, added className() method (PHP5.3) and begin(), end() method.
  • 25. Query BuilderQuery Builder ● Query builder stands alone
  • 26. ActiveRecordActiveRecord ● Relation now done via getter instead of relations() method ● Getter returns ActiveQuery that extends Query
  • 27. ActiveRecordActiveRecord ● Method find() replaces method model() which returns ActiveQuery instance instead of the extended CactiveRecord model instance.
  • 28. Many MoreMany More ● Assets Bundling ● Static Helpers ● ActiveForm ● Auto Quoting Column Names ● User and Identity ● Better URL Management
  • 29. More to comeMore to come ● Better Extension management ● Response/Request ● Integration with Composer ● Widgets (Menu, Pager, Captcha) ● NoSQL wrapper ● MessageQueue wrapper
  • 30. WarningWarning ● Yii2 is still in heavy development ● It's not even in Alpha phase ● What I talk about right now can be obsolete next week ● Fork the github – ● Try installing ● Put your idea and your fix
  • 31. What's new inWhat's new in PHP 5.5PHP 5.5 Not really related with Yii2, just filling some time
  • 32. What's NewWhat's New ● Generators ● “Finally” Keyword ● Password Hashing API ● Bundled OPcode cache ● Class name to scalar ● Array dereferencing ● And many more...
  • 33. GeneratorGenerator ● Simple iterator without implementing “Iterator” interface ● Iterate result without building array in memory – Exceed memory limit – Time consuming ● Introduces the keyword 'yield'
  • 34. 'Finally' keyword'Finally' keyword ● Just like the one in Java ● Mostly concerns with resource handling – Prevent resource leaking ● Block in `finally` will be executed no matter if the exception caught or not
  • 35. Bundled Zend OpCacheBundled Zend OpCache ● is ZendOptimizerPlus by Zend – – provides faster PHP execution through opcode caching andoptimization – storing precompiled script bytecode in the shared memory ● There is also APC (Alternative PHP Cache) – not really maintainable ● Zend OpCache is now bundled with PHP5.5 – You can still install it in PHP5.2, PHP5.3, PHP5.4
  • 36.
  • 37. Password Hashing APIPassword Hashing API ● password_hash() – Can set the algorithm, the cost, the salt – The value returned will contain the algorithm, the cost, the salt, and the hash itself. – Only need 1 storage (or 1 column in table). ● password_verify() – Only take the plain password and the hash result
  • 38. Thank You!Thank You!
  • 39. Just for your information :) We have a lot of opportunities - Web engineer - Front-end engineer - Mobile app engineer - Data scientist - Internship Send your resume to