SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
MAKING THE MOST OF 2.2
        MARK STORY
         @MARK_STORY
PACKING IN THE GOOD
2.0.0 was release October 18, 2011
Since then 2.1, 2.2, and 2.3 have been released or started.
Over 20 releases since 2.0.0.
Highest release velocity ever for CakePHP.
FOCUS ON PROBLEMS
We've tried to keep releases focused on solving real world problems
                    developers have everyday.
               Make upgrading as easy as possible.
VIEW BLOCKS
                            PROBLEM
Multiple similar views would often contain repeated structural
HTML.
Apps suffered from element-itis to keep HTML DRY.
Piles of elements make code hard to follow and understand.
Inspired by blocks in Jinja/Twig.
Allows you to create slots/blocks in layouts or parent templates.
Helps keep views/layouts more DRY by letting you create
extensible HTML content.
Replaces annoying magic variables like $ c i t _ o _ a o t
                                         srpsfrlyu
and $ o t n _ o _ a o t
      cnetfrlyu.
EXAMPLE
Parent wrapper view with a child view
PARENT VIEW
<1cas"otn-il"<=$hs>ec(tte) ?<h>
 h ls=cnettte>? ti-fth'il'; >/1
<i cas"otn"
 dv ls=cnet>
<=$hs>ec(cnet) ?
 ? ti-fth'otn'; >
<dv
 /i>
<i cas"iea"
 dv ls=sdbr>
<=$hs>ec(sdbr) ?
 ? ti-fth'iea'; >
<dv
 /i>
