CakePHP - The Path to 2.0

2,355 views

Published on

Slides form my talk on Wednesday 9th March 2011 at Confoo.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,355
On SlideShare
0
From Embeds
0
Number of Embeds
839
Actions
Shares
0
Downloads
25
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • startTest and endTest are deprecated- > now use setUp() and tearDown()\n\n
  • startTest and endTest are deprecated- > now use setUp() and tearDown()\n\n
  • startTest and endTest are deprecated- > now use setUp() and tearDown()\n\n
  • startTest and endTest are deprecated- > now use setUp() and tearDown()\n\n
  • startTest and endTest are deprecated- > now use setUp() and tearDown()\n\n
  • startTest and endTest are deprecated- > now use setUp() and tearDown()\n\n
  • startTest and endTest are deprecated- > now use setUp() and tearDown()\n\n
  • \n
  • Sane-ified\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • No.\nWell, you are free to grab a clone of the repository\nBut we’re not committing to a release date, theres so much to do!\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • CakePHP - The Path to 2.0

    1. 1. Schedule Change Using the new PostreSQL 9.0 Cancelled Now: CakePHP: The path to 2.0
    2. 2. Re-imagining CakePHP The path to CakePHP 2.0
    3. 3. Graham Weldon@predominantgraham.weldon@cakedc.comhttp://cakedc.comhttp://grahamweldon.com
    4. 4. Kawasaki Ninja
    5. 5. Arduino
    6. 6. Games
    7. 7. Captain Jack
    8. 8. CakePHP Community
    9. 9. MotivationsLove CakePHPHate doing repetitive codeLove to teach
    10. 10. ... its been a year
    11. 11. ... its been a year We talked about CakePHP 2.0 at CakeMatsuri in 2009
    12. 12. ... its been a year We talked about CakePHP 2.0 at CakeMatsuri in 2009 Instead of releasing CakePHP 2.0 that “just works” with PHP5
    13. 13. ... its been a year We talked about CakePHP 2.0 at CakeMatsuri in 2009 Instead of releasing CakePHP 2.0 that “just works” with PHP5 Refactoring the core
    14. 14. ... its been a year We talked about CakePHP 2.0 at CakeMatsuri in 2009 Instead of releasing CakePHP 2.0 that “just works” with PHP5 Refactoring the core Exciting changes instead of a quick fix
    15. 15. ... its been a year We talked about CakePHP 2.0 at CakeMatsuri in 2009 Instead of releasing CakePHP 2.0 that “just works” with PHP5 Refactoring the core Exciting changes instead of a quick fix Look at code that has been around for 4+ years
    16. 16. ... its been a year We talked about CakePHP 2.0 at CakeMatsuri in 2009 Instead of releasing CakePHP 2.0 that “just works” with PHP5 Refactoring the core Exciting changes instead of a quick fix Look at code that has been around for 4+ years Remove a lot of code thats no longer needed
    17. 17. Challenges
    18. 18. ChallengesRetain older users and backwardscompatibility
    19. 19. ChallengesRetain older users and backwardscompatibilityMove forward and adopt new features
    20. 20. ChallengesRetain older users and backwardscompatibilityMove forward and adopt new featuresStay true to the projects goals and ideals
    21. 21. ChallengesRetain older users and backwardscompatibilityMove forward and adopt new featuresStay true to the projects goals and idealsRattle some cages
    22. 22. ChallengesRetain older users and backwardscompatibilityMove forward and adopt new featuresStay true to the projects goals and idealsRattle some cages... not too many.
    23. 23. PHPSupport Adios PHP 4
    24. 24. [ Pause pourapplaudissements] [ Pause for clapping ]
    25. 25. PHP Support
    26. 26. PHP SupportDropping PHP 4 support
    27. 27. PHP SupportDropping PHP 4 support
    28. 28. PHP SupportDropping PHP 4 supportSupporting PHP 5.2.6 and above
    29. 29. PHP SupportDropping PHP 4 supportSupporting PHP 5.2.6 and above Later.. PHP 5.3 and above
    30. 30. Err.. PHP 5.2 is Dead
    31. 31. Err.. PHP 5.2 is DeadUsers / community are more important thanadopting latest technology
    32. 32. Err.. PHP 5.2 is Dead “Be mindful of the future, butnot at the expense of the moment.”
    33. 33. Err.. PHP 5.2 is Dead
    34. 34. Err.. PHP 5.2 is DeadPush forward where we can, but retain theusers.
    35. 35. Carefully balanced
    36. 36. Carefully balanced Current Code
    37. 37. Carefully balanced Deprecate AddRemove Dream Current Code
    38. 38. Carefully balanced Deprecate AddRemove Dream Current Code Current Code
    39. 39. Carefully balanced Deprecate AddRemove Dream Current Code Current Code Current Code
    40. 40. Carefully balanced Deprecate AddRemove Dream Current Code Current Code Current Code Current Code
    41. 41. Don’t move too fast AddRemove
    42. 42. Don’t move too fast AddRemove Migration?!
    43. 43. Shortcuts
    44. 44. ShortcutsRemoved: file_put_contents()e() => echo uses() => Appa() => array array_combine()aa() => assoc array cache() => Cacher() => str_replace array_diff_key()ife() => if / ternary array_intersect_key()params() http_build_query()up() => strtoupperlow() => strtolower PHP5 constant
    45. 45. Shortcuts
    46. 46. ShortcutsRemoved:getMicrotime()r() => str_replace$TIME_START
    47. 47. Unit TestingOut with the SimpleTest In with the PHPUnit
    48. 48. Unit Testing
    49. 49. Unit TestingArguably one of the bigger changes
    50. 50. Unit TestingArguably one of the bigger changesPHPUnit
    51. 51. Unit TestingArguably one of the bigger changesPHPUnit Provides better PHP 5 support over SimpleTest
    52. 52. Unit TestingArguably one of the bigger changesPHPUnit Provides better PHP 5 support over SimpleTest More actively maintained
    53. 53. Unit TestingArguably one of the bigger changesPHPUnit Provides better PHP 5 support over SimpleTest More actively maintained Easily integrated with CruiseControl
    54. 54. Unit TestingArguably one of the bigger changesPHPUnit Provides better PHP 5 support over SimpleTest More actively maintained Easily integrated with CruiseControl De-facto standard for Unit Testing in PHP
    55. 55. Unit TestingArguably one of the bigger changesPHPUnit Provides better PHP 5 support over SimpleTest More actively maintained Easily integrated with CruiseControl De-facto standard for Unit Testing in PHPInstall with PEAR
    56. 56. Unit TestingArguably one of the bigger changesPHPUnit Provides better PHP 5 support over SimpleTest More actively maintained Easily integrated with CruiseControl De-facto standard for Unit Testing in PHPInstall with PEARFaster
    57. 57. Unit Testing
    58. 58. Unit TestingMore powerful
    59. 59. Unit TestingMore powerfulMore awesome
    60. 60. Unit TestingMore powerfulMore awesomeMore...
    61. 61. Unit TestingMore powerfulMore awesomeMore...
    62. 62. Unit TestingMore powerfulMore awesomeMore...More info?
    63. 63. Unit TestingMore powerfulMore awesomeMore...More info? http://phpunit.de
    64. 64. Unit Testing
    65. 65. Unit TestingPHPUnit, at what cost?
    66. 66. Unit TestingPHPUnit, at what cost?Rewritten test suite from the ground up
    67. 67. Unit TestingPHPUnit, at what cost?Rewritten test suite from the ground upMocks are different.. but awesome++
    68. 68. Unit TestingPHPUnit, at what cost?Rewritten test suite from the ground upMocks are different.. but awesome++startTest() and endTest() deprecated
    69. 69. Unit TestingPHPUnit, at what cost?Rewritten test suite from the ground upMocks are different.. but awesome++startTest() and endTest() deprecatedassertions slightly different
    70. 70. Unit TestingPHPUnit, at what cost?Rewritten test suite from the ground upMocks are different.. but awesome++startTest() and endTest() deprecatedassertions slightly different.. thats about it.
    71. 71. Unit TestingNo more group tests But theres a PHP Unit way to achieve this
    72. 72. Collections Organising
    73. 73. CollectionsBehaviorsComponentsHelpersShells
    74. 74. Components
    75. 75. Components
    76. 76. Components
    77. 77. ComponentsWhat does this mean in the scheme ofthings?
    78. 78. ComponentsWhat does this mean in the scheme ofthings?We’ve standardised the manner in whichobjects inherit
    79. 79. ComponentsWhat does this mean in the scheme ofthings?We’ve standardised the manner in whichobjects inheritMakes more sense
    80. 80. ComponentsWhat does this mean in the scheme ofthings?We’ve standardised the manner in whichobjects inheritMakes more senseIntuitive
    81. 81. ComponentsWhat does this mean in the scheme ofthings?We’ve standardised the manner in whichobjects inheritMakes more senseIntuitiveLess need to search documentation
    82. 82. SPLReplacing what we can
    83. 83. SPLStandard PHP LibraryProvides awesome File and FolderoperationsClasses handy for a whole range of thingsNo need to re-implement in the coreCakePHP 1.x was ahead of its timePHP has caught upTime to cut the fat
    84. 84. Non-SPLAgain, don’t reinvent the wheelRemoving duplicate code like JSONencodingCan now rely on this functionality shippingwith PHP
    85. 85. Exceptions
    86. 86. ExceptionsUsing exceptions to indicate errors in thecoreEasier to controlMore “OO”Removing cakeError
    87. 87. RequestResponseRefactoring, centralising.
    88. 88. Request / Response Request represents an incoming request It replaces functionality through Controller, Dispatcher, RequestHandler and $this- >params everywhere ArrayAccess implementation for backwards compatibility
    89. 89. Request / Response Protect users form themselves Protect developers from users Protect developers from stupidity Encapsulate both the request and response in order to provide a central location to handle requests and responses, but retain flexibility
    90. 90. Sessions
    91. 91. SessionsRemove duplicated code (DRY)Shouldn’t be always included (1.3 fix)Modelise data handlingAccess anywhereAllow simple customisationSeparate Caching, Database, etc.
    92. 92. Sessions
    93. 93. Sessions SessionHandlerDatabase Cache PHP
    94. 94. Sessions SessionHandlerDatabase Cache PHP
    95. 95. Sessions SessionHandlerDatabase Cache PHP Your Crazy Engine
    96. 96. Sessions SessionHandlerDatabase Cache PHP Cake Session Your Crazy Engine Handler Interface
    97. 97. Hang on! That looks familiar
    98. 98. Javascript (v1.3) JavascriptHelperjQuery Prototype Mootools
    99. 99. Javascript (v1.3) JavascriptHelperjQuery Prototype Mootools
    100. 100. Javascript (v1.3) JavascriptHelperjQuery Prototype Mootools Your Super Engine
    101. 101. Javascript (v1.3) JavascriptHelperjQuery Prototype Mootools Your Super Engine JsBaseEngineHelper
    102. 102. LazyLoading
    103. 103. Lazy LoadingNested Objects (some of them) Components Helpers TasksCheap Optimisation
    104. 104. XMLMaking it make sense!
    105. 105. XML
    106. 106. XMLAs much as one can make XML make sense..
    107. 107. XMLAs much as one can make XML make sense.... we’re doing it
    108. 108. XMLAs much as one can make XML make sense.... we’re doing it1.x was very CakePHP specific with XML
    109. 109. XMLAs much as one can make XML make sense.... we’re doing it1.x was very CakePHP specific with XMLWasn’t handy for integration
    110. 110. XMLAs much as one can make XML make sense.... we’re doing it1.x was very CakePHP specific with XMLWasn’t handy for integrationDidn’t handle namespaces well
    111. 111. XMLAs much as one can make XML make sense.... we’re doing it1.x was very CakePHP specific with XMLWasn’t handy for integrationDidn’t handle namespaces wellDidn’t allow for ordered nodes
    112. 112. XMLAs much as one can make XML make sense.... we’re doing it1.x was very CakePHP specific with XMLWasn’t handy for integrationDidn’t handle namespaces wellDidn’t allow for ordered nodes
    113. 113. XMLAs much as one can make XML make sense.... we’re doing it1.x was very CakePHP specific with XMLWasn’t handy for integrationDidn’t handle namespaces wellDidn’t allow for ordered nodesBuild on top of SimpleXML
    114. 114. XMLAs much as one can make XML make sense.... we’re doing it1.x was very CakePHP specific with XMLWasn’t handy for integrationDidn’t handle namespaces wellDidn’t allow for ordered nodesBuild on top of SimpleXMLFaster
    115. 115. ConsoleThe shell is more popularthan we initially planned
    116. 116. Console
    117. 117. ConsoleEasier help generation
    118. 118. ConsoleEasier help generation Better for users of plugins, as well as plugin developers
    119. 119. ConsoleEasier help generation Better for users of plugins, as well as plugin developersColourised console text
    120. 120. ConsoleEasier help generation Better for users of plugins, as well as plugin developersColourised console text Easy identification of issues and errors
    121. 121. ConsoleEasier help generation Better for users of plugins, as well as plugin developersColourised console text Easy identification of issues and errorsSupport output verbosity
    122. 122. ConsoleEasier help generation Better for users of plugins, as well as plugin developersColourised console text Easy identification of issues and errorsSupport output verbosityShells are being used:
    123. 123. ConsoleEasier help generation Better for users of plugins, as well as plugin developersColourised console text Easy identification of issues and errorsSupport output verbosityShells are being used: restructure: app/console/
    124. 124. ConsoleEasier help generation Better for users of plugins, as well as plugin developersColourised console text Easy identification of issues and errorsSupport output verbosityShells are being used: restructure: app/console/ Moved from: app/vendors/
    125. 125. ConsoleEasier help generation Better for users of plugins, as well as plugin developersColourised console text Easy identification of issues and errorsSupport output verbosityShells are being used: restructure: app/console/ Moved from: app/vendors/Enable better console path configurability
    126. 126. ViewsEnabling more control for plugins, and reordering
    127. 127. ViewsCallbacks changedAs the framework matured: People built new plugins Plugins need control Want to alter outputOrder of operation changed
    128. 128. Viewsevaluate scriptsevaluate contentbeforeLayout()beforeRender()render()
    129. 129. ViewsbeforeLayout()beforeRender()evaluate scriptsevaluate contentrender()
    130. 130. EmailEmail from anywhere! Its the future!
    131. 131. Email
    132. 132. EmailUsed to be restricted to Controller use witha Component
    133. 133. EmailUsed to be restricted to Controller use witha Component ... or a terrible hack to enable it elsewhere
    134. 134. EmailUsed to be restricted to Controller use witha Component ... or a terrible hack to enable it elsewhereNow its a core lib
    135. 135. EmailUsed to be restricted to Controller use witha Component ... or a terrible hack to enable it elsewhereNow its a core libUse it anywhere
    136. 136. EmailUsed to be restricted to Controller use witha Component ... or a terrible hack to enable it elsewhereNow its a core libUse it anywhereWrappers to provide model / controller use
    137. 137. EmailUsed to be restricted to Controller use witha Component ... or a terrible hack to enable it elsewhereNow its a core libUse it anywhereWrappers to provide model / controller useSimple, and effective
    138. 138. New Features
    139. 139. PDOIts about time!!
    140. 140. PDOYes, dear God yes!PDO datasources now available in 2.0Working with Microsoft to get MSSQLsupport finalised with new PDO drivers
    141. 141. Rewriting URLsSimplifying request data
    142. 142. Rewriting URLs
    143. 143. Rewriting URLsPreviously:
    144. 144. Rewriting URLsPreviously: /index.php?url=controller/action/data
    145. 145. Rewriting URLsPreviously: /index.php?url=controller/action/dataNow:
    146. 146. Rewriting URLsPreviously: /index.php?url=controller/action/dataNow: /index.php/controller/action/data
    147. 147. Rewriting URLsPreviously: /index.php?url=controller/action/dataNow: /index.php/controller/action/data
    148. 148. Rewriting URLsPreviously: /index.php?url=controller/action/dataNow: /index.php/controller/action/dataWhat does that mean for developers?
    149. 149. Rewriting URLs
    150. 150. Rewriting URLsSimplifies internal structure for rewriting
    151. 151. Rewriting URLsSimplifies internal structure for rewritingEasier cross-server operation
    152. 152. Rewriting URLsSimplifies internal structure for rewritingEasier cross-server operation Various rewriting mechanisms
    153. 153. Rewriting URLsSimplifies internal structure for rewritingEasier cross-server operation Various rewriting mechanisms Non-apache installs
    154. 154. Named ParamsNow allows arrays to be passedEven allows nested arrays
    155. 155. Named Params
    156. 156. Auth
    157. 157. Authentication
    158. 158. AuthenticationCompletely refactored
    159. 159. AuthenticationCompletely refactoredNo longer automatically hashes allpasswords
    160. 160. AuthenticationCompletely refactoredNo longer automatically hashes allpasswordsAuthentication handlers
    161. 161. AuthenticationCompletely refactoredNo longer automatically hashes allpasswordsAuthentication handlersCustom authentication objects
    162. 162. AuthenticationCompletely refactoredNo longer automatically hashes allpasswordsAuthentication handlersCustom authentication objectsManually login a user
    163. 163. AuthenticationCompletely refactoredNo longer automatically hashes allpasswordsAuthentication handlersCustom authentication objectsManually login a userBasic Authentication
    164. 164. AuthenticationCompletely refactoredNo longer automatically hashes allpasswordsAuthentication handlersCustom authentication objectsManually login a userBasic AuthenticationDigest Authentication
    165. 165. AuthenticationCompletely refactoredNo longer automatically hashes allpasswordsAuthentication handlersCustom authentication objectsManually login a userBasic AuthenticationDigest AuthenticationStateless Authentication
    166. 166. AuthenticationCompletely refactoredNo longer automatically hashes allpasswordsAuthentication handlersCustom authentication objectsManually login a userBasic AuthenticationDigest AuthenticationStateless AuthenticationFull details:
    167. 167. DebuggingYou’ve been waiting for this one... at least, we have.
    168. 168. DebuggingNo more HTML output in console debuggingUses Ascii blocks to distinguish itself
    169. 169. Full Details
    170. 170. Full DetailsLighthouse app
    171. 171. Full DetailsLighthouse apphttp://cakephp.lighthouseapp.com/projects/42648-cakephp
    172. 172. Gettingfeedback
    173. 173. I can has?
    174. 174. CakePHP Release Cycle
    175. 175. Dev
    176. 176. DevAlpha
    177. 177. DevAlphaBeta
    178. 178. ReleaseDev Candidate #1AlphaBeta
    179. 179. ReleaseDev Candidate #1 ReleaseAlpha Candidate #2Beta
    180. 180. ReleaseDev Candidate #1 ReleaseAlpha Candidate #2 ReleaseBeta Candidate #3
    181. 181. ReleaseDev Candidate Stable #1 ReleaseAlpha Candidate #2 ReleaseBeta Candidate #3
    182. 182. ReleaseDev Candidate Stable #1 Release PatchesAlpha Candidate #2 Patches Patches ReleaseBeta Candidate ... #3
    183. 183. ReleaseDev Candidate Stable #1 Release PatchesAlpha Candidate #2 Patches Patches ReleaseBeta Candidate ... #3
    184. 184. Grab the codehttp://cakephp.orghttp://github.com/cakephp/cakephp Branch: 2.0
    185. 185. Questions?Comments?Free hugs?Slides will be available here:http://www.slideshare.net/predominant
    186. 186. Graham Weldon@predominantgraham.weldon@cakedc.comhttp://cakedc.comhttp://grahamweldon.com

    ×