index.html 123 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>The Drupal blocks system from Drop.org to Drupal 8</title>
  6. <meta name="description" content="Presentation given on DrupalCon Prague 2013">
  7. <meta name="author" content="Frederic G. Marand" />
  8. <meta name="apple-mobile-web-app-capable" content="yes" />
  9. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  11. <link rel="stylesheet" href="css/reveal.min.css">
  12. <link rel="stylesheet" href="css/theme/osi.css" id="theme">
  13. <!-- For syntax highlighting -->
  14. <link rel="stylesheet" href="lib/css/zenburn.css" />
  15. <!-- If the query includes 'print-pdf', use the PDF print sheet -->
  16. <script>
  17. document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
  18. </script>
  19. <!--[if lt IE 9]>
  20. <script src="lib/js/html5shiv.js"></script>
  21. <![endif]-->
  22. </head>
  23. <body>
  24. <div class="reveal">
  25. <!-- Any section element inside of this container is displayed as a slide -->
  26. <div class="slides">
  27. <section data-background="images/background-prague.png">
  28. <h1 class="custom inverse">The Drupal blocks system</h1>
  29. <h2 class="custom inverse">from drop.org to Drupal 8</h2>
  30. <p class="custom inverse name">by <a href="https://twitter.com/OSInet">Frédéric G. Marand</a> aka <a href="http://drupal.org/user/27985">fgm</a> / <a href="http://www.osinet.fr">OSInet</a>
  31. </p>
  32. <img src="images/logo-prague.png" class="cover-img" style="height: 250px; margin-top: 0.8em;">
  33. </section>
  34. <!--
  35. <section>
  36. <img src="osinet.png" class="cover-img" style="height: 150px;" />
  37. <div class="cover-osi">
  38. <h3>The Drupal blocks system from drop.org to Drupal 8</h3>
  39. <p>by Frédéric G. Marand (fgm)</p>
  40. </div>fi
  41. </section>
  42. -->
  43. <section>
  44. <h2>Once upon a time...</h2>
  45. <blockquote class="downer">“First we start making a slashdot.org alike site: a community weblog that offers all you need to know”</blockquote>
  46. <p class="right"><small>docs/mission.php, circa 2000-03</small></p>
  47. </section>
  48. <section>
  49. <section>
  50. <h2>Drupal – <span class="lowercase">LoC</span> vs time</h2>
  51. <div class="diagramme" style="position: relative;">
  52. <img src="images/codesize-1.png" alt="code-1998-2014" />
  53. <img src="images/codesize-1-legende.png" alt="code-1998-2014" style="position: absolute; top: 25px; left: 250px; width: 150px;" />
  54. </div>
  55. </section>
  56. <section class="full">
  57. <div class="diagramme-full" style="position: relative;">
  58. <img src="images/codesize-1.png" alt="code-1998-2014" />
  59. <img src="images/codesize-1-legende.png" alt="code-1998-2014" style="position: absolute; top: 30px; left: 180px; width: 170px;" />
  60. </div>
  61. <p class="caption">Drupal – LoC vs time</p>
  62. </section>
  63. </section>
  64. <section>
  65. <section>
  66. <h2>PHP code in Drupal</h2>
  67. <div class="diagramme"><img src="images/codesize-filter-2.png" alt="php-1998-2014"></div>
  68. </section>
  69. <section class="full">
  70. <div class="diagramme-full"><img src="images/codesize-filter-2.png" alt="php-1998-2014"></div>
  71. <p class="caption">PHP code in Drupal</p>
  72. </section>
  73. </section>
  74. <section>
  75. <section>
  76. <h2>CSS code in Drupal</h2>
  77. <div class="diagramme"><img src="images/codesize-filter-3.png" alt="css-1998-2014"></div>
  78. </section>
  79. <section class="full">
  80. <div class="diagramme-full"><img src="images/codesize-filter-3.png" alt="css-1998-2014"></div>
  81. <p class="caption">CSS code in Drupal</p>
  82. </section>
  83. </section>
  84. <section>
  85. <section>
  86. <h2>JavaScript code in Drupal</h2>
  87. <div class="diagramme"><img src="images/codesize-filter-4.png" alt="css-1998-2014"></div>
  88. </section>
  89. <section class="full">
  90. <div class="diagramme-full"><img src="images/codesize-filter-4.png" alt="css-1998-2014"></div>
  91. <p class="caption">JavaScript code in Drupal</p>
  92. </section>
  93. </section>
  94. <section>
  95. <h1 class="chapter">drop.org</h1>
  96. <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;" />
  97. </section>
  98. <section>
  99. <section>
  100. <h2>drop.org – what's a block, really ?</h2>
  101. <blockquote class="downer">Every single “box” on the website can be themed: not only the colors but the entire look-and-feel and position.</blockquote>
  102. <p class="right"><small>docs/features.php, circa 2000-03</small></p>
  103. </section>
  104. <section>
  105. <h3>drop.org – what's a block, really ?</h3>
  106. <blockquote class="right downer" style="float: left; width: 25%;"><span class="quote-underline">Boxes:</span></blockquote>
  107. <blockquote class="left downer" style="float: right; width: 70%;">
  108. Box for latest headlines.<br />
  109. Box for older headlines.<br />
  110. Box for related links.<br />
  111. Box with login form.<br />
  112. User-defined box.<br />
  113. </blockquote>
  114. <p class="right"><small>docs/features.php, circa 2000-03</small></p>
  115. </section>
  116. <section>
  117. <h3>drop.org – what's a block, really ?</h3>
  118. <blockquote class="right downer" style="float: left; width: 25%;"><span class="quote-underline">Theme support:</span></blockquote>
  119. <blockquote class="left downer" style="float: right; width: 70%;">
  120. Not only can you change the colors, you can also change the position of most boxes and such.
  121. </blockquote>
  122. <p class="right"><small>docs/features.php, circa 2000-03</small></p>
  123. </section>
  124. </section>
  125. <section>
  126. <section>
  127. <h2>drop.org – page cycle</h2>
  128. <p class="left">No front controller, controller = PHP file</p>
  129. <ul class="left">
  130. <li><code>index.php, faq.php, article.php, ...</code></li>
  131. <li>uses GET query string, notably op for action variation</li>
  132. <li><code>register_globals = on</code> required</li>
  133. <li>dedicated back-office : <code>admin.php</code>
  134. </li>
  135. </ul>
  136. </section>
  137. <section>
  138. <h3>drop.org – page cycle</h3>
  139. <p class="left">Controller
  140. </p>
  141. <ul class="left">
  142. <li>loads shared functions, configuration
  143. </li>
  144. <li><code>$theme->header()</code>
  145. </li>
  146. <li>if action variants exists, switch <code>($op)
  147. </code>
  148. <ul>
  149. <li>adds content base on <code>$op</code>,</li>
  150. <li>e.g., <code>$theme->article()</code>, others build HTML inline</li>
  151. <li><code>article()</code>, <code>box()</code> , <code>comment()</code>, <code>abstract()</code>,
  152. </li>
  153. </ul></li>
  154. <li><code>footer()</code>, <code>header()</code>, <code>preview()</code></li>
  155. <li><code>$theme->footer()</code></li>
  156. </ul>
  157. </section>
  158. </section>
  159. <section>
  160. <section>
  161. <h2>drop.org – block placement</h2>
  162. <ul class="left">
  163. <li>No block placement UI</li>
  164. <li>Theme methods decide which blocks they will display in their predefined <code>header</code> et <code>footer</code> elements.</li>
  165. <li><code>themes/Dries/theme.class</code>
  166. <code class="codeblock">
  167. function footer() { /* ..snip.. */<br />
  168. &nbsp;&nbsp;global $PHP_SELF;<br />
  169. &nbsp;&nbsp;if (strstr($PHP_SELF, "index.php")) {<br />
  170. &nbsp;&nbsp;&nbsp;&nbsp;global $user;<br />
  171. &nbsp;&nbsp;&nbsp;&nbsp;displayAccount($this);
  172. </code></li>
  173. <li>Predefined function invoke <code>$theme->box($subject, $content)</code></li>
  174. </ul>
  175. </section>
  176. <section>
  177. <h3>drop.org – block placement</h3>
  178. <ul class="left">
  179. <li><code>functions.inc</code>
  180. <code class="codeblock">
  181. function displayAccount($theme) {<br />
  182. &nbsp;&nbsp;global $user, $cookie;<br />
  183. &nbsp;&nbsp;if ($user) {<br />
  184. &nbsp;&nbsp;&nbsp;&nbsp;### Display userblock if any:<br />
  185. &nbsp;&nbsp;&nbsp;&nbsp;displayUserblock();<br />
  186. &nbsp;&nbsp;}<br />
  187. &nbsp;&nbsp;else {<br />
  188. &nbsp;&nbsp;&nbsp;&nbsp;$content = "&lt;CENTER&gt;&lt;FORM METHOD=\"post\" ACTION=\"account.php\"&gt;\n
  189. &lt;P&gt;Username:&lt;BR&gt;&lt;INPUT TYPE=\"text\" NAME=\"uname\" MAXLENGTH=\"50\"SIZE=\"12\"&gt;&lt;/P&gt;\n
  190. &lt;P&gt;Password:&lt;BR&gt; &lt;INPUT TYPE=\"password\" NAME=\"pass\"MAXLENGTH=\"25\" SIZE=\"12\"&gt;&lt;/P&gt;\n
  191. &lt;INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Login\"&gt;\n&lt;/FORM&gt;\n&lt;P&gt;&lt;A HREF=\"account.php\"&gt;
  192. Register&lt;/A&gt; as new user.&lt;BR&gt;&lt;A HREF=\"account.php\"&gt;Forgot&lt;/A&gt; your password?&lt;/P&gt;
  193. &lt;/CENTER&gt;";<br />
  194. &nbsp;&nbsp;&nbsp;&nbsp;<span class="high">$theme-&gt;box("Login", $content);</span><br />
  195. &nbsp;&nbsp;}<br />
  196. }</code></li>
  197. </ul>
  198. </section>
  199. </section>
  200. <section>
  201. <section>
  202. <h2>drop.org : box theme</h2>
  203. <ul class="left">
  204. <li><code>themes/Natrak/theme.class</code> <span class="highlight">Themes are PHP classes</span>
  205. <code class="codeblock">
  206. ######<br />
  207. # Syntax.......: box($title, $body);<br />
  208. # Description..: a function to draw a box/block.<br />
  209. function box($subject, $content) {<br />
  210. &nbsp;&nbsp;include "config.inc";<br />
  211. &nbsp;&nbsp;print "&lt;TABLE BORDER=\"0\" CELLPADDING=\"3\" CELLSPACING=\"3\" WIDTH=\"100%\"&gt;";<br />
  212. &nbsp;&nbsp;print " &lt;TR&gt;&lt;TD ALIGN=\"center\" BGCOLOR=\"$this-&gt;bgcolor1\" WIDTH=\"100%\"&gt;&lt;FONT COLOR=\"$this-&gt;fgcolor1\"&gt;&lt;B&gt;$subject&lt;/B&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;";<br />
  213. &nbsp;&nbsp;print " &lt;TR&gt;&lt;TD BGCOLOR=\"$this-&gt;bgcolor2\"&gt;$content&lt;/TD&gt;&lt;/TR&gt;";<br />
  214. &nbsp;&nbsp;print "&lt;/TABLE&gt;&lt;BR&gt;";<br />
  215. }
  216. </code></li>
  217. </ul>
  218. </section>
  219. <section>
  220. <h3>drop.org : box theme</h3>
  221. <ul class="left">
  222. <li><code>themes/Natrak/theme.php</code> <span class="highlight">Just not only...</span>
  223. <code class="codeblock">
  224. function themebox($subject, $content) {<br />
  225. &nbsp;&nbsp;global $bgcolor1, $bgcolor2, $bgcolor3;<br />
  226. &nbsp;&nbsp;include "config.inc";<br />
  227. &nbsp;&nbsp;print "&lt;TABLE BORDER=\"0\" CELLPADDING=\"3\" CELLSPACING=\"3\" WIDTH=\"100%\"&gt;";<br />
  228. &nbsp;&nbsp;print " &lt;TR&gt;&lt;TD ALIGN=\"center\" BGCOLOR=\"$bgcolor1\"&gt;&lt;FONT COLOR=\"$bgcolor2\"&gt;&lt;B&gt;$subject&lt;/B&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;";<br />
  229. &nbsp;&nbsp;print " &lt;TR&gt;&lt;TD BGCOLOR=\"$bgcolor2\"&gt;$content&lt;/TD&gt;&lt;/TR&gt;";<br />
  230. &nbsp;&nbsp;print "&lt;/TABLE&gt;&lt;BR&gt;";<br />
  231. }</code></li>
  232. <li><code>webboard.php</code> uses the function format, other controllers invoke the method format.</li>
  233. </ul>
  234. </section>
  235. </section>
  236. <section>
  237. <section>
  238. <h2>drop.org – article page</h2>
  239. <div class="illustration"><img src="images/drop1-article-dries.png" alt="Article page" /></div>
  240. </section>
  241. </section>
  242. <section>
  243. <section>
  244. <h2>drop.org – ab -n10000 -c10 (home)</h2>
  245. <code class="left ab">
  246. <table>
  247. <tr>
  248. <td>Concurrency Level:</td>
  249. <td>10</td>
  250. </tr>
  251. <tr>
  252. <td>Time taken for tests:</td>
  253. <td>9.821 seconds</td>
  254. </tr>
  255. <tr>
  256. <td>Complete requests:</td>
  257. <td>10000</td>
  258. </tr>
  259. <tr>
  260. <td>Total transferred:</td>
  261. <td>93350000 bytes</td>
  262. </tr>
  263. <tr>
  264. <td>HTML transferred:</td>
  265. <td>90880000 bytes</td>
  266. </tr>
  267. <tr class="high">
  268. <td>Requests per second:</td>
  269. <td>1018.24 [#/sec] (mean)</td>
  270. </tr>
  271. <tr class="high">
  272. <td>Time per request:</td>
  273. <td>9.821 [ms] (mean)</td>
  274. </tr>
  275. <tr class="high">
  276. <td>Time per request:</td>
  277. <td>0.982 [ms] (mean, across all concurrent requests)</td>
  278. </tr>
  279. <tr>
  280. <td>Transfer rate:</td>
  281. <td>9282.49 [Kbytes/sec] received</td>
  282. </tr>
  283. </table>
  284. <table>
  285. <tr>
  286. <td colspan="2">Connection Times (ms)</td>
  287. </tr>
  288. <tr>
  289. <td>&nbsp;</td>
  290. <td>min&nbsp;</td>
  291. <td>mean&nbsp;</td>
  292. <td>[+/-sd]&nbsp;</td>
  293. <td>median&nbsp;</td>
  294. <td>max&nbsp;</td>
  295. </tr>
  296. <tr>
  297. <td>Connect:</td>
  298. <td>0</td>
  299. <td>0</td>
  300. <td>0.1</td>
  301. <td>0</td>
  302. <td>2</td>
  303. </tr>
  304. <tr>
  305. <td>Processing:</td>
  306. <td>2</td>
  307. <td>10</td>
  308. <td>4.0</td>
  309. <td>9</td>
  310. <td>62</td>
  311. </tr>
  312. <tr>
  313. <td>Waiting:</td>
  314. <td>1</td>
  315. <td>9</td>
  316. <td>3.8</td>
  317. <td>9</td>
  318. <td>61</td>
  319. </tr>
  320. <tr>
  321. <td>Total:</td>
  322. <td>2</td>
  323. <td>10</td>
  324. <td>4.0</td>
  325. <td>9</td>
  326. <td>62</td>
  327. </tr>
  328. </table>
  329. </code>
  330. </section>
  331. </section>
  332. <section>
  333. <section>
  334. <h2>drop.org – default theme</h2>
  335. <div class="illustration"><img src="images/drop1-refer.png" alt="Theme example"></div>
  336. </section>
  337. </section>
  338. <section>
  339. <h1 class="chapter">Drupal 1</h1>
  340. <p class="release-date">15/01/2001</p>
  341. <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;" />
  342. </section>
  343. <section>
  344. <section>
  345. <h2>Drupal 1.0</h2>
  346. <ul class="left">
  347. <li><code>module</code>, <code>hook</code> and <code>weight</code> are born
  348. <ul>
  349. <li>Explicit hook naming
  350. <code class="codeblock">$module = array("help" => "<span class="high">box</span>_help",<br />
  351. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"block" => "box_block",<br />
  352. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"admin" => "box_admin");</code></li>
  353. <li>Hook registry, called <code>repository</code></li>
  354. <li>7 hooks : <code>admin <span class="high">block</span> cron export help page user</code></li>
  355. </ul>
  356. </li>
  357. </ul>
  358. </section>
  359. <section>
  360. <h3>Drupal 1.0</h3>
  361. <ul class="left">
  362. <li>Birth of the <code class="high">block</code> module
  363. <ul>
  364. <li>Separation : block vs custom block vs box</li>
  365. <li>Birth of regions, <code>header</code> and <code>footer</code> remain separate.</li>
  366. <li>User selection of optional blocks</li>
  367. </ul>
  368. </li>
  369. <li>“Classical” Drupal file layout:
  370. <ul>
  371. <li><code>includes/</code>, <code>modules/</code>, <code>scripts/</code>, <code>themes/</code></li>
  372. <li>New : <code>.htaccess</code> and <code>robots.txt</code></li>
  373. </ul>
  374. </li>
  375. </ul>
  376. </section>
  377. </section>
  378. <section>
  379. <section>
  380. <h2>Drupal 1 – block_help()</h2>
  381. <blockquote class="quote-small">
  382. <ul>
  383. <li><b><span class="high">Blocks</span> are the <span class="high">boxes</span> visible in the side bars on the left and the right-hand side of the website.</b></li>
  384. <li>They are either exported by the engine or by any of the available modules. […]</li>
  385. <li>The placement of blocks is delegated to the administrator but for most blocks, i.e. those called “<span class="high">custom blocks</span>”, the sole force behind enabling and disabling them is the user itself.</li>
  386. <li>An administrator can lay out and arrange the available blocks to fit in <span class="high">two regions: “left” and “right”</span>. Regions simply contain blocks. In addition, an administrator can assign each block (within a region) a <span class="high">weight</span> to sort them vertically. [...]</li>
  387. <li>As mentioned above, blocks can be arranged to fit in two regions: left and right. For theme builders, each region is identified by a corresponding constant: “<span class="high">left</span>” and “<span class="high">right</span>”.</li>
  388. </ul>
  389. </blockquote>
  390. <p class="right"><small>admin.php?mod=block&op=help</small></p>
  391. </section>
  392. <section>
  393. <h3>Drupal 1 – block_help()</h3>
  394. <blockquote class="quote-small">
  395. <ul>
  396. <li>[...] Simply put, boxes are small bits of text, HTML or PHP code which will get plugged into the site just like any other block. Boxes are typically used to add <span class="high">custom blocks</span> to the site.</li>
  397. <li>Each box consists of a <span class="high">subject</span> and an associated block of text, HTML or PHP code which can be as long as you want it to be and that will “<span class="high">render</span>” the <span class="high">content</span> of the box.</li>
  398. </ul>
  399. </blockquote>
  400. <p class="right"><small>admin.php?mod=block&op=help</small></p>
  401. <p>... but <code>Theme::box()</code> still exists !</p>
  402. </section>
  403. </section>
  404. <section>
  405. <h2>Drupal 1 – page cycle</h2>
  406. <ul class="left">
  407. <li>No front controller, but <code>module.php?mod=..</code></li>
  408. <li>Controller
  409. <ul>
  410. <li>loads shared functions from <code>common.inc</code>
  411. <ul>
  412. <li>configuration: <code>getenv("HTTP_HOST") .".conf";</code></li>
  413. <li>theme: <code>$theme = load_theme();</code></li>
  414. </ul>
  415. </li>
  416. <li>defines its action functions</li>
  417. <li>if variants exist, <code>switch ($op)</code>
  418. <ul>
  419. <li>invoke action functions based on <code>$op</code></li>
  420. </ul>
  421. </li>
  422. <li>action function
  423. <ul>
  424. <li>prepares its data</li>
  425. <li>requests view build from the theme:
  426. <ul>
  427. <li><code>$theme->header();</code></li>
  428. <li>multiple calls to <code>$theme->box()</code> on prepared data (account.php)
  429. – or less clean formatting... (search.php)</li>
  430. <li><code>$theme->footer();</code></li>
  431. </ul>
  432. </li>
  433. </ul>
  434. </li>
  435. </ul>
  436. </li>
  437. </ul>
  438. </section>
  439. <section>
  440. <section>
  441. <h2>Drupal 1 – block placement</h2>
  442. <ul>
  443. <li>The block admin UI offers a choice of 3 layouts:
  444. <ul>
  445. <li>Left + Content</li>
  446. <li>Left + Content + Right</li>
  447. <li>Content + Right</li>
  448. </ul>
  449. </li>
  450. <li>Administrator decides which custom blocks to display in the <code>left</code> et <code>right</code> regions</li>
  451. <li><code>Theme::header()</code> and <code>Theme::footer()</code> decide separately which blocks they will display in <code>header</code> and <code>footer</code>, which are not regions</li>
  452. <li>Layouts are theme-independent</li>
  453. <li>The blocks table does not keep per-theme info</li>
  454. </ul>
  455. </section>
  456. </section>
  457. <section>
  458. <section>
  459. <h2>Drupal 1 – block overview</h2>
  460. <div class="illustration"><img src="images/drupal1-block-overview.png" alt="Drupal 1 Block override"></div>
  461. </section>
  462. </section>
  463. <section>
  464. <section>
  465. <h2>Drupal 1: block hook</h2>
  466. <ul>
  467. <li>A single block hook: <code>hook_block()</code> returns a hash of:
  468. <ul>
  469. <li>Subject: displayed title</li>
  470. <li>Content: raw content, HTML, or PHP for <code>eval()</code></li>
  471. <li>Info: administrative title</li>
  472. <li>Link: URL, only displayed on the b.o.</li>
  473. </ul>
  474. </li>
  475. <li>Used both for administration and display</li>
  476. </ul>
  477. </section>
  478. <section>
  479. <h3>Drupal 1: block hook</h3>
  480. <ul>
  481. <li>Example : box.module<br />
  482. <code class="codeblock">function box_block() {<br />
  483. &nbsp;&nbsp;$result = db_query("SELECT * FROM boxes");<br />
  484. &nbsp;&nbsp;$i = 0;<br />
  485. &nbsp;&nbsp;while ($block = db_fetch_object($result)) {<br />
  486. &nbsp;&nbsp;&nbsp;&nbsp;$blocks[$i]["subject"] = check_output($block->subject);<br />
  487. &nbsp;&nbsp;&nbsp;&nbsp;$blocks[$i]["content"] = ($block->type == 2)
  488. <br />
  489. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;? eval($block->content)<br />
  490. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: check_output($block->content, ($block->type == 1) ? 0 : 1);<br />
  491. &nbsp;&nbsp;&nbsp;&nbsp;$blocks[$i]["info"] = check_output($block->info);<br />
  492. &nbsp;&nbsp;&nbsp;&nbsp;$blocks[$i]["link"] = check_output($block->link);<br />
  493. &nbsp;&nbsp;&nbsp;&nbsp;$i++;<br />
  494. &nbsp;&nbsp;}<br />
  495. &nbsp;&nbsp;return $blocks;<br />
  496. }</code>
  497. </li>
  498. </ul>
  499. </section>
  500. </section>
  501. <section>
  502. <section>
  503. <h2>Drupal 1: box theme</h2>
  504. <ul>
  505. <li><code><b>themes/marvin/marvin.theme</b></code><br /><span class="highlight">Themes are still PHP classes, but not located in &lt;theme&gt;.theme</span><br />
  506. <code class="codeblock">
  507. function box($subject, $content) { ?><br />
  508. &nbsp;&nbsp;&lt;TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" BGCOLOR="&lt;? echo $this->brcolor1; ?&gt;" WIDTH="100%"&gt;<br />
  509. &nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;&lt;TD&gt;&lt;?<br />
  510. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print "&lt;TABLE BORDER=\"0\" CELLPADDING=\"3\" CELLSPACING=\"1\"
  511. WIDTH=\"100%\"&gt;";<br />
  512. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print " &lt;TR&gt;&lt;TD ALIGN=\"center\" BGCOLOR=\"$this-&gt;bgcolor1\"
  513. NOWRAP&gt;&lt;FONT COLOR=\"$this-&gt;fgcolor1\"&gt;&lt;B><span class="high">$subject</span>&lt;/B&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;";
  514. <br />
  515. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print " &lt;TR&gt;&lt;TD BGCOLOR=\"$this-&gt;bgcolor2\"&gt;<span class="high">$content</span>&lt;/TD&gt;&lt;/TR&gt;";<br />
  516. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print "&lt;/TABLE&gt;";<br />
  517. &nbsp;&nbsp;&nbsp;&nbsp;?&gt;<br />
  518. &nbsp;&nbsp;&nbsp;&nbsp;&lt;/TD&gt;&lt;/TR&gt;<br />
  519. &nbsp;&nbsp;&lt;/TABLE&gt;&lt;BR&gt;&lt;?<br />
  520. }</code>
  521. </li>
  522. <li>No longer any non-class theme functions</li>
  523. </ul>
  524. </section>
  525. </section>
  526. <section>
  527. <section>
  528. <h2>Drupal 1 – ab -n10000 -c10 (home)</h2>
  529. <code class="left ab">
  530. <table>
  531. <tr>
  532. <td>Concurrency Level:</td>
  533. <td>10</td>
  534. </tr>
  535. <tr>
  536. <td>Time taken for tests:</td>
  537. <td>6.388 seconds</td>
  538. </tr>
  539. <tr>
  540. <td>Complete requests:</td>
  541. <td>10000</td>
  542. </tr>
  543. <tr>
  544. <td>Total transferred:</td>
  545. <td>49950000 bytes</td>
  546. </tr>
  547. <tr>
  548. <td>HTML transferred:</td>
  549. <td>45530000 bytes</td>
  550. </tr>
  551. <tr class="high">
  552. <td>Requests per second:</td>
  553. <td>1565.36 [#/sec] (mean)</td>
  554. </tr>
  555. <tr class="high">
  556. <td>Time per request:</td>
  557. <td>6.388 [ms] (mean)</td>
  558. </tr>
  559. <tr class="high">
  560. <td>Time per request:</td>
  561. <td>0.639 [ms] (mean, across all concurrent requests)</td>
  562. </tr>
  563. <tr>
  564. <td>Transfer rate:</td>
  565. <td>7635.70 [Kbytes/sec] received</td>
  566. </tr>
  567. </tr>
  568. </table>
  569. <table>
  570. <tr>
  571. <td colspan="2">Connection Times (ms)</td>
  572. </tr>
  573. <tr>
  574. <td>&nbsp;</td>
  575. <td>min&nbsp;</td>
  576. <td>mean&nbsp;</td>
  577. <td>[+/-sd]&nbsp;</td>
  578. <td>median&nbsp;</td>
  579. <td>max&nbsp;</td>
  580. </tr>
  581. <tr>
  582. <td>Connect:</td>
  583. <td>0</td>
  584. <td>0</td>
  585. <td>0.1</td>
  586. <td>0</td>
  587. <td>4</td>
  588. </tr>
  589. <tr>
  590. <td>Processing:</td>
  591. <td>2</td>
  592. <td>6</td>
  593. <td>2.8</td>
  594. <td>6</td>
  595. <td>33</td>
  596. </tr>
  597. <tr>
  598. <td>Waiting:</td>
  599. <td>2</td>
  600. <td>6</td>
  601. <td>2.8</td>
  602. <td>6</td>
  603. <td>33</td>
  604. </tr>
  605. <tr>
  606. <td>Total:</td>
  607. <td>2</td>
  608. <td>6</td>
  609. <td>2.8</td>
  610. <td>6</td>
  611. <td>33</td>
  612. </tr>
  613. </table>
  614. </code>
  615. </section>
  616. </section>
  617. <section>
  618. <section>
  619. <h2>Drupal 1 – <span class="lowercase">UnConeD</span> theme</h2>
  620. <p class="theme-name"><span class="lowercase">UnConeD</span></p>
  621. <div class="illustration"><img src="images/drupal1-account-site.png" alt="Drupal 1 Block override"></div>
  622. </section>
  623. </section>
  624. <section>
  625. <h1 class="chapter">Drupal 2</h1>
  626. <p class="release-date">15/03/2001 (2 months later)</p>
  627. <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;">
  628. </section>
  629. <section>
  630. <section>
  631. <h2>Drupal 2.0</h2>
  632. <ul>
  633. <li>Filtering of <span class="high">box</span> content climbs from the “model” to the controller
  634. <ul>
  635. <li>Filtering of <span class="high">block</span> is still on the “model”</li>
  636. </ul>
  637. </li>
  638. <li><span class="high">Block</span> <code>subject</code> is now translatable</li>
  639. </ul>
  640. </section>
  641. <section>
  642. <h3>Drupal 2.0</h3>
  643. <ul>
  644. <li>No significant changes on block/box
  645. <ul>
  646. <li>File Layout: birth of <code>misc/</code></li>
  647. <li>PHP “short tags” are dropped</li>
  648. <li>First dash of blue: pre-Druplicon “drop” in UnConeD turns blue</li>
  649. <li><code>Theme::abstract()</code> → <code>Theme::story()</code></li>
  650. <li><code>class Story extends Node {...}</code></li>
  651. <table class="new">
  652. <tr>
  653. <th rowspan="3">Newborns</th>
  654. <td>Locale</td>
  655. </tr>
  656. <tr>
  657. <td>First update script, only SQL</td>
  658. </tr>
  659. <tr>
  660. <td>CHANGELOG, CREDITS</td>
  661. </tr>
  662. </table>
  663. <table class="new">
  664. <tr>
  665. <th rowspan="2">Changes</th>
  666. <td>Comment, section, user ratings, permissions</td>
  667. </tr>
  668. <tr>
  669. <td>First optional module: submission</td>
  670. </tr>
  671. </table>
  672. </ul>
  673. </li>
  674. </ul>
  675. </section>
  676. </section>
  677. <section>
  678. <section>
  679. <h2>Drupal 2 – ab -n10000 -c10 (home)</h2>
  680. <code class="left ab">
  681. <table>
  682. <tr>
  683. <td>Concurrency Level:</td>
  684. <td>10</td>
  685. </tr>
  686. <tr>
  687. <td>Time taken for tests:</td>
  688. <td>8.921 seconds</td>
  689. </tr>
  690. <tr>
  691. <td>Complete requests:</td>
  692. <td>10000</td>
  693. </tr>
  694. <tr>
  695. <td>Total transferred:</td>
  696. <td>63570000 bytes</td>
  697. </tr>
  698. <tr>
  699. <td>HTML transferred:</td>
  700. <td>59190000 bytes</td>
  701. </tr>
  702. <tr class="high">
  703. <td>Requests per second:</td>
  704. <td>1120.93 [#/sec] (mean)</td>
  705. </tr>
  706. <tr class="high">
  707. <td>Time per request:</td>
  708. <td>8.921 [ms] (mean)</td>
  709. </tr>
  710. <tr class="high">
  711. <td>Time per request:</td>
  712. <td>0.892 [ms] (mean, across all concurrent requests)</td>
  713. </tr>
  714. <tr>
  715. <td>Transfer rate:</td>
  716. <td>6958.77 [Kbytes/sec] received</td>
  717. </tr>
  718. </table>
  719. <table>
  720. <tr>
  721. <td colspan="2">Connection Times (ms)</td>
  722. </tr>
  723. <tr>
  724. <td>&nbsp;</td>
  725. <td>min&nbsp;</td>
  726. <td>mean&nbsp;</td>
  727. <td>[+/-sd]&nbsp;</td>
  728. <td>median&nbsp;</td>
  729. <td>max&nbsp;</td>
  730. </tr>
  731. <tr>
  732. <td>Connect:</td>
  733. <td>0</td>
  734. <td>0</td>
  735. <td>0.1</td>
  736. <td>0</td>
  737. <td>4</td>
  738. </tr>
  739. <tr>
  740. <td>Processing:</td>
  741. <td>2</td>
  742. <td>9</td>
  743. <td>3.5</td>
  744. <td>8</td>
  745. <td>32</td>
  746. </tr>
  747. <tr>
  748. <td>Waiting:</td>
  749. <td>2</td>
  750. <td>9</td>
  751. <td>3.5</td>
  752. <td>8</td>
  753. <td>32</td>
  754. </tr>
  755. <tr>
  756. <td>Total:</td>
  757. <td>2</td>
  758. <td>9</td>
  759. <td>3.5</td>
  760. <td>8</td>
  761. <td>32</td>
  762. </tr>
  763. </table>
  764. </code>
  765. </section>
  766. </section>
  767. <section>
  768. <section>
  769. <h2>Drupal 2 – <span class="lowercase">UnConeD</span> theme</h2>
  770. <p class="theme-name"><span class="lowercase">UnConeD</span></p>
  771. <div class="illustration"><img src="images/drupal2-diary.png" alt="Drupal 1 Block override"></div>
  772. </section>
  773. </section>
  774. <section>
  775. <h1 class="chapter">Drupal 3</h1>
  776. <p class="release-date">26/11/2001 (8 months later)</p>
  777. <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;">
  778. </section>
  779. <section>
  780. <section>
  781. <h2>Drupal 3.0.2</h2>
  782. <ul>
  783. <li><span class="high">Blocks</span> created by modules...
  784. <ul>
  785. <li>can now be disabled, optional, or required</li>
  786. <li>...just like <span class="high">boxes</span></li>
  787. <li>and appear in the regions preview</li>
  788. </ul>
  789. </li>
  790. <li>No significant changes for block/box
  791. <table class="new">
  792. <tr>
  793. <th rowspan="2">Newborns</th>
  794. <td>Node, file, (page) cache, <code>form_*()</code></td>
  795. </tr>
  796. <tr>
  797. <td>Front: fluid themes: Goofy, Jeroen, Yaroon, raw: Stone Age</td>
  798. </tr>
  799. </table>
  800. <table class="new">
  801. <tr class="tr-first">
  802. <th rowspan="5">Changes</th>
  803. <td>Hooks : <code>global $repository</code> → <code>function_exists()</code></td>
  804. </tr>
  805. <tr>
  806. <td>Druplicon looking straight ahead replaces the drop</td>
  807. </tr>
  808. <tr>
  809. <td>Section → meta and introduces hierarchy</td>
  810. </tr>
  811. <tr>
  812. <td>Faq → book and introduces hierarchy</td>
  813. </tr>
  814. <tr>
  815. <td>&lt;font&gt; HTML element: 74 → 14</td>
  816. </tr>
  817. </table>
  818. </li>
  819. </ul>
  820. </section>
  821. </section>
  822. <section>
  823. <section>
  824. <h2>Drupal 3 – blocks configuration</h2>
  825. <div class="illustration downer"><img src="images/drupal3-blocks-configure.png" alt="Drupal 3 Block configuration 1"></div>
  826. </section>
  827. <section>
  828. <h3>Drupal 3 – blocks configuration</h3>
  829. <div class="illustration"><img src="images/drupal3-blocks-preview.png" alt="Drupal 3 Block configuration 2"></div>
  830. </section>
  831. <section>
  832. <h3>Drupal 3 – blocks configuration</h3>
  833. <div class="illustration"><img src="images/drupal3-blocks-optional.png" alt="Drupal 3 Block configuration 3"></div>
  834. </section>
  835. </section>
  836. <section>
  837. <section>
  838. <h2>Drupal 3.0.2 – box theme</h2>
  839. <ul>
  840. <li>Default theme:
  841. <code class="codeblock">
  842. class Theme extends BaseTheme { /* ..snip.. */<br />
  843. &nbsp;&nbsp;function box($subject, $content, $region = "main") { ?&gt;<br />
  844. &nbsp;&nbsp;&nbsp;&nbsp;&lt;TABLE&gt;<br />
  845. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;<br />
  846. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD&gt;<br />
  847. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DIV ALIGN="center"&gt;<br />
  848. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;BIG&gt;&lt;? echo $subject; ?&gt;&lt;/BIG&gt;<br />
  849. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/DIV&gt;<br />
  850. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;HR&gt;<br />
  851. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TD&gt;<br />
  852. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<br />
  853. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;<br />
  854. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD&gt;<br />
  855. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php echo $content; ?&gt;<br />
  856. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TD&gt;<br />
  857. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<br />
  858. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TABLE&gt;<br />
  859. &nbsp;&nbsp;&nbsp;&nbsp;&lt;BR&gt;&lt;?php<br />
  860. &nbsp;&nbsp;} // close box function<br />
  861. }<br />
  862. </code>
  863. </li>
  864. </ul>
  865. </section>
  866. <section>
  867. <h3>Drupal 3.0.2 – box theme</h3>
  868. <ul>
  869. <li>And the base theme class...
  870. <code class="codeblock">
  871. class BaseTheme {/<br />
  872. &nbsp;&nbsp;function links(...) {...}<br />
  873. &nbsp;&nbsp;function image($name) {}<br />
  874. &nbsp;&nbsp;function comment_controls(...) {}<br />
  875. }<br />
  876. </code>
  877. </li>
  878. </ul>
  879. </section>
  880. </section>
  881. <section>
  882. <section>
  883. <h2>Drupal 3 – ab -n10000 -c10 (home)</h2>
  884. <code class="left ab">
  885. <table>
  886. <tr>
  887. <td>Concurrency Level:</td>
  888. <td>10</td>
  889. </tr>
  890. <tr>
  891. <td>Time taken for tests:</td>
  892. <td>13.971 seconds</td>
  893. </tr>
  894. <tr>
  895. <td>Complete requests:</td>
  896. <td>10000</td>
  897. </tr>
  898. <tr>
  899. <td>Total transferred:</td>
  900. <td>47793825 bytes</td>
  901. </tr>
  902. <tr>
  903. <td>HTML transferred:</td>
  904. <td>43413825 bytes</td>
  905. </tr>
  906. <tr class="high">
  907. <td>Requests per second:</td>
  908. <td>715.75 [#/sec] (mean)</td>
  909. </tr>
  910. <tr class="high">
  911. <td>Time per request:</td>
  912. <td>13.971 [ms] (mean)</td>
  913. </tr>
  914. <tr class="high">
  915. <td>Time per request:</td>
  916. <td>1.397 [ms] (mean, across all concurrent requests)</td>
  917. </tr>
  918. <tr>
  919. <td>Transfer rate:</td>
  920. <td>3340.65 [Kbytes/sec] received</td>
  921. </tr>
  922. </table>
  923. <table>
  924. <tr>
  925. <td colspan="2">Connection Times (ms)</td>
  926. </tr>
  927. <tr>
  928. <td>&nbsp;</td>
  929. <td>min&nbsp;</td>
  930. <td>mean&nbsp;</td>
  931. <td>[+/-sd]&nbsp;</td>
  932. <td>median&nbsp;</td>
  933. <td>max&nbsp;</td>
  934. </tr>
  935. <tr>
  936. <td>Connect:</td>
  937. <td>0</td>
  938. <td>0</td>
  939. <td>0.1</td>
  940. <td>0</td>
  941. <td>5</td>
  942. </tr>
  943. <tr>
  944. <td>Processing:</td>
  945. <td>4</td>
  946. <td>14</td>
  947. <td>4.6</td>
  948. <td>13</td>
  949. <td>44</td>
  950. </tr>
  951. <tr>
  952. <td>Waiting:</td>
  953. <td>4</td>
  954. <td>14</td>
  955. <td>4.6</td>
  956. <td>13</td>
  957. <td>44</td>
  958. </tr>
  959. <tr>
  960. <td>Total:</td>
  961. <td>4</td>
  962. <td>14</td>
  963. <td>4.6</td>
  964. <td>13</td>
  965. <td>44</td>
  966. </tr>
  967. </table>
  968. </code>
  969. </section>
  970. </section>
  971. <section>
  972. <section>
  973. <h2>Drupal 3 – new themes</h2>
  974. <p class="theme-name">Goofy</p>
  975. <div class="illustration"><img src="images/drupal3-goofy.png" alt="Drupal 3 Goofy theme"></div>
  976. </section>
  977. <section>
  978. <h3>Drupal 3 – new themes</h3>
  979. <p class="theme-name">Jeroen</p>
  980. <div class="illustration"><img src="images/drupal3-jeroen.png" alt="Drupal 3 Jeroen theme"></div>
  981. </section>
  982. <section>
  983. <h3>Drupal 3 – new themes</h3>
  984. <p class="theme-name">Stoneage</p>
  985. <div class="illustration"><img src="images/drupal3-stoneage.png" alt="Drupal 3 Stoneage theme"></div>
  986. </section>
  987. <section>
  988. <h3>Drupal 3 – new themes</h3>
  989. <p class="theme-name">Yaroon</p>
  990. <div class="illustration"><img src="images/drupal3-yaroon.png" alt="Drupal 3 Yaroon theme"></div>
  991. </section>
  992. </section>
  993. <section>
  994. <h1 class="chapter">Drupal 4</h1>
  995. <p class="release-date">08/12/2002 (12 months later)</p>
  996. <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;">
  997. </section>
  998. <section>
  999. <section>
  1000. <h2>Drupal 4.0</h2>
  1001. <ul>
  1002. <li><span class="high">block</span>/<span class="high">box</span> admin merge, box module removed</li>
  1003. <li>Placement defined by <span class="high">block</span>, stores <code>region</code>/<code>weight</code>
  1004. <ul>
  1005. <li>Administrator-configured</li>
  1006. <li>Automatic fallback from nonexistent region (left/right) to the other one</li>
  1007. <li>Visibility defined by <span class="high">block</span>, path column (regex), vs themes/controllers</li>
  1008. </ul>
  1009. </li>
  1010. <li>Content is defined by <span class="high">box</span>, with a choice of ASCII / HTML / PHP format</li>
  1011. <li><code>BaseTheme::box()</code> provide a default <span class="high">box</span> theme implementation</li>
  1012. </ul>
  1013. </section>
  1014. <section>
  1015. <h3>Drupal 4.0</h3>
  1016. <ul>
  1017. <li>And elsewhere...
  1018. <table class="new">
  1019. <tr>
  1020. <th rowspan="3">Newborns</th>
  1021. <td>Default theme == Basic</td>
  1022. </tr>
  1023. <tr>
  1024. <td>Node form switched to two columns, FO / BO forms differ</td>
  1025. </tr>
  1026. <tr>
  1027. <td>XML-RPC, Useful Inc. version</td>
  1028. </tr>
  1029. </table>
  1030. <table class="new">
  1031. <tr class="tr-first">
  1032. <th rowspan="6">Changes</th>
  1033. <td>Meta/section/category → taxonomy/vocabulary/term</td>
  1034. </tr>
  1035. <tr>
  1036. <td>Input format per node, in the extra table for each content type</td>
  1037. </tr>
  1038. <tr>
  1039. <td>Front page is customized with PHP <code>eval</code></td>
  1040. </tr>
  1041. <tr>
  1042. <td>More modules converted to generic module.php controller, but not all</td>
  1043. </tr>
  1044. <tr>
  1045. <td>DB API based on PEAR:DB, supports PostgreSQL, SQL dump includes update</td>
  1046. </tr>
  1047. <tr>
  1048. <td>Withdrawn themes: Dries, Jeroen; Stone Age → example</td>
  1049. </tr>
  1050. </table>
  1051. </li>
  1052. </ul>
  1053. </section>
  1054. </section>
  1055. <section>
  1056. <section>
  1057. <h2>Drupal 4.0 – blocks admin/placement</h2>
  1058. <div class="illustration"><img src="images/drupal4-block-admin.png" alt="Drupal 4 Block administration"></div>
  1059. </section>
  1060. <section>
  1061. <h3>Drupal 4.0 – blocks admin/placement</h3>
  1062. <div class="illustration"><img src="images/drupal4-block-preview.png" alt="Drupal 4 Block preview"></div>
  1063. </section>
  1064. <section>
  1065. <h3>Drupal 4.0 – node form FO Basic</h3>
  1066. <div class="illustration"><img src="images/drupal4-default.png" alt="Drupal 4 node form FO"></div>
  1067. </section>
  1068. <section>
  1069. <h3>Drupal 4.0 – node form BO</h3>
  1070. <div class="illustration"><img src="images/drupal4-admin.png" alt="Drupal 4 node form BO"></div>
  1071. </section>
  1072. </section>
  1073. <section>
  1074. <section>
  1075. <h2>Drupal 4 – ab -n10000 -c10 (home)</h2>
  1076. <code class="left ab">
  1077. <table>
  1078. <tr>
  1079. <td>Concurrency Level:</td>
  1080. <td>10</td>
  1081. </tr>
  1082. <tr>
  1083. <td>Time taken for tests:</td>
  1084. <td>32.101 seconds</td>
  1085. </tr>
  1086. <tr>
  1087. <td>Complete requests:</td>
  1088. <td>10000</td>
  1089. </tr>
  1090. <tr>
  1091. <td>Total transferred:</td>
  1092. <td>91560000 bytes</td>
  1093. </tr>
  1094. <tr>
  1095. <td>HTML transferred:</td>
  1096. <td>87140000 bytes</td>
  1097. </tr>
  1098. <tr class="high">
  1099. <td>Requests per second:</td>
  1100. <td>311.52 [#/sec] (mean)</td>
  1101. </tr>
  1102. <tr class="high">
  1103. <td>Time per request:</td>
  1104. <td>32.101 [ms] (mean)</td>
  1105. </tr>
  1106. <tr class="high">
  1107. <td>Time per request:</td>
  1108. <td>3.210 [ms] (mean, across all concurrent requests)</td>
  1109. </tr>
  1110. <tr>
  1111. <td>Transfer rate:</td>
  1112. <td>2785.42 [Kbytes/sec] received</td>
  1113. </tr>
  1114. </table>
  1115. <table>
  1116. <tr>
  1117. <td colspan="2">Connection Times (ms)</td>
  1118. </tr>
  1119. <tr>
  1120. <td>&nbsp;</td>
  1121. <td>min&nbsp;</td>
  1122. <td>mean&nbsp;</td>
  1123. <td>[+/-sd]&nbsp;</td>
  1124. <td>median&nbsp;</td>
  1125. <td>max&nbsp;</td>
  1126. </tr>
  1127. <tr>
  1128. <td>Connect:</td>
  1129. <td>0</td>
  1130. <td>0</td>
  1131. <td>0.1</td>
  1132. <td>0</td>
  1133. <td>3</td>
  1134. </tr>
  1135. <tr>
  1136. <td>Processing:</td>
  1137. <td>9</td>
  1138. <td>32</td>
  1139. <td>11.6</td>
  1140. <td>31</td>
  1141. <td>225</td>
  1142. </tr>
  1143. <tr>
  1144. <td>Waiting:</td>
  1145. <td>9</td>
  1146. <td>32</td>
  1147. <td>11.5</td>
  1148. <td>30</td>
  1149. <td>222</td>
  1150. </tr>
  1151. <tr>
  1152. <td>Total:</td>
  1153. <td>9</td>
  1154. <td>32</td>
  1155. <td>11.6</td>
  1156. <td>31</td>
  1157. <td>225</td>
  1158. </tr>
  1159. </table>
  1160. </code>
  1161. </section>
  1162. </section>
  1163. <section>
  1164. <section>
  1165. <h2>Drupal 4.1</h2>
  1166. <p class="release-date">25/06/2003 (6 months later) *</p>
  1167. <ul>
  1168. <li>Conditional <span class="high">blocks</span> build: only if used</li>
  1169. <li>Customizable blocks selection sorted by <code>module</code>/<code>delta</code>, not by name</li>
  1170. <li>Block <code>name</code> (alias <code>$block->info</code>) withdrawn, meaning...
  1171. <ul>
  1172. <li><code>blocks</code> table no longer has a PK, or even an index</li>
  1173. </ul>
  1174. </li>
  1175. <li>And elsewhere...
  1176. <table class="new">
  1177. <tr>
  1178. <th>Newborns</th>
  1179. <td>Profile</td>
  1180. </tr>
  1181. </table>
  1182. <table class="new">
  1183. <tr class="tr-first">
  1184. <th rowspan="4">Changes</th>
  1185. <td>Markup refactoring in themes with more reusable elements: <code>theme_mark</code>, <code>theme_head</code>, <code>theme_item_list</code>, <code>theme_error</code>...</td>
  1186. </tr>
  1187. </table>
  1188. </li>
  1189. </ul>
  1190. <p class="note">* CHANGELOG claims 15/02/2003, but commits say 25/06/2003</p>
  1191. </section>
  1192. </section>
  1193. <section>
  1194. <section>
  1195. <h2>Drupal 4.1 – user block sorting</h2>
  1196. <div class="illustration"><img src="images/drupal41-block-user.png" alt="Drupal 4 Block sorting"></div>
  1197. </section>
  1198. </section>
  1199. <!-- BLOCK/THEME CODE SLIDE -->
  1200. <section>
  1201. <section>
  1202. <h2>Drupal 4.1 – conditional build</h2>
  1203. <ul>
  1204. <li>Block building in <code>theme_blocks</code> only appears if that have to be displayed: required, default and anonymous user, or user-selected, but only without a path or if patch matches
  1205. <code class="codeblock">
  1206. functiontheme_blocks($region,&$theme){<br />
  1207. &nbsp;&nbsp;global $user, $PHP_SELF;<br />
  1208. &nbsp;&nbsp;$result = db_query("SELECT * FROM blocks WHERE (status = '1' OR custom =
  1209. '1') ". ($region != "all" ? "AND region = '%s' " : "") ."ORDER BY weight, module", $region == "left" ? 0 : 1);<br />
  1210. &nbsp;&nbsp;while ($result && ($block = db_fetch_object($result))) {<br />
  1211. &nbsp;&nbsp;&nbsp;&nbsp;if (<br />
  1212. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;( ($block->status && (!$user->uid || !$block->custom)) || ($block->custom && $user->block[$block->module][$block->delta]))
  1213. <span class="high">&& (!$block->path || preg_match("|$block->path|", $PHP_SELF))</span><br />
  1214. &nbsp;&nbsp;&nbsp;&nbsp;){<br />
  1215. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$block_data = module_invoke($block->module, "block", "view", $block->delta);<br />
  1216. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($block_data["content"]) {<br />
  1217. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$theme->box($block_data["subject"], $block_data["content"], $region);<br />
  1218. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
  1219. &nbsp;&nbsp;&nbsp;&nbsp;}<br />
  1220. &nbsp;&nbsp;}<br />
  1221. }
  1222. </code>
  1223. </li>
  1224. </ul>
  1225. </section>
  1226. </section>
  1227. <section>
  1228. <section>
  1229. <h2>Drupal 4.1 – ab -n10000 -c10 (home)</h2>
  1230. <code class="left ab">
  1231. <table>
  1232. <tr>
  1233. <td>Concurrency Level:</td>
  1234. <td>10</td>
  1235. </tr>
  1236. <tr>
  1237. <td>Time taken for tests:</td>
  1238. <td>15.174 seconds</td>
  1239. </tr>
  1240. <tr>
  1241. <td>Complete requests:</td>
  1242. <td>10000</td>
  1243. </tr>
  1244. <tr>
  1245. <td>Total transferred:</td>
  1246. <td>19590000 bytes</td>
  1247. </tr>
  1248. <tr>
  1249. <td>HTML transferred:</td>
  1250. <td>15170000 bytes</td>
  1251. </tr>
  1252. <tr class="high">
  1253. <td>Requests per second:</td>
  1254. <td>659.03 [#/sec] (mean)</td>
  1255. </tr>
  1256. <tr class="high">
  1257. <td>Time per request:</td>
  1258. <td>15.174 [ms] (mean)</td>
  1259. </tr>
  1260. <tr class="high">
  1261. <td>Time per request:</td>
  1262. <td>1.517 [ms] (mean, across all concurrent requests)</td>
  1263. </tr>
  1264. <tr>
  1265. <td>Transfer rate:</td>
  1266. <td>1260.79 [Kbytes/sec] received</td>
  1267. </tr>
  1268. </tr>
  1269. </table>
  1270. <table>
  1271. <tr>
  1272. <td colspan="2">Connection Times (ms)</td>
  1273. </tr>
  1274. <tr>
  1275. <td>&nbsp;</td>
  1276. <td>min&nbsp;</td>
  1277. <td>mean&nbsp;</td>
  1278. <td>[+/-sd]&nbsp;</td>
  1279. <td>median&nbsp;</td>
  1280. <td>max&nbsp;</td>
  1281. </tr>
  1282. <tr>
  1283. <td>Connect:</td>
  1284. <td>0</td>
  1285. <td>0</td>
  1286. <td>0.1</td>
  1287. <td>0</td>
  1288. <td>5</td>
  1289. </tr>
  1290. <tr>
  1291. <td>Processing:</td>
  1292. <td>5</td>
  1293. <td>15</td>
  1294. <td>4.9</td>
  1295. <td>14</td>
  1296. <td>70</td>
  1297. </tr>
  1298. <tr>
  1299. <td>Waiting:</td>
  1300. <td>5</td>
  1301. <td>15</td>
  1302. <td>4.9</td>
  1303. <td>14</td>
  1304. <td>70</td>
  1305. </tr>
  1306. <tr>
  1307. <td>Total:</td>
  1308. <td>5</td>
  1309. <td>15</td>
  1310. <td>4.9</td>
  1311. <td>14</td>
  1312. <td>70</td>
  1313. </tr>
  1314. </table>
  1315. </code>
  1316. </section>
  1317. </section>
  1318. <section>
  1319. <section>
  1320. <h2>Drupal 4.2</h2>
  1321. <p class="release-date">04/10/2003 (4.5 months later)</p>
  1322. <ul>
  1323. <li><span class="high">hook_block($op)</span> <code>$op = list|view</code></li>
  1324. <li><span class="high">Block</span> <code>delta</code>: int → varchar(32)</li>
  1325. <li>Block preview : “Themes with (right|left)-sidebar only...”</li>
  1326. <li><code>t('messages from block.module code')</code></li>
  1327. <li><code><span class="high">BaseTheme::box()</span></code> receives filtered content, no longer filters it itself</li>
  1328. <li><code><span class="high">BaseTheme::block($subject, $content, $region = 'main')</span></code>
  1329. <ul>
  1330. <li>Simple wrapper for <code>BaseTheme::box()</code></li>
  1331. <li>Separate in Xtemplate, invoked by <code>theme_blocks()</code> instead of <code>theme('box')</code></li>
  1332. </ul>
  1333. </li>
  1334. </ul>
  1335. </section>
  1336. <section>
  1337. <h3>Drupal 4.2</h3>
  1338. <ul>
  1339. <li>And elsewhere...
  1340. <table class="new">
  1341. <tr>
  1342. <th rowspan="5">Newborns</th>
  1343. <td>Support for Microsoft SQL Server</td>
  1344. </tr>
  1345. <tr>
  1346. <td><code>index.php</code> front controller for “normal” paths</td>
  1347. </tr>
  1348. <tr>
  1349. <td>Xtemplate, engine and base theme</td>
  1350. </tr>
  1351. <tr>
  1352. <td><code>theme()</code> replaces <code>theme_invoke()</code></td>
  1353. </tr>
  1354. <tr>
  1355. <td>Only <code>system.module</code> uses <code>$theme->foo()</code>, others use <code>theme('foo')</code></td>
  1356. </tr>
  1357. </table>
  1358. <table class="new">
  1359. <tr>
  1360. <th rowspan="5">Changes</th>
  1361. <td>Clean URLs</td>
  1362. </tr>
  1363. <tr>
  1364. <td>WYSIWYG support (!)</td>
  1365. </tr>
  1366. <tr>
  1367. <td>BO now integrated in the overall UI</td>
  1368. </tr>
  1369. <tr>
  1370. <td>Themes: Goofy withdrawn, blue becomes more prevalent, first CSS fields</td>
  1371. </tr>
  1372. <tr>
  1373. <td><code>register_globals = On</code> no longer needed</td>
  1374. </tr>
  1375. </table>
  1376. </li>
  1377. </ul>
  1378. </section>
  1379. </section>
  1380. <section>
  1381. <section>
  1382. <h2>Drupal 4.2 – block admin</h2>
  1383. <div class="illustration"><img src="images/drupal42-block-admin.png" alt="Drupal 4 Block admin page"></div>
  1384. </section>
  1385. </section>
  1386. <section>
  1387. <section>
  1388. <h2>Drupal 4.2 – BaseTheme::box()</h2>
  1389. <ul>
  1390. <li>Drupal 4.1
  1391. <code class="codeblock">
  1392. function box($subject, $content, $region = "main") {<br />
  1393. &nbsp;&nbsp;$output = "&lt;b&gt;"<br />
  1394. &nbsp;&nbsp;&nbsp;&nbsp;. check_output($subject)<br />
  1395. &nbsp;&nbsp;&nbsp;&nbsp;."&lt;/b&gt;&lt;br /&gt;"<br />
  1396. &nbsp;&nbsp;&nbsp;&nbsp;check_output($content)<br />
  1397. &nbsp;&nbsp;&nbsp;&nbsp;."&lt;p /&gt;";<br />
  1398. &nbsp;&nbsp;print $output;<br />
  1399. }
  1400. </code>
  1401. </li>
  1402. <li>Drupal 4.2
  1403. <code class="codeblock">
  1404. function box($subject, $content, $region = "main") {<br />
  1405. &nbsp;&nbsp;$output = "<p><b>$subject</b><br />$content</p>";<br />
  1406. &nbsp;&nbsp;print $output;<br />
  1407. }<br />
  1408. function block($subject, $content, $region = "main") {<br />
  1409. &nbsp;&nbsp;global $theme;<br />
  1410. &nbsp;&nbsp;$theme->box($subject, $content, $region);<br />
  1411. }
  1412. </code>
  1413. </li>
  1414. </ul>
  1415. </section>
  1416. </section>
  1417. <section>
  1418. <section>
  1419. <h2>Drupal 4.2 – XTemplate</h2>
  1420. <div class="illustration"><img src="images/drupal42-user.png" alt="Drupal 4 XTemplate"></div>
  1421. </section>
  1422. </section>
  1423. <section>
  1424. <section>
  1425. <h2>Drupal 4.2 – ab -n10000 -c10 (home)</h2>
  1426. <code class="left ab">
  1427. <table>
  1428. <tr>
  1429. <td>Concurrency Level:</td>
  1430. <td>10</td>
  1431. </tr>
  1432. <tr>
  1433. <td>Time taken for tests:</td>
  1434. <td>22.128 seconds</td>
  1435. </tr>
  1436. <tr>
  1437. <td>Complete requests:</td>
  1438. <td>10000</td>
  1439. </tr>
  1440. <tr>
  1441. <td>Total transferred:</td>
  1442. <td>41080000 bytes</td>
  1443. </tr>
  1444. <tr>
  1445. <td>HTML transferred:</td>
  1446. <td>36510000 bytes</td>
  1447. </tr>
  1448. <tr class="high">
  1449. <td>Requests per second:</td>
  1450. <td>451.92 [#/sec] (mean)</td>
  1451. </tr>
  1452. <tr class="high">
  1453. <td>Time per request:</td>
  1454. <td>22.128 [ms] (mean)</td>
  1455. </tr>
  1456. <tr class="high">
  1457. <td>Time per request:</td>
  1458. <td>2.213 [ms] (mean, across all concurrent requests)</td>
  1459. </tr>
  1460. <tr>
  1461. <td>Transfer rate:</td>
  1462. <td>1812.97 [Kbytes/sec] received</td>
  1463. </tr>
  1464. </table>
  1465. <table>
  1466. <tr>
  1467. <td colspan="2">Connection Times (ms)</td>
  1468. </tr>
  1469. <tr>
  1470. <td>&nbsp;</td>
  1471. <td>min&nbsp;</td>
  1472. <td>mean&nbsp;</td>
  1473. <td>[+/-sd]&nbsp;</td>
  1474. <td>median&nbsp;</td>
  1475. <td>max&nbsp;</td>
  1476. </tr>
  1477. <tr>
  1478. <td>Connect:</td>
  1479. <td>0</td>
  1480. <td>0</td>
  1481. <td>0.1</td>
  1482. <td>0</td>
  1483. <td>6</td>
  1484. </tr>
  1485. <tr>
  1486. <td>Processing:</td>
  1487. <td>6</td>
  1488. <td>2</td>
  1489. <td>7.6</td>
  1490. <td>21</td>
  1491. <td>154</td>
  1492. </tr>
  1493. <tr>
  1494. <td>Waiting:</td>
  1495. <td>6</td>
  1496. <td>2</td>
  1497. <td>7.6</td>
  1498. <td>21</td>
  1499. <td>154</td>
  1500. </tr>
  1501. <tr>
  1502. <td>Total:</td>
  1503. <td>6</td>
  1504. <td>2</td>
  1505. <td>7.6</td>
  1506. <td>21</td>
  1507. <td>154</td>
  1508. </tr>
  1509. </table>
  1510. </code>
  1511. </section>
  1512. </section>
  1513. <section>
  1514. <section>
  1515. <h2>Drupal 4.3.x</h2>
  1516. <p class="release-date">01/11/2003 (4 weeks later)</p>
  1517. <ul>
  1518. <li>UX: <code>admin/block</code> → <code>admin/system/block</code></li>
  1519. <li>And elsewhere...
  1520. <table class="new">
  1521. <tr>
  1522. <th></th>
  1523. <td>Minor releases 4.3.0, 4.3.1, 4.3.2, 4.3.x unreleased HEAD until 02/2004</td>
  1524. </tr>
  1525. </table>
  1526. <table class="new">
  1527. <tr>
  1528. <th rowspan="2">Newborns</th>
  1529. <td>Alias</td>
  1530. </tr>
  1531. <tr>
  1532. <td>DB prefixing using {}</td>
  1533. </tr>
  1534. </table>
  1535. <table class="new">
  1536. <tr>
  1537. <th rowspan="2">Changes</th>
  1538. <td>User object simplified</td>
  1539. </tr>
  1540. <tr>
  1541. <td>Some controller actions start using <code>return</code> instead of <code>print</code></td>
  1542. </tr>
  1543. </table>
  1544. </li>
  1545. </ul>
  1546. </section>
  1547. <section>
  1548. <h3>Drupal 4.3.x – Nothing</h3>
  1549. <p>That's all for 4.3!</p>
  1550. </section>
  1551. </section>
  1552. <section>
  1553. <section>
  1554. <h2>Drupal 4.3 – ab -n10000 -c10 (home)</h2>
  1555. <code class="left ab">
  1556. <table>
  1557. <tr>
  1558. <td>Concurrency Level:</td>
  1559. <td>10</td>
  1560. </tr>
  1561. <tr>
  1562. <td>Time taken for tests:</td>
  1563. <td>15.036 seconds</td>
  1564. </tr>
  1565. <tr>
  1566. <td>Complete requests:</td>
  1567. <td>10000</td>
  1568. </tr>
  1569. <tr>
  1570. <td>Total transferred:</td>
  1571. <td>39170000 bytes</td>
  1572. </tr>
  1573. <tr>
  1574. <td>HTML transferred:</td>
  1575. <td>34600000 bytes</td>
  1576. </tr>
  1577. <tr class="high">
  1578. <td>Requests per second:</td>
  1579. <td>6665.0659 [#/sec] (mean)</td>
  1580. </tr>
  1581. <tr class="high">
  1582. <td>Time per request:</td>
  1583. <td>15.036 [ms] (mean)</td>
  1584. </tr>
  1585. <tr class="high">
  1586. <td>Time per request:</td>
  1587. <td>1.504 [ms] (mean, across all concurrent requests)</td>
  1588. </tr>
  1589. <tr>
  1590. <td>Transfer rate:</td>
  1591. <td>2543.97 [Kbytes/sec] received</td>
  1592. </tr>
  1593. </table>
  1594. <table>
  1595. <tr>
  1596. <td colspan="2">Connection Times (ms)</td>
  1597. </tr>
  1598. <tr>
  1599. <td>&nbsp;</td>
  1600. <td>min&nbsp;</td>
  1601. <td>mean&nbsp;</td>
  1602. <td>[+/-sd]&nbsp;</td>
  1603. <td>median&nbsp;</td>
  1604. <td>max&nbsp;</td>
  1605. </tr>
  1606. <tr>
  1607. <td>Connect:</td>
  1608. <td>0</td>
  1609. <td>0</td>
  1610. <td>0.1</td>
  1611. <td>0</td>
  1612. <td>3</td>
  1613. </tr>
  1614. <tr>
  1615. <td>Processing:</td>
  1616. <td>5</td>
  1617. <td>15</td>
  1618. <td>4.5</td>
  1619. <td>14</td>
  1620. <td>44</td>
  1621. </tr>
  1622. <tr>
  1623. <td>Waiting:</td>
  1624. <td>5</td>
  1625. <td>15</td>
  1626. <td>4.5</td>
  1627. <td>14</td>
  1628. <td>44</td>
  1629. </tr>
  1630. <tr>
  1631. <td>Total:</td>
  1632. <td>5</td>
  1633. <td>15</td>
  1634. <td>4.5</td>
  1635. <td>14</td>
  1636. <td>44</td>
  1637. </tr>
  1638. </table>
  1639. </code>
  1640. </section>
  1641. </section>
  1642. <section>
  1643. <section>
  1644. <h2>Drupal 4.4.x</h2>
  1645. <p class="release-date">01/04/2004 (2 months later)</p>
  1646. <ul>
  1647. <li><code><span class="high">theme_blocks()</span></code> delegates...
  1648. <ul>
  1649. <li>listing blocks to <code><span class="high">block_list()</span></code> instead of performing the request itself</li>
  1650. <li>rendering to <code><span class="high">theme_block('view')</span></code> instead of invoking <code>hook_block('view')</code></li>
  1651. </ul>
  1652. </li>
  1653. <li><code><span class="high">theme('box')</span></code> no longer implemented except in <code>theme.inc</code> and Xtemplate</li>
  1654. <li>The lack of a PK on blocks is documented as “(bad)!”</li>
  1655. </ul>
  1656. </section>
  1657. <section>
  1658. <h3>Drupal 4.4.x</h3>
  1659. <ul>
  1660. <li>And elsewhere...
  1661. <table class="new">
  1662. <tr>
  1663. <th rowspan="3">Performance</th>
  1664. <td>Generic throttling with <code>throttle.module</code>: deactivation of modules or invididual functions</td>
  1665. </tr>
  1666. <tr>
  1667. <td>Cached pages load less modules</td>
  1668. </tr>
  1669. <tr>
  1670. <td>Locale only caches data below a size limit</td>
  1671. </tr>
  1672. </table>
  1673. <table class="new">
  1674. <tr>
  1675. <th>Newborns</th>
  1676. <td>Pushbutton</td>
  1677. </tr>
  1678. </table>
  1679. <table class="new">
  1680. <tr>
  1681. <th rowspan="2">Changes</th>
  1682. <td>Uniform use of <code>theme()</code>, theme_* functions and use of <code>return</code></td>
  1683. </tr>
  1684. <tr>
  1685. <td>Marvin → Chameleon + subtheme</td>
  1686. </tr>
  1687. </table>
  1688. <table class="new">
  1689. <tr>
  1690. <th rowspan="3">Removals</th>
  1691. <td>Theme classes</td>
  1692. </tr>
  1693. <tr>
  1694. <td>Microsoft SQL Server support</td>
  1695. </tr>
  1696. <tr>
  1697. <td>Goofy</td>
  1698. </tr>
  1699. </table>
  1700. </li>
  1701. </ul>
  1702. </section>
  1703. </section>
  1704. <section>
  1705. <section>
  1706. <h2>Drupal 4.4 – theme_blocks()</h2>
  1707. <ul>
  1708. <li>Drupal 4.3
  1709. <ul>
  1710. <li>cf Drupal 4.1: <code>db_query()</code> + complex test</li>
  1711. </ul>
  1712. </li>
  1713. <li>Drupal 4.4
  1714. <ul>
  1715. <li>delegates to <code>block_list()</code>, <code>theme_block()</code></li>
  1716. </ul>
  1717. <code class="codeblock">
  1718. function theme_blocks($region) {<br />
  1719. &nbsp;&nbsp;$output = '';<br />
  1720. <br />
  1721. &nbsp;&nbsp;if ($list = module_invoke('block', 'list', $region)){<br />
  1722. &nbsp;&nbsp;&nbsp;&nbsp;foreach ($list as $key => $block) {<br />
  1723. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// $key == &lt;i&gt;module&lt;/i&gt;_&lt;i&gt;delta&lt;/i&gt;<br />
  1724. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$output .= theme('block', $block);<br />
  1725. &nbsp;&nbsp;&nbsp;&nbsp;}<br />
  1726. &nbsp;&nbsp;}<br />
  1727. &nbsp;&nbsp;return $output;<br />
  1728. }
  1729. </code>
  1730. </li>
  1731. </ul>
  1732. </section>
  1733. <section>
  1734. <h3>Drupal 4.4 – theme_block()</h3>
  1735. <code class="codeblock left">
  1736. function theme_block($block) {<br />
  1737. &nbsp;&nbsp;$output = "&lt;div class=\"block block-$block->module\"
  1738. id=\"block-$block->module-$block->delta\"&gt;\n";<br />
  1739. &nbsp;&nbsp;$output .= " &lt;h2 class=\"title\"&gt;$block->subject&lt;/h2&gt;\n";<br />
  1740. &nbsp;&nbsp;$output .= " &lt;div class=\"content\"&gt;$block-
  1741. >content&lt;/div&gt;\n";<br />
  1742. &nbsp;&nbsp;$output .= "&lt;/div&gt;\n";<br />
  1743. &nbsp;&nbsp;return $output;<br />
  1744. }
  1745. </code>
  1746. </section>
  1747. </section>
  1748. <section>
  1749. <section>
  1750. <h2>Drupal 4.4 – Chameleon theme</h2>
  1751. <p class="theme-name">Chameleon</p>
  1752. <div class="illustration"><img src="images/drupal44-block-preview.png" alt="Drupal 4 Chameleon theme"></div>
  1753. </section>
  1754. </section>
  1755. <section>
  1756. <section>
  1757. <h2>Drupal 4.4 – ab -n10000 -c10 (home)</h2>
  1758. <code class="left ab">
  1759. <table>
  1760. <tr>
  1761. <td>Concurrency Level:</td>
  1762. <td>10</td>
  1763. </tr>
  1764. <tr>
  1765. <td>Time taken for tests:</td>
  1766. <td>20.207 seconds</td>
  1767. </tr>
  1768. <tr>
  1769. <td>Complete requests:</td>
  1770. <td>10000</td>
  1771. </tr>
  1772. <tr>
  1773. <td>Total transferred:</td>
  1774. <td>34080000 bytes</td>
  1775. </tr>
  1776. <tr>
  1777. <td>HTML transferred:</td>
  1778. <td>29510000 bytes</td>
  1779. </tr>
  1780. <tr class="high">
  1781. <td>Requests per second:</td>
  1782. <td>494.87 [#/sec] (mean)</td>
  1783. </tr>
  1784. <tr class="high">
  1785. <td>Time per request:</td>
  1786. <td>20.207 [ms] (mean)</td>
  1787. </tr>
  1788. <tr class="high">
  1789. <td>Time per request:</td>
  1790. <td>2.021 [ms] (mean, across all concurrent requests)</td>
  1791. </tr>
  1792. <tr>
  1793. <td>Transfer rate:</td>
  1794. <td>1646.99 [Kbytes/sec] received</td>
  1795. </tr>
  1796. </table>
  1797. <table>
  1798. <tr>
  1799. <td colspan="2">Connection Times (ms)</td>
  1800. </tr>
  1801. <tr>
  1802. <td>&nbsp;</td>
  1803. <td>min&nbsp;</td>
  1804. <td>mean&nbsp;</td>
  1805. <td>[+/-sd]&nbsp;</td>
  1806. <td>median&nbsp;</td>
  1807. <td>max&nbsp;</td>
  1808. </tr>
  1809. <tr>
  1810. <td>Connect:</td>
  1811. <td>0</td>
  1812. <td>0</td>
  1813. <td>0.1</td>
  1814. <td>0</td>
  1815. <td>13</td>
  1816. </tr>
  1817. <tr>
  1818. <td>Processing:</td>
  1819. <td>7</td>
  1820. <td>20</td>
  1821. <td>11.5</td>
  1822. <td>19</td>
  1823. <td>445</td>
  1824. </tr>
  1825. <tr>
  1826. <td>Waiting:</td>
  1827. <td>7</td>
  1828. <td>20</td>
  1829. <td>11.4</td>
  1830. <td>19</td>
  1831. <td>434</td>
  1832. </tr>
  1833. <tr>
  1834. <td>Total:</td>
  1835. <td>7</td>
  1836. <td>20</td>
  1837. <td>11.5</td>
  1838. <td>19</td>
  1839. <td>446</td>
  1840. </tr>
  1841. </table>
  1842. </code>
  1843. </section>
  1844. </section>
  1845. <section>
  1846. <section>
  1847. <h2>Drupal 4.5</h2>
  1848. <p class="release-date">18/10/2004 (6 months later)</p>
  1849. <ul>
  1850. <li>New blocks provided by comment, taxonomy</li>
  1851. <li><code><span class="high">theme_(block|blocks|box)</span></code>: no changes</li>
  1852. <li>And elsewhere...
  1853. <table class="new">
  1854. <tr>
  1855. <th></th>
  1856. <td>New menu system with caching, <code>hook_menu($may_cache)</code></td>
  1857. </tr>
  1858. <tr>
  1859. <th></th>
  1860. <td>Multiple roles per user</td>
  1861. </tr>
  1862. </table>
  1863. <table class="new">
  1864. <tr>
  1865. <th>Newborns</th>
  1866. <td>Bluemarine</td>
  1867. </tr>
  1868. </table>
  1869. <table class="new">
  1870. <tr>
  1871. <th rowspan="3">Changes</th>
  1872. <td>SQL: multiple connections, PostgreSQL no longer PEAR:DB</td>
  1873. </tr>
  1874. <tr>
  1875. <td>Themes: refactoring engines, templates and styles, settings and screenshots; XTemplate and Pure themes withdrawn; XTemplate engine remains</td>
  1876. </tr>
  1877. <tr>
  1878. <td>i18n: 100 % UI</td>
  1879. </tr>
  1880. </table>
  1881. </li>
  1882. </ul>
  1883. </section>
  1884. </section>
  1885. <section>
  1886. <section>
  1887. <h2>Drupal 4.5 – Marvin</h2>
  1888. <p class="theme-name">Marvin</p>
  1889. <div class="illustration"><img src="images/drupal45-block-admin.png" alt="Drupal 4 Marvin theme"></div>
  1890. </section>
  1891. </section>
  1892. <section>
  1893. <section>
  1894. <h2>Drupal 4.5 – ab -n10000 -c10 (home)</h2>
  1895. <code class="left ab">
  1896. <table>
  1897. <tr>
  1898. <td>Concurrency Level:</td>
  1899. <td>10</td>
  1900. </tr>
  1901. <tr>
  1902. <td>Time taken for tests:</td>
  1903. <td>28.487 seconds</td>
  1904. </tr>
  1905. <tr>
  1906. <td>Complete requests:</td>
  1907. <td>10000</td>
  1908. </tr>
  1909. <tr>
  1910. <td>Total transferred:</td>
  1911. <td>60070000 bytes</td>
  1912. </tr>
  1913. <tr>
  1914. <td>HTML transferred:</td>
  1915. <td>54620000 bytes</td>
  1916. </tr>
  1917. <tr class="high">
  1918. <td>Requests per second:</td>
  1919. <td>351.03 [#/sec] (mean)</td>
  1920. </tr>
  1921. <tr class="high">
  1922. <td>Time per request:</td>
  1923. <td>28.487 [ms] (mean)</td>
  1924. </tr>
  1925. <tr class="high">
  1926. <td>Time per request:</td>
  1927. <td>2.849 [ms] (mean, across all concurrent requests)</td>
  1928. </tr>
  1929. <tr>
  1930. <td>Transfer rate:</td>
  1931. <td>2059.24 [Kbytes/sec] received</td>
  1932. </tr>
  1933. </table>
  1934. <table>
  1935. <tr>
  1936. <td colspan="2">Connection Times (ms)</td>
  1937. </tr>
  1938. <tr>
  1939. <td>&nbsp;</td>
  1940. <td>min&nbsp;</td>
  1941. <td>mean&nbsp;</td>
  1942. <td>[+/-sd]&nbsp;</td>
  1943. <td>median&nbsp;</td>
  1944. <td>max&nbsp;</td>
  1945. </tr>
  1946. <tr>
  1947. <td>Connect:</td>
  1948. <td>0</td>
  1949. <td>0</td>
  1950. <td>0.1</td>
  1951. <td>0</td>
  1952. <td>3</td>
  1953. </tr>
  1954. <tr>
  1955. <td>Processing:</td>
  1956. <td>8</td>
  1957. <td>28</td>
  1958. <td>7.5</td>
  1959. <td>27</td>
  1960. <td>195</td>
  1961. </tr>
  1962. <tr>
  1963. <td>Waiting:</td>
  1964. <td>8</td>
  1965. <td>28</td>
  1966. <td>7.5</td>
  1967. <td>27</td>
  1968. <td>195</td>
  1969. </tr>
  1970. <tr>
  1971. <td>Total:</td>
  1972. <td>8</td>
  1973. <td>28</td>
  1974. <td>7.5</td>
  1975. <td>28</td>
  1976. <td>195</td>
  1977. </tr>
  1978. </table>
  1979. </code>
  1980. </section>
  1981. </section>
  1982. <section>
  1983. <section>
  1984. <h2>Drupal 4.6</h2>
  1985. <p class="release-date">15/04/2005 (6 months later)</p>
  1986. <ul>
  1987. <li>New <span class="high">block</span> settings:
  1988. <ul>
  1989. <li><code>visibility</code>
  1990. <ul>
  1991. <li>Previously: everywhere or if matches regex</li>
  1992. <li>4.6: on.. or except_on.. (but no PHP yet)</li>
  1993. <li>Paths criteria decode aliases before being applied</li>
  1994. </ul></li>
  1995. <li><code>types</code>
  1996. <ul>
  1997. <li>On all node types or only on these...</li>
  1998. </ul></li>
  1999. </ul>
  2000. </li>
  2001. <li>New <code>hook_block() $op</code> values: <code>configure</code>, <code>save</code></li>
  2002. <li><code>theme_(block|blocks|box)</code> unchanged</li>
  2003. </ul>
  2004. </section>
  2005. <section>
  2006. <h3>Drupal 4.6</h3>
  2007. <ul>
  2008. <li>And elsewhere...
  2009. <table class="new">
  2010. <tr>
  2011. <td>Supports PHP 5, UTF-8 everywhere</td>
  2012. </tr>
  2013. <tr>
  2014. <td>Home: 92ms without the page cache, 19ms with it...</td>
  2015. </table>
  2016. <table class="new">
  2017. <tr>
  2018. <th rowspan="">Newborns</th>
  2019. <td>Contact, ImageAPI</td>
  2020. </tr>
  2021. </table>
  2022. <table class="new">
  2023. <tr>
  2024. <th rowspan="">Changes</th>
  2025. <td>First UX refactorings</td>
  2026. </tr>
  2027. </table>
  2028. <table class="new">
  2029. <tr>
  2030. <th rowspan="2">Removals</th>
  2031. <td>Admin controller <code>admin.php</code></td>
  2032. </tr>
  2033. <tr>
  2034. <td>PEAR:DB abstraction></td>
  2035. </tr>
  2036. </table>
  2037. </li>
  2038. </ul>
  2039. </section>
  2040. </section>
  2041. <section>
  2042. <section>
  2043. <h2>Drupal 4.6 – Block configuration</h2>
  2044. <div class="illustration"><img src="images/drupal46-block-configure.png" alt="Drupal 4.6 Block configuration"></div>
  2045. </section>
  2046. </section>
  2047. <section>
  2048. <section>
  2049. <h2>Drupal 4.6 – ab -n10000 -c10 (home)</h2>
  2050. <code class="left ab">
  2051. <table>
  2052. <tr>
  2053. <td>Concurrency Level:</td>
  2054. <td>10</td>
  2055. </tr>
  2056. <tr>
  2057. <td>Time taken for tests:</td>
  2058. <td>18.530 seconds</td>
  2059. </tr>
  2060. <tr>
  2061. <td>Complete requests:</td>
  2062. <td>10000</td>
  2063. </tr>
  2064. <tr>
  2065. <td>Total transferred:</td>
  2066. <td>920361989 bytes</td>
  2067. </tr>
  2068. <tr>
  2069. <td>HTML transferred:</td>
  2070. <td>916920711 bytes</td>
  2071. </tr>
  2072. <tr class="high">
  2073. <td>Requests per second:</td>
  2074. <td>539.67 [#/sec] (mean)</td>
  2075. </tr>
  2076. <tr class="high">
  2077. <td>Time per request:</td>
  2078. <td>18.530 [ms] (mean)</td>
  2079. </tr>
  2080. <tr class="high">
  2081. <td>Time per request:</td>
  2082. <td>1.853 [ms] (mean, across all concurrent requests)</td>
  2083. </tr>
  2084. <tr>
  2085. <td>Transfer rate:</td>
  2086. <td>48505.27 [Kbytes/sec] received</td>
  2087. </tr>
  2088. </table>
  2089. <table>
  2090. <tr>
  2091. <td colspan="2">Connection Times (ms)</td>
  2092. </tr>
  2093. <tr>
  2094. <td>&nbsp;</td>
  2095. <td>min&nbsp;</td>
  2096. <td>mean&nbsp;</td>
  2097. <td>[+/-sd]&nbsp;</td>
  2098. <td>median&nbsp;</td>
  2099. <td>max&nbsp;</td>
  2100. </tr>
  2101. <tr>
  2102. <td>Connect:</td>
  2103. <td>0</td>
  2104. <td>0</td>
  2105. <td>0.1</td>
  2106. <td>0</td>
  2107. <td>11</td>
  2108. </tr>
  2109. <tr>
  2110. <td>Processing:</td>
  2111. <td>5</td>
  2112. <td>18</td>
  2113. <td>8.3</td>
  2114. <td>17</td>
  2115. <td>199</td>
  2116. </tr>
  2117. <tr>
  2118. <td>Waiting:</td>
  2119. <td>4</td>
  2120. <td>13</td>
  2121. <td>6.4</td>
  2122. <td>12</td>
  2123. <td>160</td>
  2124. </tr>
  2125. <tr>
  2126. <td>Total:</td>
  2127. <td>5</td>
  2128. <td>18</td>
  2129. <td>8.3</td>
  2130. <td>17</td>
  2131. <td>199</td>
  2132. </tr>
  2133. </table>
  2134. </code>
  2135. </section>
  2136. </section>
  2137. <section>
  2138. <section>
  2139. <h2>Drupal 4.7</h2>
  2140. <p class="release-date">01/05/2006 (11 months later)</p>
  2141. <ul>
  2142. <li>Placement: <span class="high">blocks</span> are now configured as placed in theme custom regions</li>
  2143. <li>In core, regions are named, not numbered</li>
  2144. <li>PHP visibility for blocks in addition to paths/types</li>
  2145. <li>Input formats on <span class="high">box</span></li>
  2146. <li><code>theme_(block|blocks|box)</code> unchanged</li>
  2147. </ul>
  2148. </section>
  2149. <section>
  2150. <h3>Drupal 4.7</h3>
  2151. <ul>
  2152. <li>And elsewhere...
  2153. <table class="new">
  2154. <tr>
  2155. <th rowspan="4">Newborns</th>
  2156. <td>PHPTemplate, replacing Xtemplate</td>
  2157. </tr>
  2158. <tr>
  2159. <td>Maintenance mode</td>
  2160. </tr>
  2161. <tr>
  2162. <td>JS: AJAX, collapse effect, textarea resize...</td>
  2163. </tr>
  2164. <tr>
  2165. <td>Form API: arrays of arrays of arrays...</td>
  2166. </tr>
  2167. </table>
  2168. <table class="new">
  2169. <tr>
  2170. <th rowspan="8">Changes</th>
  2171. <td>“Loose caching” for pages, variables cache, data caching in modules (archive)</td>
  2172. </tr>
  2173. <tr>
  2174. <td>Taxonomy: free tagging, global contact form</td>
  2175. </tr>
  2176. <tr>
  2177. <td>Bluemarine and Pushbutton converted to PHPTemplate</td>
  2178. </tr>
  2179. <tr>
  2180. <td>Content moderation withdrawn</td>
  2181. </tr>
  2182. <tr>
  2183. <td>Upgrade path can be extended by modules</td>
  2184. </tr>
  2185. <tr>
  2186. <td>XML-RPC new version</td>
  2187. </tr>
  2188. <tr>
  2189. <td>SQL: PostgreSQL stored procedures removed</td>
  2190. </tr>
  2191. <tr>
  2192. <td>Queue module withdrawn (moderation, not queueing)</td>
  2193. </tr>
  2194. </table>
  2195. </li>
  2196. </ul>
  2197. </section>
  2198. </section>
  2199. <section>
  2200. <section>
  2201. <h2>Drupal 4.7 – block templates</h2>
  2202. <ul>
  2203. <li>Bluemarine 4.6 XTemplate
  2204. <code class="codeblock">
  2205. &lt;!-- BEGIN: block --&gt;<br />
  2206. &nbsp;&nbsp;&lt;div class="block block-{module}" id="block-{module}-{delta}"&gt;<br />
  2207. &nbsp;&nbsp;&nbsp;&nbsp;&lt;h2 class="title"&gt;{title}&lt;/h2&gt;<br />
  2208. &nbsp;&nbsp;&nbsp;&nbsp;&lt;div class="content"&gt;{content}&lt;/div&gt;<br />
  2209. &nbsp;&nbsp;&lt;/div&gt;<br />
  2210. &lt;!-- END: block --&gt;
  2211. </code>
  2212. </li>
  2213. <li>Bluemarine 4.7 PHPTemplate
  2214. <code class="codeblock">
  2215. &lt;div class="&lt;?php print "block block-$block-&gt;module" ?&gt;" id="&lt;?php<br />
  2216. print "block-$block-&gt;module-$block-&gt;delta"; ?&gt;"&gt;<br />
  2217. &nbsp;&nbsp;&lt;h2&gt;&lt;?php print $block-&gt;subject ?&gt;&lt;/h2&gt;<br />
  2218. &nbsp;&nbsp;&lt;div class="content"&gt;&lt;?php print $block-&gt;content ?&gt;&lt;/div&gt;<br />
  2219. &lt;/div&gt;
  2220. </code>
  2221. </li>
  2222. </ul>
  2223. </section>
  2224. </section>
  2225. <section>
  2226. <section>
  2227. <h2>Drupal 4.7 – custom blocks</h2>
  2228. <div class="illustration"><img src="images/drupal47-box.png" alt="Drupal 4 Custom block page"></div>
  2229. </section>
  2230. </section>
  2231. <section>
  2232. <section>
  2233. <h2>Drupal 4.7 – ab -n10000 -c10 (home)</h2>
  2234. <code class="left ab">
  2235. <table>
  2236. <tr>
  2237. <td>Concurrency Level:</td>
  2238. <td>10</td>
  2239. </tr>
  2240. <tr>
  2241. <td>Time taken for tests:</td>
  2242. <td>10.249 seconds</td>
  2243. </tr>
  2244. <tr>
  2245. <td>Complete requests:</td>
  2246. <td>10000</td>
  2247. </tr>
  2248. <tr>
  2249. <td>Total transferred:</td>
  2250. <td>53820228 bytes</td>
  2251. </tr>
  2252. <tr>
  2253. <td>HTML transferred:</td>
  2254. <td>48630000 bytes</td>
  2255. </tr>
  2256. <tr class="high">
  2257. <td>Requests per second:</td>
  2258. <td>975.74 [#/sec] (mean)</td>
  2259. </tr>
  2260. <tr class="high">
  2261. <td>Time per request:</td>
  2262. <td>10.249 [ms] (mean)</td>
  2263. </tr>
  2264. <tr class="high">
  2265. <td>Time per request:</td>
  2266. <td>1.025 [ms] (mean, across all concurrent requests)</td>
  2267. </tr>
  2268. <tr>
  2269. <td>Transfer rate:</td>
  2270. <td>5128.37 [Kbytes/sec] received</td>
  2271. </tr>
  2272. </table>
  2273. <table>
  2274. <tr>
  2275. <td colspan="2">Connection Times (ms)</td>
  2276. </tr>
  2277. <tr>
  2278. <td>&nbsp;</td>
  2279. <td>min&nbsp;</td>
  2280. <td>mean&nbsp;</td>
  2281. <td>[+/-sd]&nbsp;</td>
  2282. <td>median&nbsp;</td>
  2283. <td>max&nbsp;</td>
  2284. </tr>
  2285. <tr>
  2286. <td>Connect:</td>
  2287. <td>0</td>
  2288. <td>0</td>
  2289. <td>0.1</td>
  2290. <td>0</td>
  2291. <td>3</td>
  2292. </tr>
  2293. <tr>
  2294. <td>Processing:</td>
  2295. <td>3</td>
  2296. <td>10</td>
  2297. <td>3.6</td>
  2298. <td>10</td>
  2299. <td>82</td>
  2300. </tr>
  2301. <tr>
  2302. <td>Waiting:</td>
  2303. <td>3</td>
  2304. <td>10</td>
  2305. <td>3.6</td>
  2306. <td>10</td>
  2307. <td>82</td>
  2308. </tr>
  2309. <tr>
  2310. <td>Total:</td>
  2311. <td>3</td>
  2312. <td>10</td>
  2313. <td>3.6</td>
  2314. <td>10</td>
  2315. <td>84</td>
  2316. </tr>
  2317. </table>
  2318. </code>
  2319. </section>
  2320. </section>
  2321. <section>
  2322. <h1 class="chapter">Drupal 5</h1>
  2323. <p class="release-date">15/01/2007 (8 months later)</p>
  2324. <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;">
  2325. </section>
  2326. <section>
  2327. <section>
  2328. <h2>Drupal 5.0</h2>
  2329. <ul>
  2330. <li><span class="high">Block</span> visibility by role</li>
  2331. <li><code>hook_block('view')</code> may not return a title, it uses the one <code>from
  2332. block_list()</code>, passing it to <code>check_plain()</code></li>
  2333. <li><code>theme_(block|blocks|box)</code> unchanged</li>
  2334. <li>Blocks preview merged into the blocks admin form</li>
  2335. </ul>
  2336. </section>
  2337. <section>
  2338. <h3>Drupal 5.0</h3>
  2339. <ul>
  2340. <li>And elsewhere...
  2341. <table class="new">
  2342. <tr>
  2343. <th rowspan="5">Newborns</th>
  2344. <td>Localized installer replaces dump loading</td>
  2345. </tr>
  2346. <tr>
  2347. <td>Install profiles</td>
  2348. </tr>
  2349. <tr>
  2350. <td><code>.info</code> files for modules, dependencies</td>
  2351. </tr>
  2352. <tr>
  2353. <td>jQuery 1.0.4</td>
  2354. </tr>
  2355. <tr>
  2356. <td>Themes: Garland, Minelli, color.module, admin theme concept, module CSS</td>
  2357. </tr>
  2358. </table>
  2359. <table class="new">
  2360. <tr>
  2361. <th rowspan="6">Changes</th>
  2362. <td>Performance: sessions (in Memcached), node_access, fast404, aggressive page cache</td>
  2363. </tr>
  2364. <tr>
  2365. <td>52 ms no cache, 7 ms normal cache, 5 ms aggressive cache</td>
  2366. </tr>
  2367. <tr>
  2368. <td>File layout: 1 directory per core module, <code>sites/all</code> introduced</td>
  2369. </tr>
  2370. <tr>
  2371. <td>Cache plugins, multiple cache bins</td>
  2372. </tr>
  2373. <tr>
  2374. <td>Status page, mail altering, uninstallable modules, bulk operations on users/nodes</td>
  2375. </tr>
  2376. <tr>
  2377. <td>PHPTemplate override</td>
  2378. </tr>
  2379. </table>
  2380. </li>
  2381. </ul>
  2382. </section>
  2383. </section>
  2384. <section>
  2385. <section>
  2386. <h2>Drupal 5 – block admin + preview</h2>
  2387. <div class="illustration"><img src="images/drupal5-block-preview.png" alt="Drupal 5 Block preview"></div>
  2388. </section>
  2389. </section>
  2390. <section>
  2391. <section>
  2392. <h2>Drupal 5 – per-role visibility</h2>
  2393. <div class="illustration"><img src="images/drupal5-block-configure.png" alt="Drupal 5 Block visibility"></div>
  2394. </section>
  2395. </section>
  2396. <section>
  2397. <section>
  2398. <h2>Drupal 5.0 – ab -n10000 -c10 (home)</h2>
  2399. <code class="left ab">
  2400. <table>
  2401. <tr>
  2402. <td>Concurrency Level:</td>
  2403. <td>10</td>
  2404. </tr>
  2405. <tr>
  2406. <td>Time taken for tests:</td>
  2407. <td>5.523 seconds</td>
  2408. </tr>
  2409. <tr>
  2410. <td>Complete requests:</td>
  2411. <td>10000</td>
  2412. </tr>
  2413. <tr>
  2414. <td>Total transferred:</td>
  2415. <td>47180102 bytes</td>
  2416. </tr>
  2417. <tr>
  2418. <td>HTML transferred:</td>
  2419. <td>41720000 bytes</td>
  2420. </tr>
  2421. <tr class="high">
  2422. <td>Requests per second:</td>
  2423. <td>1810.69 [#/sec] (mean)</td>
  2424. </tr>
  2425. <tr class="high">
  2426. <td>Time per request:</td>
  2427. <td>5.523 [ms] (mean)</td>
  2428. </tr>
  2429. <tr class="high">
  2430. <td>Time per request:</td>
  2431. <td>0.552 [ms] (mean, across all concurrent requests)</td>
  2432. </tr>
  2433. <tr>
  2434. <td>Transfer rate:</td>
  2435. <td>8342.63 [Kbytes/sec] received</td>
  2436. </tr>
  2437. </table>
  2438. <table>
  2439. <tr>
  2440. <td colspan="2">Connection Times (ms)</td>
  2441. </tr>
  2442. <tr>
  2443. <td>&nbsp;</td>
  2444. <td>min&nbsp;</td>
  2445. <td>mean&nbsp;</td>
  2446. <td>[+/-sd]&nbsp;</td>
  2447. <td>median&nbsp;</td>
  2448. <td>max&nbsp;</td>
  2449. </tr>
  2450. <tr>
  2451. <td>Connect:</td>
  2452. <td>0</td>
  2453. <td>0</td>
  2454. <td>0.0</td>
  2455. <td>0</td>
  2456. <td>1</td>
  2457. </tr>
  2458. <tr>
  2459. <td>Processing:</td>
  2460. <td>2</td>
  2461. <td>5</td>
  2462. <td>3.6</td>
  2463. <td>5</td>
  2464. <td>110</td>
  2465. </tr>
  2466. <tr>
  2467. <td>Waiting:</td>
  2468. <td>2</td>
  2469. <td>5</td>
  2470. <td>3.6</td>
  2471. <td>5</td>
  2472. <td>110</td>
  2473. </tr>
  2474. <tr>
  2475. <td>Total:</td>
  2476. <td>2</td>
  2477. <td>5</td>
  2478. <td>3.6</td>
  2479. <td>5</td>
  2480. <td>111</td>
  2481. </tr>
  2482. </table>
  2483. </code>
  2484. </section>
  2485. </section>
  2486. <section>
  2487. <h1 class="chapter">Drupal 6</h1>
  2488. <p class="release-date">13/02/2008 (13 months later)</p>
  2489. <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;">
  2490. </section>
  2491. <section>
  2492. <section>
  2493. <h2>Drupal 6.0</h2>
  2494. <ul>
  2495. <li><span class="high">Block</span> cache</li>
  2496. <li><code><span class="high">theme_block()</span></code> → <code>modules/system/<span class="high">block.tpl.php</span></code></li>
  2497. <li><code><span class="high">theme_(box|blocks)</span></code> unchanged, <code><span class="high">box.tpl.php</span></code> still exists</li>
  2498. <li>Per-page <span class="high">block</span> visibility refactored to <code><span class="high">drupal_match_path()</span></code></li>
  2499. <li><span class="high">{blocks}</span> surrogate PK on <code>bid</code>, unique index on <code>module/delta/theme</code></li>
  2500. </ul>
  2501. </section>
  2502. <section>
  2503. <h3>Drupal 6.0</h3>
  2504. <ul>
  2505. <li>And elsewhere...
  2506. <table class="new">
  2507. <tr>
  2508. <th rowspan="">Newborns</th>
  2509. <td><code>hook_watchdog</code>, syslog</td>
  2510. </tr>
  2511. </table>
  2512. <table class="new">
  2513. <tr>
  2514. <th rowspan="7">Changes</th>
  2515. <td>47 ms no cache, 46 ms block cache, 6.5 ms normal cache, 5.9 ms aggressive page cache</td>
  2516. </tr>
  2517. <tr>
  2518. <td>Performance: single pass <code>hook_menu()</code> (without <code>$may_cache</code>); SQL: schema API, needs less privileges on DB (temporary, lock tables); files split, .admin.inc, JS aggregator, reverse proxy support</td>
  2519. </tr>
  2520. <tr>
  2521. <td>Quality: E_ALL, UX, core = 6.x, batch API, HTML Corrector</td>
  2522. </tr>
  2523. <tr>
  2524. <td>Deployment: scripts/drupal.sh (think Drush)</td>
  2525. </tr>
  2526. <tr>
  2527. <td>Security: php.module, weak password check, OpenID, update</td>
  2528. </tr>
  2529. <tr>
  2530. <td>Themes: .info, templates no longer need a matching function, preprocess hooks, jQuery 1.2.3</td>
  2531. </tr>
  2532. <tr>
  2533. <td>i18n: RTL, language detection, content translation, alias, JS UI</td>
  2534. </tr>
  2535. </table>
  2536. </li>
  2537. </ul>
  2538. </section>
  2539. </section>
  2540. <section>
  2541. <section>
  2542. <h2>Drupal 6.0 – block cache</h2>
  2543. <div class="illustration"><img src="images/drupal6-block-cache.png" alt="Drupal 6 Block cache"></div>
  2544. </section>
  2545. <section>
  2546. <h3>Drupal 6.0 – block cache</h3>
  2547. <div class="illustration downer"><img src="images/drupal6-no-block-cache.png" alt="Drupal 6 Block cache"></div>
  2548. </section>
  2549. </section>
  2550. <section>
  2551. <section>
  2552. <h2>Drupal 6 – cache + block throttling</h2>
  2553. <code class="codeblock left" style="font-size: 0.5em;">
  2554. if ($block->enabled && $block->page_match) {<br />
  2555. &nbsp;&nbsp;// Check the current throttle status and see if block should be displayed<br />
  2556. &nbsp;&nbsp;// based on server load.<br />
  2557. &nbsp;&nbsp;if (!($block->throttle && (module_invoke('throttle', 'status') > 0))) {<br />
  2558. &nbsp;&nbsp;&nbsp;&nbsp;// Try fetching the block from cache. Block caching is not compatible with<br />
  2559. &nbsp;&nbsp;&nbsp;&nbsp;// node_access modules. We also preserve the submission of forms in blocks,<br />
  2560. &nbsp;&nbsp;&nbsp;&nbsp;// by fetching from cache only if the request method is 'GET'.<br />
  2561. &nbsp;&nbsp;&nbsp;&nbsp;if (!count(module_implements('node_grants'))<br />
  2562. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&& $_SERVER['REQUEST_METHOD'] == 'GET'<br />
  2563. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&& ($cid = _block_get_cache_id($block))<br />
  2564. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&& ($cache = cache_get($cid, 'cache_block'))) {<br />
  2565. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$array = $cache->data;<br />
  2566. &nbsp;&nbsp;&nbsp;&nbsp;}<br />
  2567. &nbsp;&nbsp;&nbsp;&nbsp;else {<br />
  2568. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$array = module_invoke($block->module, 'block', 'view', $block->delta);<br />
  2569. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (isset($cid)) {<br />
  2570. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cache_set($cid, $array, 'cache_block', CACHE_TEMPORARY);<br />
  2571. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
  2572. &nbsp;&nbsp;&nbsp;&nbsp;}<br />
  2573. &nbsp;&nbsp;} /* ... snip ... */<br />
  2574. }
  2575. </code>
  2576. <p class="left"><span class="highlight">Q1: Why?</span><span class="highlight">Q2: What's in a cid?</span></p>
  2577. </section>
  2578. </section>
  2579. <section>
  2580. <section>
  2581. <h2>Drupal 6.0 – cache rules</h2>
  2582. <code class="codeblock left two-columns-left" style="font-size: 0.5em;">
  2583. &nbsp;* The block cache is cleared in <br />
  2584. &nbsp;* cache_clear_all(), and uses the same <br />
  2585. &nbsp;* clearing policy than page cache <br />
  2586. &nbsp;* (node, comment, user, taxonomy added <br />
  2587. &nbsp;* or updated...). Blocks requiring more <br />
  2588. &nbsp;* fine-grained clearing might consider <br />
  2589. &nbsp;* disabling the built-in block cache <br />
  2590. &nbsp;* (BLOCK_NO_CACHE) and <b>roll their own</b>.<br />
  2591. &nbsp;*<br />
  2592. &nbsp;* <b>user 1 is excluded from block <br />
  2593. &nbsp;* caching.</b> */<br />
  2594. <br />
  2595. /* This setting should be used:<br />
  2596. &nbsp;* - for <b>simple blocks</b> (notably those <br />
  2597. &nbsp;* that do
  2598. not perform any db query), <br />
  2599. &nbsp;* where <span class="high">querying the db cache would be <br />
  2600. &nbsp;* more expensive than directly <br />
  2601. &nbsp;* generating the content</span>.<br />
  2602. &nbsp;* - for blocks that change too <br />
  2603. &nbsp;* frequently.<br />
  2604. &nbsp;*/<br />
  2605. define('BLOCK_NO_CACHE', -1);<br />
  2606. </code>
  2607. <code class="codeblock left two-columns-right" style="font-size: 0.5em;">
  2608. /* This is the default setting, used when the block does not specify anything. */<br />
  2609. define('BLOCK_CACHE_PER_ROLE', 0x0001);<br />
  2610. <br />
  2611. /* The block can change depending on the user viewing the page. <b>Can be resource-consuming</b> for sites with many users */<br />
  2612. define('BLOCK_CACHE_PER_USER', 0x0002);<br />
  2613. <br />
  2614. /* The block can change depending on the page being viewed. */<br />
  2615. define('BLOCK_CACHE_PER_PAGE', 0x0004);<br />
  2616. <br />
  2617. /* The block is the same for every user on every page where it is visible. */<br />
  2618. define('BLOCK_CACHE_GLOBAL', 0x0008);
  2619. <br />
  2620. </code>
  2621. <p class="left two-columns-right" style="margin-top: 0.5em;"><span class="highlight" style="margin-left: 0;">Q: Which advice is lacking?</span></p>
  2622. </section>
  2623. </section>
  2624. <section>
  2625. <section>
  2626. <h2>Drupal 6.0 – ab -n10000 -c10 (home)</h2>
  2627. <code class="left ab">
  2628. <table>
  2629. <tr>
  2630. <td>Concurrency Level:</td>
  2631. <td>10</td>
  2632. </tr>
  2633. <tr>
  2634. <td>Time taken for tests:</td>
  2635. <td>4.690 seconds</td>
  2636. </tr>
  2637. <tr>
  2638. <td>Complete requests:</td>
  2639. <td>10000</td>
  2640. </tr>
  2641. <tr>
  2642. <td>Total transferred:</td>
  2643. <td>3230000 bytes</td>
  2644. </tr>
  2645. <tr>
  2646. <td>HTML transferred:</td>
  2647. <td>0 bytes</td>
  2648. </tr>
  2649. <tr class="high">
  2650. <td>Requests per second:</td>
  2651. <td>2132.20 [#/sec] (mean)</td>
  2652. </tr>
  2653. <tr class="high">
  2654. <td>Time per request:</td>
  2655. <td>4.690 [ms] (mean)</td>
  2656. </tr>
  2657. <tr class="high">
  2658. <td>Time per request:</td>
  2659. <td>0.469 [ms] (mean, across all concurrent requests)</td>
  2660. </tr>
  2661. <tr>
  2662. <td>Transfer rate:</td>
  2663. <td>672.56 [Kbytes/sec] received</td>
  2664. </tr>
  2665. </table>
  2666. <table>
  2667. <tr>
  2668. <td colspan="2">Connection Times (ms)</td>
  2669. </tr>
  2670. <tr>
  2671. <td>&nbsp;</td>
  2672. <td>min&nbsp;</td>
  2673. <td>mean&nbsp;</td>
  2674. <td>[+/-sd]&nbsp;</td>
  2675. <td>median&nbsp;</td>
  2676. <td>max&nbsp;</td>
  2677. </tr>
  2678. <tr>
  2679. <td>Connect:</td>
  2680. <td>0</td>
  2681. <td>0</td>
  2682. <td>0.0</td>
  2683. <td>0</td>
  2684. <td>1</td>
  2685. </tr>
  2686. <tr>
  2687. <td>Processing:</td>
  2688. <td>1</td>
  2689. <td>5</td>
  2690. <td>2.3</td>
  2691. <td>4</td>
  2692. <td>50</td>
  2693. </tr>
  2694. <tr>
  2695. <td>Waiting:</td>
  2696. <td>1</td>
  2697. <td>5</td>
  2698. <td>2.3</td>
  2699. <td>4</td>
  2700. <td>50</td>
  2701. </tr>
  2702. <tr>
  2703. <td>Total:</td>
  2704. <td>1</td>
  2705. <td>5</td>
  2706. <td>2.3</td>
  2707. <td>4</td>
  2708. <td>51</td>
  2709. </tr>
  2710. </table>
  2711. </code>
  2712. </section>
  2713. </section>
  2714. <section>
  2715. <h1 class="chapter">Drupal 7</h1>
  2716. <p class="release-date">05/01/2011 (35 months later)</p>
  2717. <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;" />
  2718. </section>
  2719. <section>
  2720. <section>
  2721. <h2>Drupal 7.0</h2>
  2722. <ul>
  2723. <li><code>hook_block($op) → hook_block_(info|configure|save|view)</code></li>
  2724. <li><code>hook_block_(info|list|view[_MODULE_DELTA])_alter</code></li>
  2725. <li><code>block['content']</code> render array => cache cid without theme/language</li>
  2726. <li><code>block_custom.body</code> translatable</li>
  2727. <li><code>block_custom.format</code> int → varchar(255)</li>
  2728. <li><code>block.api.php</code>, <code>block.test</code>, <code>block.js</code> (vertical tabs, d'n'd)</li>
  2729. <li><code>block_theme()</code> declares <code>block</code>, not just <code>block_admin_display_form</code></li>
  2730. <li><code>BLOCK_CACHE_*</code> → <code>DRUPAL_CACHE_*</code></li>
  2731. <li><code>{blocks}</code> → <code>{block}</code>, <code>{boxes}</code> → {block_custom}</code></code></li>
  2732. </ul>
  2733. </section>
  2734. <section>
  2735. <h3>Drupal 7.0</h3>
  2736. <ul>
  2737. <li>Permissions:
  2738. <ul>
  2739. <li><code>- use PHP for block visibility</code></li>
  2740. <li><code>+ administer blocks</code></li>
  2741. </ul>
  2742. </li>
  2743. <li>UI:
  2744. <ul>
  2745. <li><code>block</code> integration with <code>contextual</code>, vertical tabs, local actions</li>
  2746. <li>Generic regions: <span class="high">block</span> placement in <code>content</code>, <code>help</code>...</li>
  2747. <li>Main content → block dans <code>content</code>, site mission → block dans <code>highlighted</code>, <code>footer</code> → <code>block</code> dans <code>footer</code></li>
  2748. <li>Regions preview again separated from block admin, without the blocks themselves</li>
  2749. </ul>
  2750. </li>
  2751. </ul>
  2752. </section>
  2753. <section>
  2754. <h3>Drupal 7.0</h3>
  2755. <ul>
  2756. <li>Theme:
  2757. <ul>
  2758. <li><code>theme_box()</code> RIP – <span class="high">box concept removed</span></li>
  2759. <li>Block template suggestions</li>
  2760. <li>Process</li>
  2761. </ul>
  2762. </li>
  2763. <li><code>(block).throttle</code> RIP</li>
  2764. <li><code>block_list()</code> replaces join + <code>db_rewrite_sql()</code> by <code>_block_load_blocks()</code> + <code>block_block_list_alter()</code></li>
  2765. <li>Visibility:
  2766. <ul>
  2767. <li>Invalidates inconsistent visibility, like no page allows (positif/negative)</li>
  2768. <li>PHP: <code>module_exists('php')</code></li>
  2769. </ul>
  2770. </li>
  2771. </ul>
  2772. </section>
  2773. <section>
  2774. <h3>Drupal 7.0</h3>
  2775. <ul>
  2776. <li><code>hook_modules_uninstalled()</code> enables block to clean blocks created by other modules</li>
  2777. <li>Alternative: <code>drupal_set_content</code> → <code>drupal_add_region_content</code></li>
  2778. <li>And elsewhere...
  2779. <table class="new">
  2780. <tr>
  2781. <th></th>
  2782. <td>Entity API, Field API, EFQ, DBTNG, render arrays</td>
  2783. </tr>
  2784. <tr>
  2785. <th></th>
  2786. <td>More caches and one-off plugins</td>
  2787. </tr>
  2788. <tr>
  2789. <th></th>
  2790. <td>i18n: field translation</td>
  2791. </tr>
  2792. <tr>
  2793. <th></th>
  2794. <td>Theme: Bartik, Corolla, Seven; return of the raw theme: Stark</td>
  2795. </tr>
  2796. </table>
  2797. </li>
  2798. </ul>
  2799. </section>
  2800. </section>
  2801. <section>
  2802. <section>
  2803. <h2>Drupal 7 – block preview</h2>
  2804. <div class="illustration"><img src="images/drupal7-preview.png" alt="Drupal 7 Block preview"></div>
  2805. </section>
  2806. </section>
  2807. <section>
  2808. <section>
  2809. <h2>Drupal 7.0 – ab -n10000 -c10 (home)</h2>
  2810. <code class="left ab">
  2811. <table>
  2812. <tr>
  2813. <td>Concurrency Level:</td>
  2814. <td>10</td>
  2815. </tr>
  2816. <tr>
  2817. <td>Time taken for tests:</td>
  2818. <td>6.223 seconds</td>
  2819. </tr>
  2820. <tr>
  2821. <td>Complete requests:</td>
  2822. <td>10000</td>
  2823. </tr>
  2824. <tr>
  2825. <td>Total transferred:</td>
  2826. <td>63250000 bytes</td>
  2827. </tr>
  2828. <tr>
  2829. <td>HTML transferred:</td>
  2830. <td>58260000 bytes</td>
  2831. </tr>
  2832. <tr class="high">
  2833. <td>Requests per second:</td>
  2834. <td>1606.99 [#/sec] (mean)</td>
  2835. </tr>
  2836. <tr class="high">
  2837. <td>Time per request:</td>
  2838. <td>6.223 [ms] (mean)</td>
  2839. </tr>
  2840. <tr class="high">
  2841. <td>Time per request:</td>
  2842. <td>0.622 [ms] (mean, across all concurrent requests)</td>
  2843. </tr>
  2844. <tr>
  2845. <td>Transfer rate:</td>
  2846. <td>9926.00 [Kbytes/sec] received</td>
  2847. </tr>
  2848. </table>
  2849. <table>
  2850. <tr>
  2851. <td colspan="2">Connection Times (ms)</td>
  2852. </tr>
  2853. <tr>
  2854. <td>&nbsp;</td>
  2855. <td>min&nbsp;</td>
  2856. <td>mean&nbsp;</td>
  2857. <td>[+/-sd]&nbsp;</td>
  2858. <td>median&nbsp;</td>
  2859. <td>max&nbsp;</td>
  2860. </tr>
  2861. <tr>
  2862. <td>Connect:</td>
  2863. <td>0</td>
  2864. <td>0</td>
  2865. <td>0.1</td>
  2866. <td>0</td>
  2867. <td>4</td>
  2868. </tr>
  2869. <tr>
  2870. <td>Processing:</td>
  2871. <td>2</td>
  2872. <td>6</td>
  2873. <td>2.3</td>
  2874. <td>6</td>
  2875. <td>29</td>
  2876. </tr>
  2877. <tr>
  2878. <td>Waiting:</td>
  2879. <td>2</td>
  2880. <td>6</td>
  2881. <td>2.3</td>
  2882. <td>6</td>
  2883. <td>29</td>
  2884. </tr>
  2885. <tr>
  2886. <td>Total:</td>
  2887. <td>2</td>
  2888. <td>6</td>
  2889. <td>2.3</td>
  2890. <td>6</td>
  2891. <td>29</td>
  2892. </tr>
  2893. </table>
  2894. </code>
  2895. </section>
  2896. </section>
  2897. <section>
  2898. <h1 class="chapter">Drupal 8</h1>
  2899. <p class="release-date">02/2014? (37 months later)</p>
  2900. <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;">
  2901. </section>
  2902. <section>
  2903. <section>
  2904. <h2>Drupal 8.0</h2>
  2905. <ul class="left two-columns-left" style="width: 35%;">
  2906. <li>Assetic</li>
  2907. <li>Composer</li>
  2908. <li>Doctrine: annotations</li>
  2909. <li>EasyRDF</li>
  2910. <li>Guzzle</li>
  2911. <li>PHPUnit</li>
  2912. <li>PSR/3</li>
  2913. </ul>
  2914. <ul class="left two-columns-right" style="width: 55%;">
  2915. <li>Symfony 2</li>
  2916. <li>Symfony CMF: routing (chain router)</li>
  2917. <li>Twig</li>
  2918. <li>Zend Framework 2: escaper, feed, stdlib</li>
  2919. <li>Plus some Drupal to wrap it up... ;-)</li>
  2920. </ul>
  2921. </section>
  2922. </section>
  2923. <section>
  2924. <section>
  2925. <h2>Drupal 8 – just the basics...</h2>
  2926. <ul>
  2927. <li><code>hook_block_info()</code> → Doctrine annotation on the block class</li>
  2928. <li><code>hook_block_view()</code> → <code>BlockPluginInterface::build()</code></li>
  2929. <li><code>hook_block_configure()</code> → <code>BlockPluginInterface::blockForm()</code></li>
  2930. <li><code>hook_block_save()</code> → <code>BlockPluginInterface::blockSubmit()</code></li>
  2931. <li>New methods:
  2932. <ul>
  2933. <li><code>BlockPluginInterface::access()</code>: block visibility</li>
  2934. <li><code>BlockPluginInterface::settings()</code>: default configuration <br>(à la Views <code>option_definition</code>)</li>
  2935. <li><code>BlockPluginInterface::validate()</code>: validation before submit</li>
  2936. </ul>
  2937. </li>
  2938. <li>Derivative blocks</li>
  2939. </ul>
  2940. </section>
  2941. </section>
  2942. <section>
  2943. <section>
  2944. <h2>Drupal 8 – block "online users"</h2>
  2945. <code class="codeblock left two-columns-left" style="width: 38.5%; font-size: 0.42em;">
  2946. &lt;?php<br />
  2947. /**<br />
  2948. &nbsp;* @file<br />
  2949. &nbsp;* Contains \Drupal\user\Plugin\Block<br />&nbsp;* \UserOnlineBlock.<br />
  2950. &nbsp;*/<br />
  2951. <br />
  2952. namespace Drupal\user\Plugin\Block;<br />
  2953. <br />
  2954. use Drupal\block\BlockBase;<br />
  2955. use Drupal\Component\Annotation\Plugin;<br />
  2956. use Drupal\Core\Annotation\Translation;<br />
  2957. <br />
  2958. /**<br />
  2959. &nbsp;* Provides a "Who's online" block.<br />
  2960. &nbsp;*<br />
  2961. &nbsp;* @Plugin(<br />
  2962. &nbsp;*&nbsp;&nbsp;id = "user_online_block",<br />
  2963. &nbsp;*&nbsp;&nbsp;admin_label = @Translation("Who's <br />
  2964. &nbsp;*&nbsp;&nbsp;online"),<br />
  2965. &nbsp;*&nbsp;&nbsp;module = "user"<br />
  2966. &nbsp;* )<br />
  2967. &nbsp;*/<br />
  2968. </code>
  2969. <code class="codeblock left two-columns-right" style="width: 56.5%; font-size: 0.42em;">
  2970. class UserOnlineBlock extends BlockBase {<br />
  2971. &nbsp;&nbsp;//** Overrides \Drupal\block\BlockBase::settings().<br />
  2972. &nbsp;&nbsp;public function settings() { /* ... */ }<br />
  2973. &nbsp;&nbsp;<br />
  2974. &nbsp;&nbsp;//** Overrides \Drupal\block\BlockBase::access().<br />
  2975. &nbsp;&nbsp;public function access() { /* ... */ }<br />
  2976. &nbsp;&nbsp;<br />
  2977. &nbsp;&nbsp;//** Overrides \Drupal\block\BlockBase::blockForm().<br />
  2978. &nbsp;&nbsp;public function blockForm($form, &$form_state) <br />
  2979. &nbsp;&nbsp;{ /* ... */ }<br />
  2980. &nbsp;&nbsp;<br />
  2981. &nbsp;&nbsp;//** Overrides \Drupal\block\BlockBase::blockSubmit().<br />
  2982. &nbsp;&nbsp;public function blockSubmit($form, &$form_state) <br />
  2983. &nbsp;&nbsp;{ /* ... */ }<br />
  2984. &nbsp;&nbsp;<br />
  2985. &nbsp;&nbsp;/**<br />
  2986. &nbsp;&nbsp;&nbsp;* {@inheritdoc}<br />
  2987. &nbsp;&nbsp;&nbsp;*/<br />
  2988. &nbsp;&nbsp;public function build() { }<br />
  2989. }
  2990. </code>
  2991. </section>
  2992. </section>
  2993. <section>
  2994. <section>
  2995. <h2>Drupal 8.0 – Block statistics</h2>
  2996. <table class="compare-table six">
  2997. <thead>
  2998. <tr>
  2999. <th>Drupal 6</th>
  3000. <td>PHP</td>
  3001. <td>JavaScript</td>
  3002. <td></td>
  3003. </tr>
  3004. </thead>
  3005. <tbody>
  3006. <tr>
  3007. <th></th>
  3008. <td>3 files</td>
  3009. <td>1 file</td>
  3010. <td></td>
  3011. </tr>
  3012. <tr>
  3013. <th></th>
  3014. <td>329 comment lines</td>
  3015. <td>20 comment lines</td>
  3016. <td></td>
  3017. </tr>
  3018. <tr>
  3019. <th></th>
  3020. <td>651 code lines</td>
  3021. <td>65 code lines</td>
  3022. <td></td>
  3023. </tr>
  3024. </tbody>
  3025. </table>
  3026. <table class="compare-table seven">
  3027. <thead>
  3028. <tr>
  3029. <th>Drupal 7</th>
  3030. <td>PHP</td>
  3031. <td>JavaScript</td>
  3032. <td></td>
  3033. </tr>
  3034. </thead>
  3035. <tbody>
  3036. <tr>
  3037. <th></th>
  3038. <td>8 files</td>
  3039. <td>1 file</td>
  3040. <td></td>
  3041. </tr>
  3042. <tr>
  3043. <th></th>
  3044. <td>1148 comment lines</td>
  3045. <td>31 comment lines</td>
  3046. <td></td>
  3047. </tr>
  3048. <tr>
  3049. <th></th>
  3050. <td>1746 code lines</td>
  3051. <td>105 code lines</td>
  3052. <td></td>
  3053. </tr>
  3054. </tbody>
  3055. </table>
  3056. <table class="compare-table eight">
  3057. <thead>
  3058. <tr>
  3059. <th>Drupal 8</th>
  3060. <td>PHP</td>
  3061. <td>JavaScript</td>
  3062. <td>YAML</td>
  3063. </tr>
  3064. </thead>
  3065. <tbody>
  3066. <tr>
  3067. <th></th>
  3068. <td>85 files</td>
  3069. <td>3 files</td>
  3070. <td>17 files</td>
  3071. </tr>
  3072. <tr>
  3073. <th></th>
  3074. <td>3443 comment lines</td>
  3075. <td>66 comment lines</td>
  3076. <td>2 comment lines</td>
  3077. </tr>
  3078. <tr>
  3079. <th></th>
  3080. <td>5089 code lines</td>
  3081. <td>170 code lines</td>
  3082. <td>428 data lines</td>
  3083. </tr>
  3084. </tbody>
  3085. </table>
  3086. <p class="left"><span class="highlight" style="margin-left: 0;">Drupal 3 = 5622 PHP LoC</span></p>
  3087. </section>
  3088. </section>
  3089. <section>
  3090. <section>
  3091. <h2>Drupal 8 – UI</h2>
  3092. <ul>
  3093. <li>New administration UI:
  3094. <ul>
  3095. <li>No kilometer-high list of unused blocks</li>
  3096. <li>Add block page for new blocks
  3097. <ul>
  3098. <li>Optionally filtered by module</li>
  3099. <li>With search form</li>
  3100. </ul>
  3101. </li>
  3102. </ul>
  3103. </li>
  3104. <li>Simplified configuration form</li>
  3105. </ul>
  3106. </section>
  3107. </section>
  3108. <section>
  3109. <section>
  3110. <h2>Drupal 8 – block admin</h2>
  3111. <div class="illustration"><img src="images/drupal8-placement.png" alt="Drupal 8 Block administration page"></div>
  3112. </section>
  3113. </section>
  3114. <section>
  3115. <section>
  3116. <h2>Drupal 8 – block add</h2>
  3117. <div class="illustration"><img src="images/drupal8-add.png" alt="Drupal 8 Block administration page"></div>
  3118. </section>
  3119. </section>
  3120. <section>
  3121. <section>
  3122. <h3>Drupal 8.0 – ab -n10000 -c10 (home)</h3>
  3123. <p>Default classloader</p>
  3124. <code class="left ab">
  3125. <table>
  3126. <tr>
  3127. <td>Concurrency Level:</td>
  3128. <td>10</td>
  3129. </tr>
  3130. <tr>
  3131. <td>Time taken for tests:</td>
  3132. <td>46.494 seconds</td>
  3133. </tr>
  3134. <tr>
  3135. <td>Complete requests:</td>
  3136. <td>10000</td>
  3137. </tr>
  3138. <tr>
  3139. <td>Total transferred:</td>
  3140. <td>85030000 bytes</td>
  3141. </tr>
  3142. <tr>
  3143. <td>HTML transferred:</td>
  3144. <td>80260000 bytes</td>
  3145. </tr>
  3146. <tr class="high">
  3147. <td>Requests per second:</td>
  3148. <td>215.08 [#/sec] (mean)</td>
  3149. </tr>
  3150. <tr class="high">
  3151. <td>Time per request:</td>
  3152. <td>46.494 [ms] (mean)</td>
  3153. </tr>
  3154. <tr class="high">
  3155. <td>Time per request:</td>
  3156. <td>4.649 [ms] (mean, across all concurrent requests)</td>
  3157. </tr>
  3158. <tr>
  3159. <td>Transfer rate:</td>
  3160. <td>1785.98 [Kbytes/sec] received</td>
  3161. </tr>
  3162. </table>
  3163. <table>
  3164. <tr>
  3165. <td colspan="2">Connection Times (ms)</td>
  3166. </tr>
  3167. <tr>
  3168. <td>&nbsp;</td>
  3169. <td>min&nbsp;</td>
  3170. <td>mean&nbsp;</td>
  3171. <td>[+/-sd]&nbsp;</td>
  3172. <td>median&nbsp;</td>
  3173. <td>max&nbsp;</td>
  3174. </tr>
  3175. <tr>
  3176. <td>Connect:</td>
  3177. <td>0</td>
  3178. <td>0</td>
  3179. <td>0.0</td>
  3180. <td>0</td>
  3181. <td>3</td>
  3182. </tr>
  3183. <tr>
  3184. <td>Processing:</td>
  3185. <td>14</td>
  3186. <td>46</td>
  3187. <td>14.9</td>
  3188. <td>45</td>
  3189. <td>276</td>
  3190. </tr>
  3191. <tr>
  3192. <td>Waiting:</td>
  3193. <td>14</td>
  3194. <td>46</td>
  3195. <td>14.9</td>
  3196. <td>45</td>
  3197. <td>276</td>
  3198. </tr>
  3199. <tr>
  3200. <td>Total:</td>
  3201. <td>14</td>
  3202. <td>46</td>
  3203. <td>14.9</td>
  3204. <td>45</td>
  3205. <td>276</td>
  3206. </tr>
  3207. </table>
  3208. </code>
  3209. </section>
  3210. <section>
  3211. <h2>Drupal 8.0 – ab -n10000 -c10 (home)</h2>
  3212. <p>APC classloader</p>
  3213. <code class="left ab">
  3214. <table>
  3215. <tr>
  3216. <td>Concurrency Level:</td>
  3217. <td>10</td>
  3218. </tr>
  3219. <tr>
  3220. <td>Time taken for tests:</td>
  3221. <td>40.986 seconds</td>
  3222. </tr>
  3223. <tr>
  3224. <td>Complete requests:</td>
  3225. <td>10000</td>
  3226. </tr>
  3227. <tr>
  3228. <td>Total transferred:</td>
  3229. <td>85030000 bytes</td>
  3230. </tr>
  3231. <tr>
  3232. <td>HTML transferred:</td>
  3233. <td>80260000 bytes</td>
  3234. </tr>
  3235. <tr class="high">
  3236. <td>Requests per second:</td>
  3237. <td>273.78 [#/sec] (mean)</td>
  3238. </tr>
  3239. <tr class="high">
  3240. <td>Time per request:</td>
  3241. <td>36.526 [ms] (mean)</td>
  3242. </tr>
  3243. <tr class="high">
  3244. <td>Time per request:</td>
  3245. <td>3.653 [ms] (mean, across all concurrent requests)</td>
  3246. </tr>
  3247. <tr>
  3248. <td>Transfer rate:</td>
  3249. <td>2273.40 [Kbytes/sec] received</td>
  3250. </tr>
  3251. </table>
  3252. <table>
  3253. <tr>
  3254. <td colspan="2">Connection Times (ms)</td>
  3255. </tr>
  3256. <tr>
  3257. <td>&nbsp;</td>
  3258. <td>min&nbsp;</td>
  3259. <td>mean&nbsp;</td>
  3260. <td>[+/-sd]&nbsp;</td>
  3261. <td>median&nbsp;</td>
  3262. <td>max&nbsp;</td>
  3263. </tr>
  3264. <tr>
  3265. <td>Connect:</td>
  3266. <td>0</td>
  3267. <td>0</td>
  3268. <td>0.0</td>
  3269. <td>0</td>
  3270. <td>1</td>
  3271. </tr>
  3272. <tr>
  3273. <td>Processing:</td>
  3274. <td>11</td>
  3275. <td>36</td>
  3276. <td>10.6</td>
  3277. <td>35</td>
  3278. <td>99</td>
  3279. </tr>
  3280. <tr>
  3281. <td>Waiting:</td>
  3282. <td>10</td>
  3283. <td>36</td>
  3284. <td>10.6</td>
  3285. <td>35</td>
  3286. <td>99</td>
  3287. </tr>
  3288. <tr>
  3289. <td>Total:</td>
  3290. <td>10</td>
  3291. <td>36</td>
  3292. <td>10.6</td>
  3293. <td>35</td>
  3294. <td>99</td>
  3295. </tr>
  3296. </table>
  3297. </code>
  3298. </section>
  3299. </section>
  3300. <section>
  3301. <section>
  3302. <h2>ms/&lt;anonymous home&gt;</h2>
  3303. <div class="diagramme"><img src="images/ms-anonymous-home-13I24.png" alt="Drupal"></div>
  3304. <p class="caption">PHP 5.3.10, MySQL 5.5, APC 3.1.9, aggressive Cache, D8 APC Classloader</p>
  3305. </section>
  3306. <section class="full">
  3307. <div class="diagramme-full"><img src="images/ms-anonymous-home-13I24.png" alt="Drupal"></div>
  3308. <p class="caption">PHP 5.3.10, MySQL 5.5, APC 3.1.9, aggressive Cache, D8 APC Classloader</p>
  3309. </section>
  3310. </section>
  3311. <section>
  3312. <img src="osinet.png" class="cover-img" style="height: 150px;" />
  3313. <div class="cover-osi">
  3314. <h3>Thank you!</h3>
  3315. <p>Any questions?</p>
  3316. <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;" />
  3317. </div>
  3318. </section>
  3319. <section>
  3320. <img src="osinet.png" class="cover-img" style="height: 150px;" />
  3321. <h3 class="people blue" style="text-align: center;">Come and say hello!</h3>
  3322. <table class="people">
  3323. <tr class="blue">
  3324. <td>Frédéric G. Marand (<a href="http://drupal.org/user/27985">fgm</a>)</td>
  3325. <td class="td-middle">Outi Munter (<a href="http://drupal.org/user/1629998">Outi</a>)</td>
  3326. <td>Brigitte Taïeb (<a href="https://drupal.org/user/2255702">brigtai</a>)</td>
  3327. </tr>
  3328. <tr>
  3329. <td><img src="images/fgm-dublin.jpg" class="cover-img"></td>
  3330. <td class="td-middle"><img src="images/outi-2.jpg" class="cover-img"></td>
  3331. <td><img src="images/brigitte.jpg" class="cover-img"></td>
  3332. </tr>
  3333. <tr style="font-size: 0.78em; opacity: 0.8;">
  3334. <td>Let's take a look at your code!</td>
  3335. <td class="td-middle">I design and theme for you.</td>
  3336. <td>I can talk business.</td>
  3337. </tr>
  3338. </table>
  3339. <p style="text-align: center;"><a href="http://www.osinet.fr" class="highlight" style="color: white; font-size: 1.05em; margin-left: 0;">www.osinet.fr</a></p>
  3340. </section>
  3341. <section data-background="images/background-prague.png">
  3342. <img src="images/logo-prague.png" class="cover-img" style="height: 150px; margin-bottom: 2em;">
  3343. <p class="custom inverse">WHAT DID YOU THINK?</p>
  3344. <p class="custom inverse">Locate this session at the DrupalCon Prague website:</p>
  3345. <p class="custom inverse"><a href="http://prague2013.drupal.org/session/blocks-drop.org-drupal-8-and-beyond">http://prague2013.drupal.org/session/blocks-drop.org-drupal-8-and-beyond</a></p>
  3346. <p class="custom inverse">Click the "Take the survey" link</p>
  3347. <p class="custom inverse">THANK YOU!</p>
  3348. </section>
  3349. <!-- ################################### END LATEST SLIDE ################################### -->
  3350. </div>
  3351. <div class="footer"><img src="osinet.png" alt="logo" class="logo" height="70"><span class="footnote">The Drupal blocks system from drop.org to Drupal 8 / © 2013 OSInet / Licence CC-BY-SA 2.0 France</span></div>
  3352. </div>
  3353. <script src="lib/js/head.min.js"></script>
  3354. <script src="js/reveal.min.js"></script>
  3355. <script>
  3356. // Full list of configuration options available here:
  3357. // https://github.com/hakimel/reveal.js#configuration
  3358. Reveal.initialize({
  3359. controls: true,
  3360. progress: true,
  3361. history: true,
  3362. center: false,
  3363. theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
  3364. transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
  3365. // Optional libraries used to extend on reveal.js
  3366. dependencies: [
  3367. { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
  3368. { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
  3369. { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
  3370. { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
  3371. { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
  3372. { src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
  3373. ]
  3374. });
  3375. </script>
  3376. </body>
  3377. </html>