<ppi (ti-fth'aiain):?
 ?h f $hs>ec(pgnto') >
<i cas"aiain>
 dv ls=pgnto"
<=$hs>ec(pgnto';?
 ? ti-fth'aiain) >
<dv
 /i>
<ppedf ?
 ?h ni; >
CHILD VIEW
<pp$hs>xed'.cmo/iea.t';?
 ?h ti-etn(./omnsdbrcp) >
<pp$hs>sin'il' 'rdc ls';?
 ?h ti-asg(tte, Pout it) >
<pp$hs>tr(cnet) ?
 ?h ti-sat'otn'; >
<>hsi tecnet/>
 pTi s h otn<p
<pp$hs>n(;?
 ?h ti-ed) >

<pp$hs>tr(sdbr) ?
 ?h ti-sat'iea'; >
<>hsi asdbr/>
 pTi s  iea<p
<pp$hs>n(;?
 ?h ti-ed) >
JSON & XML VIEWS
                            PROBLEM
Previously creating JSON and XML views that just serialized data
was a pain.
Tons of repetitive views and layout files required.
Two view classes that allow you to easily serialize data for simple
uses.
Special _ e i l z view variable defines which view variables
         sraie
should be serialized.
You can also use normal view files if you need to massage data first.
Integrates well with existing features like exception handling and
RequestHandlerComponent.
EXAMPLE
<pp
 ?h
/ I acnrle.
 / n  otolr
fnto idx){
 ucin ne(
     $hs>e(tss,$hs>aiae);
      ti-st'ak' ti-pgnt()
     $hs>e(_eilz' ary'ak')
      ti-st'sraie, ra(tss);
}
HASH CLASS
                            PROBLEM
S t full of inconsistencies. Both in the API and path selector
 e is
syntax.
Set::extract() while powerful, is slow and insane inside.
xpath-ish syntax full of un-fixable bugs and not supported in most
methods.
Hash implements >90% of Set's API.
All methods have a consistent signature.
The same dot notation features are supported everywhere.
Up to 1.6x faster on extract().
Most methods are faster as well.
PERFORMANCE COMPARISONS
Do a similar operation 1000 times, on the same data.
Hs:etat$,'n.ril.d)
 ah:xrc(d {}Atcei'   0.215131998
St:xrc(/ril/d,$)
 e:etat'Atcei' d     0.23719382
1.1x improvement
H s : e t a t $ , ' n . o m n . n . d ) 0.173635005
 ah:xrc(d {}Cmet{}i'
St:xrc(/omn/d,$)
 e:etat'Cmeti' d                        0.201920986
1.1x improvement
Hs:mxiesos$)
 ah:aDmnin(d       0.075587987
St:onDm$,tu)
 e:cuti(d re       0.575523138
7.6x improvement
API CONSISTENCY
Every method takes an array of data as the first argument.
Second argument is always one or more paths.
A consistent API is easier to document, understand and remember.
CAKETIME & CAKENUMBER
                      PROBLEM
T m H l e , N m e H l e and T x H l e have some very
 ieepr ubrepr                         etepr
useful methods.
But they are all trapped in a helper.
Expose non HTML related features as a utility library.
Greatly improve timezone handling.
New features for testing & working with datetimes.
EXAMPLE
<pp
 ?h
Ap:ss'aeie,'tlt';
 p:ue(CkTm' Uiiy)
Ap:ss'aeubr,'tlt';
 p:ue(CkNme' Uiiy)

$t =CkTm:tSre(dttm,'mrc/oot';
 uc  aeie:oevr$aeie AeiaTrno)
$oa =CkTm:iTdy$ietm)
 tdy  aeie:soa(tmsap;

$eut=CkNme:tRaalSz(oeeaye;
 rsl  aeubr:oedbeie$nTrbt)
LOGGING++
                         PROBLEM
Granular logging based on application section was impossible.
Log messages were simply broadcast to every connected logger.
Borrowed idea of logging 'scopes' from python's l g i g
                                                   o g n module.
Log messages can be tagged with scopes.
Only loggers interested in those scopes will get scoped messages.
ATTACH A LOGGER WITH A SCOPE
<pp
 ?h
CkLg:ofg'amns,ary
 aeo:cni(pyet' ra(
    'nie = 'mi'
     egn' > Eal
    'cps = ary'amns,'iln',
     soe' > ra(pyet' blig)
    'o = 'akeapecm
     t' > mr@xml.o'
);
 )
LOG MESSAGES WITH A SCOPE
<pp
 ?h
ty{
 r
     $aea-poes$amn)
      gtwy>rcs(pyet;
}cth(amnEcpin$){
  ac  Pyetxeto e
     CkLg:ro(
      aeo:err
          'rnato fie '.$-gtesg(,
           Tascin ald   e>eMsae)
          ary'amns,'iln'
           ra(pyet' blig)
     );
}
NOW TO JOSE

Contenu connexe

Tendances

Php tips-and-tricks4128
Php tips-and-tricks4128Php tips-and-tricks4128
Php tips-and-tricks4128PrinceGuru MS
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2Hugo Hamon
 
Dependency Injection with PHP 5.3
Dependency Injection with PHP 5.3Dependency Injection with PHP 5.3
Dependency Injection with PHP 5.3Fabien Potencier
 
Dependency Injection IPC 201
Dependency Injection IPC 201Dependency Injection IPC 201
Dependency Injection IPC 201Fabien Potencier
 
Php unit the-mostunknownparts
Php unit the-mostunknownpartsPhp unit the-mostunknownparts
Php unit the-mostunknownpartsBastian Feder
 
Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8PrinceGuru MS
 
Dependency injection - phpday 2010
Dependency injection - phpday 2010Dependency injection - phpday 2010
Dependency injection - phpday 2010Fabien Potencier
 
Lithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate FrameworksLithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate FrameworksNate Abele
 
Objects, Testing, and Responsibility
Objects, Testing, and ResponsibilityObjects, Testing, and Responsibility
Objects, Testing, and Responsibilitymachuga
 
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
 
PHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php frameworkPHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php frameworkG Woo
 
Your code sucks, let's fix it
Your code sucks, let's fix itYour code sucks, let's fix it
Your code sucks, let's fix itRafael Dohms
 
The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of LithiumNate Abele
 
The Beauty and the Beast
The Beauty and the BeastThe Beauty and the Beast
The Beauty and the BeastBastian Feder
 
PHP Traits
PHP TraitsPHP Traits
PHP Traitsmattbuzz
 
Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4Jeff Carouth
 
Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2Fabien Potencier
 
PHP security audits
PHP security auditsPHP security audits
PHP security auditsDamien Seguy
 

Tendances (20)

Php tips-and-tricks4128
Php tips-and-tricks4128Php tips-and-tricks4128
Php tips-and-tricks4128
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
 
Dependency Injection with PHP 5.3
Dependency Injection with PHP 5.3Dependency Injection with PHP 5.3
Dependency Injection with PHP 5.3
 
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
 
Dependency Injection IPC 201
Dependency Injection IPC 201Dependency Injection IPC 201
Dependency Injection IPC 201
 
Php unit the-mostunknownparts
Php unit the-mostunknownpartsPhp unit the-mostunknownparts
Php unit the-mostunknownparts
 
Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8Corephpcomponentpresentation 1211425966721657-8
Corephpcomponentpresentation 1211425966721657-8
 
Dependency injection - phpday 2010
Dependency injection - phpday 2010Dependency injection - phpday 2010
Dependency injection - phpday 2010
 
Lithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate FrameworksLithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate Frameworks
 
Objects, Testing, and Responsibility
Objects, Testing, and ResponsibilityObjects, Testing, and Responsibility
Objects, Testing, and Responsibility
 
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
 
PHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php frameworkPHP 5.3 and Lithium: the most rad php framework
PHP 5.3 and Lithium: the most rad php framework
 
Your code sucks, let's fix it
Your code sucks, let's fix itYour code sucks, let's fix it
Your code sucks, let's fix it
 
The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of Lithium
 
The Beauty and the Beast
The Beauty and the BeastThe Beauty and the Beast
The Beauty and the Beast
 
PHP Traits
PHP TraitsPHP Traits
PHP Traits
 
Symfony2 - OSIDays 2010
Symfony2 - OSIDays 2010Symfony2 - OSIDays 2010
Symfony2 - OSIDays 2010
 
Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4
 
Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2
 
PHP security audits
PHP security auditsPHP security audits
PHP security audits
 

Similaire à Making the most of 2.2

The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnitEdorian
 
The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnitEdorian
 
The state of PHPUnit
The state of PHPUnitThe state of PHPUnit
The state of PHPUnitEdorian
 
Beginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleBeginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleAri Lerner
 
How Xslate Works
How Xslate WorksHow Xslate Works
How Xslate WorksGoro Fuji
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSPat Cito
 
Computer notes - Hashing
Computer notes - HashingComputer notes - Hashing
Computer notes - Hashingecomputernotes
 
Building modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaBuilding modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaAlexander Gyoshev
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout source{d}
 
computer notes - Data Structures - 35
computer notes - Data Structures - 35computer notes - Data Structures - 35
computer notes - Data Structures - 35ecomputernotes
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpointwebhostingguy
 
PhpUnit Best Practices
PhpUnit Best PracticesPhpUnit Best Practices
PhpUnit Best PracticesEdorian
 
Ch ch-changes cake php2
Ch ch-changes cake php2Ch ch-changes cake php2
Ch ch-changes cake php2markstory
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalystdwm042
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Guillaume Laforge
 
Getting started with ES6
Getting started with ES6Getting started with ES6
Getting started with ES6Nitay Neeman
 
Good practices for PrestaShop code security and optimization
Good practices for PrestaShop code security and optimizationGood practices for PrestaShop code security and optimization
Good practices for PrestaShop code security and optimizationPrestaShop
 

Similaire à Making the most of 2.2 (20)

The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnit
 
The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnit
 
The state of PHPUnit
The state of PHPUnitThe state of PHPUnit
The state of PHPUnit
 
Beginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleBeginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at Google
 
How Xslate Works
How Xslate WorksHow Xslate Works
How Xslate Works
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Computer notes - Hashing
Computer notes - HashingComputer notes - Hashing
Computer notes - Hashing
 
Building modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaBuilding modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and java
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout
 
computer notes - Data Structures - 35
computer notes - Data Structures - 35computer notes - Data Structures - 35
computer notes - Data Structures - 35
 
Magento code audit
Magento code auditMagento code audit
Magento code audit
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
 
PhpUnit Best Practices
PhpUnit Best PracticesPhpUnit Best Practices
PhpUnit Best Practices
 
Ch ch-changes cake php2
Ch ch-changes cake php2Ch ch-changes cake php2
Ch ch-changes cake php2
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalyst
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 
lab4_php
lab4_phplab4_php
lab4_php
 
lab4_php
lab4_phplab4_php
lab4_php
 
Getting started with ES6
Getting started with ES6Getting started with ES6
Getting started with ES6
 
Good practices for PrestaShop code security and optimization
Good practices for PrestaShop code security and optimizationGood practices for PrestaShop code security and optimization
Good practices for PrestaShop code security and optimization
 

Plus de markstory

Dependency injection in CakePHP
Dependency injection in CakePHPDependency injection in CakePHP
Dependency injection in CakePHPmarkstory
 
Safer, More Helpful CakePHP
Safer, More Helpful CakePHPSafer, More Helpful CakePHP
Safer, More Helpful CakePHPmarkstory
 
CakePHP - The Road Ahead
CakePHP - The Road AheadCakePHP - The Road Ahead
CakePHP - The Road Aheadmarkstory
 
Future of HTTP in CakePHP
Future of HTTP in CakePHPFuture of HTTP in CakePHP
Future of HTTP in CakePHPmarkstory
 
CakePHP mistakes made 2015
CakePHP mistakes made 2015CakePHP mistakes made 2015
CakePHP mistakes made 2015markstory
 
New in cakephp3
New in cakephp3New in cakephp3
New in cakephp3markstory
 
CakePHP 3.0 and beyond
CakePHP 3.0 and beyondCakePHP 3.0 and beyond
CakePHP 3.0 and beyondmarkstory
 
CakePHP mistakes made confoo 2015
CakePHP mistakes made confoo 2015CakePHP mistakes made confoo 2015
CakePHP mistakes made confoo 2015markstory
 
CakePHP mistakes made
CakePHP mistakes madeCakePHP mistakes made
CakePHP mistakes mademarkstory
 
Performance and optimization CakeFest 2014
Performance and optimization CakeFest 2014Performance and optimization CakeFest 2014
Performance and optimization CakeFest 2014markstory
 
Road to CakePHP 3.0
Road to CakePHP 3.0Road to CakePHP 3.0
Road to CakePHP 3.0markstory
 
Performance and optimization
Performance and optimizationPerformance and optimization
Performance and optimizationmarkstory
 
OWASP Top 10 2013
OWASP Top 10 2013OWASP Top 10 2013
OWASP Top 10 2013markstory
 
CakePHP the yum & yuck
CakePHP the yum & yuckCakePHP the yum & yuck
CakePHP the yum & yuckmarkstory
 
Owasp top 10
Owasp top 10Owasp top 10
Owasp top 10markstory
 
Simple search with elastic search
Simple search with elastic searchSimple search with elastic search
Simple search with elastic searchmarkstory
 
Intro to continuous integration
Intro to continuous integration Intro to continuous integration
Intro to continuous integration markstory
 
Evented applications with RabbitMQ and CakePHP
Evented applications with RabbitMQ and CakePHPEvented applications with RabbitMQ and CakePHP
Evented applications with RabbitMQ and CakePHPmarkstory
 
PHPunit and you
PHPunit and youPHPunit and you
PHPunit and youmarkstory
 

Plus de markstory (20)

Dependency injection in CakePHP
Dependency injection in CakePHPDependency injection in CakePHP
Dependency injection in CakePHP
 
Safer, More Helpful CakePHP
Safer, More Helpful CakePHPSafer, More Helpful CakePHP
Safer, More Helpful CakePHP
 
CakePHP - The Road Ahead
CakePHP - The Road AheadCakePHP - The Road Ahead
CakePHP - The Road Ahead
 
Future of HTTP in CakePHP
Future of HTTP in CakePHPFuture of HTTP in CakePHP
Future of HTTP in CakePHP
 
CakePHP mistakes made 2015
CakePHP mistakes made 2015CakePHP mistakes made 2015
CakePHP mistakes made 2015
 
New in cakephp3
New in cakephp3New in cakephp3
New in cakephp3
 
PHP WTF
PHP WTFPHP WTF
PHP WTF
 
CakePHP 3.0 and beyond
CakePHP 3.0 and beyondCakePHP 3.0 and beyond
CakePHP 3.0 and beyond
 
CakePHP mistakes made confoo 2015
CakePHP mistakes made confoo 2015CakePHP mistakes made confoo 2015
CakePHP mistakes made confoo 2015
 
CakePHP mistakes made
CakePHP mistakes madeCakePHP mistakes made
CakePHP mistakes made
 
Performance and optimization CakeFest 2014
Performance and optimization CakeFest 2014Performance and optimization CakeFest 2014
Performance and optimization CakeFest 2014
 
Road to CakePHP 3.0
Road to CakePHP 3.0Road to CakePHP 3.0
Road to CakePHP 3.0
 
Performance and optimization
Performance and optimizationPerformance and optimization
Performance and optimization
 
OWASP Top 10 2013
OWASP Top 10 2013OWASP Top 10 2013
OWASP Top 10 2013
 
CakePHP the yum & yuck
CakePHP the yum & yuckCakePHP the yum & yuck
CakePHP the yum & yuck
 
Owasp top 10
Owasp top 10Owasp top 10
Owasp top 10
 
Simple search with elastic search
Simple search with elastic searchSimple search with elastic search
Simple search with elastic search
 
Intro to continuous integration
Intro to continuous integration Intro to continuous integration
Intro to continuous integration
 
Evented applications with RabbitMQ and CakePHP
Evented applications with RabbitMQ and CakePHPEvented applications with RabbitMQ and CakePHP
Evented applications with RabbitMQ and CakePHP
 
PHPunit and you
PHPunit and youPHPunit and you
PHPunit and you
 

Dernier

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
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
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 

Dernier (20)

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
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...
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 

Making the most of 2.2

  • 1. MAKING THE MOST OF 2.2 MARK STORY @MARK_STORY
  • 2. PACKING IN THE GOOD 2.0.0 was release October 18, 2011 Since then 2.1, 2.2, and 2.3 have been released or started. Over 20 releases since 2.0.0. Highest release velocity ever for CakePHP.
  • 3. FOCUS ON PROBLEMS We've tried to keep releases focused on solving real world problems developers have everyday. Make upgrading as easy as possible.
  • 4. VIEW BLOCKS PROBLEM Multiple similar views would often contain repeated structural HTML. Apps suffered from element-itis to keep HTML DRY. Piles of elements make code hard to follow and understand.
  • 5. Inspired by blocks in Jinja/Twig. Allows you to create slots/blocks in layouts or parent templates. Helps keep views/layouts more DRY by letting you create extensible HTML content. Replaces annoying magic variables like $ c i t _ o _ a o t srpsfrlyu and $ o t n _ o _ a o t cnetfrlyu.
  • 6. EXAMPLE Parent wrapper view with a child view
  • 7. PARENT VIEW <1cas"otn-il"<=$hs>ec(tte) ?<h> h ls=cnettte>? ti-fth'il'; >/1 <i cas"otn" dv ls=cnet> <=$hs>ec(cnet) ? ? ti-fth'otn'; > <dv /i> <i cas"iea" dv ls=sdbr> <=$hs>ec(sdbr) ? ? ti-fth'iea'; > <dv /i> <ppi (ti-fth'aiain):? ?h f $hs>ec(pgnto') > <i cas"aiain> dv ls=pgnto" <=$hs>ec(pgnto';? ? ti-fth'aiain) > <dv /i> <ppedf ? ?h ni; >
  • 8. CHILD VIEW <pp$hs>xed'.cmo/iea.t';? ?h ti-etn(./omnsdbrcp) > <pp$hs>sin'il' 'rdc ls';? ?h ti-asg(tte, Pout it) > <pp$hs>tr(cnet) ? ?h ti-sat'otn'; > <>hsi tecnet/> pTi s h otn<p <pp$hs>n(;? ?h ti-ed) > <pp$hs>tr(sdbr) ? ?h ti-sat'iea'; > <>hsi asdbr/> pTi s iea<p <pp$hs>n(;? ?h ti-ed) >
  • 9. JSON & XML VIEWS PROBLEM Previously creating JSON and XML views that just serialized data was a pain. Tons of repetitive views and layout files required.
  • 10. Two view classes that allow you to easily serialize data for simple uses. Special _ e i l z view variable defines which view variables sraie should be serialized. You can also use normal view files if you need to massage data first. Integrates well with existing features like exception handling and RequestHandlerComponent.
  • 11. EXAMPLE <pp ?h / I acnrle. / n otolr fnto idx){ ucin ne( $hs>e(tss,$hs>aiae); ti-st'ak' ti-pgnt() $hs>e(_eilz' ary'ak') ti-st'sraie, ra(tss); }
  • 12. HASH CLASS PROBLEM S t full of inconsistencies. Both in the API and path selector e is syntax. Set::extract() while powerful, is slow and insane inside. xpath-ish syntax full of un-fixable bugs and not supported in most methods.
  • 13. Hash implements >90% of Set's API. All methods have a consistent signature. The same dot notation features are supported everywhere. Up to 1.6x faster on extract(). Most methods are faster as well.
  • 14. PERFORMANCE COMPARISONS Do a similar operation 1000 times, on the same data.
  • 15. Hs:etat$,'n.ril.d) ah:xrc(d {}Atcei' 0.215131998 St:xrc(/ril/d,$) e:etat'Atcei' d 0.23719382 1.1x improvement
  • 16. H s : e t a t $ , ' n . o m n . n . d ) 0.173635005 ah:xrc(d {}Cmet{}i' St:xrc(/omn/d,$) e:etat'Cmeti' d 0.201920986 1.1x improvement
  • 17. Hs:mxiesos$) ah:aDmnin(d 0.075587987 St:onDm$,tu) e:cuti(d re 0.575523138 7.6x improvement
  • 18. API CONSISTENCY Every method takes an array of data as the first argument. Second argument is always one or more paths. A consistent API is easier to document, understand and remember.
  • 19. CAKETIME & CAKENUMBER PROBLEM T m H l e , N m e H l e and T x H l e have some very ieepr ubrepr etepr useful methods. But they are all trapped in a helper.
  • 20. Expose non HTML related features as a utility library. Greatly improve timezone handling. New features for testing & working with datetimes.
  • 21. EXAMPLE <pp ?h Ap:ss'aeie,'tlt'; p:ue(CkTm' Uiiy) Ap:ss'aeubr,'tlt'; p:ue(CkNme' Uiiy) $t =CkTm:tSre(dttm,'mrc/oot'; uc aeie:oevr$aeie AeiaTrno) $oa =CkTm:iTdy$ietm) tdy aeie:soa(tmsap; $eut=CkNme:tRaalSz(oeeaye; rsl aeubr:oedbeie$nTrbt)
  • 22. LOGGING++ PROBLEM Granular logging based on application section was impossible. Log messages were simply broadcast to every connected logger.
  • 23. Borrowed idea of logging 'scopes' from python's l g i g o g n module. Log messages can be tagged with scopes. Only loggers interested in those scopes will get scoped messages.
  • 24. ATTACH A LOGGER WITH A SCOPE <pp ?h CkLg:ofg'amns,ary aeo:cni(pyet' ra( 'nie = 'mi' egn' > Eal 'cps = ary'amns,'iln', soe' > ra(pyet' blig) 'o = 'akeapecm t' > mr@xml.o' ); )
  • 25. LOG MESSAGES WITH A SCOPE <pp ?h ty{ r $aea-poes$amn) gtwy>rcs(pyet; }cth(amnEcpin$){ ac Pyetxeto e CkLg:ro( aeo:err 'rnato fie '.$-gtesg(, Tascin ald e>eMsae) ary'amns,'iln' ra(pyet' blig) ); }