123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>The Drupal blocks system from Drop.org to Drupal 8</title>
- <meta name="description" content="Presentation given on DrupalCon Prague 2013">
- <meta name="author" content="Frederic G. Marand" />
- <meta name="apple-mobile-web-app-capable" content="yes" />
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
- <link rel="stylesheet" href="css/reveal.min.css">
- <link rel="stylesheet" href="css/theme/osi.css" id="theme">
- <!-- For syntax highlighting -->
- <link rel="stylesheet" href="lib/css/zenburn.css" />
- <!-- If the query includes 'print-pdf', use the PDF print sheet -->
- <script>
- document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
- </script>
- <!--[if lt IE 9]>
- <script src="lib/js/html5shiv.js"></script>
- <![endif]-->
- </head>
- <body>
- <div class="reveal">
- <!-- Any section element inside of this container is displayed as a slide -->
- <div class="slides">
- <section data-background="images/background-prague.png">
- <h1 class="custom inverse">The Drupal blocks system</h1>
- <h2 class="custom inverse">from drop.org to Drupal 8</h2>
- <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>
- </p>
- <img src="images/logo-prague.png" class="cover-img" style="height: 250px; margin-top: 0.8em;">
- </section>
- <!--
- <section>
- <img src="osinet.png" class="cover-img" style="height: 150px;" />
- <div class="cover-osi">
- <h3>The Drupal blocks system from drop.org to Drupal 8</h3>
- <p>by Frédéric G. Marand (fgm)</p>
- </div>fi
- </section>
- -->
- <section>
- <h2>Once upon a time...</h2>
- <blockquote class="downer">“First we start making a slashdot.org alike site: a community weblog that offers all you need to know”</blockquote>
- <p class="right"><small>docs/mission.php, circa 2000-03</small></p>
- </section>
- <section>
- <section>
- <h2>Drupal – <span class="lowercase">LoC</span> vs time</h2>
- <div class="diagramme" style="position: relative;">
- <img src="images/codesize-1.png" alt="code-1998-2014" />
- <img src="images/codesize-1-legende.png" alt="code-1998-2014" style="position: absolute; top: 25px; left: 250px; width: 150px;" />
- </div>
- </section>
- <section class="full">
- <div class="diagramme-full" style="position: relative;">
- <img src="images/codesize-1.png" alt="code-1998-2014" />
- <img src="images/codesize-1-legende.png" alt="code-1998-2014" style="position: absolute; top: 30px; left: 180px; width: 170px;" />
- </div>
- <p class="caption">Drupal – LoC vs time</p>
- </section>
- </section>
- <section>
- <section>
- <h2>PHP code in Drupal</h2>
- <div class="diagramme"><img src="images/codesize-filter-2.png" alt="php-1998-2014"></div>
- </section>
- <section class="full">
- <div class="diagramme-full"><img src="images/codesize-filter-2.png" alt="php-1998-2014"></div>
- <p class="caption">PHP code in Drupal</p>
- </section>
- </section>
- <section>
- <section>
- <h2>CSS code in Drupal</h2>
- <div class="diagramme"><img src="images/codesize-filter-3.png" alt="css-1998-2014"></div>
- </section>
- <section class="full">
- <div class="diagramme-full"><img src="images/codesize-filter-3.png" alt="css-1998-2014"></div>
- <p class="caption">CSS code in Drupal</p>
- </section>
- </section>
- <section>
- <section>
- <h2>JavaScript code in Drupal</h2>
- <div class="diagramme"><img src="images/codesize-filter-4.png" alt="css-1998-2014"></div>
- </section>
- <section class="full">
- <div class="diagramme-full"><img src="images/codesize-filter-4.png" alt="css-1998-2014"></div>
- <p class="caption">JavaScript code in Drupal</p>
- </section>
- </section>
- <section>
- <h1 class="chapter">drop.org</h1>
- <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;" />
- </section>
- <section>
- <section>
- <h2>drop.org – what's a block, really ?</h2>
- <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>
- <p class="right"><small>docs/features.php, circa 2000-03</small></p>
- </section>
- <section>
- <h3>drop.org – what's a block, really ?</h3>
- <blockquote class="right downer" style="float: left; width: 25%;"><span class="quote-underline">Boxes:</span></blockquote>
- <blockquote class="left downer" style="float: right; width: 70%;">
- Box for latest headlines.<br />
- Box for older headlines.<br />
- Box for related links.<br />
- Box with login form.<br />
- User-defined box.<br />
- </blockquote>
- <p class="right"><small>docs/features.php, circa 2000-03</small></p>
- </section>
- <section>
- <h3>drop.org – what's a block, really ?</h3>
- <blockquote class="right downer" style="float: left; width: 25%;"><span class="quote-underline">Theme support:</span></blockquote>
- <blockquote class="left downer" style="float: right; width: 70%;">
- Not only can you change the colors, you can also change the position of most boxes and such.
- </blockquote>
- <p class="right"><small>docs/features.php, circa 2000-03</small></p>
- </section>
- </section>
- <section>
- <section>
- <h2>drop.org – page cycle</h2>
- <p class="left">No front controller, controller = PHP file</p>
- <ul class="left">
- <li><code>index.php, faq.php, article.php, ...</code></li>
- <li>uses GET query string, notably op for action variation</li>
- <li><code>register_globals = on</code> required</li>
- <li>dedicated back-office : <code>admin.php</code>
- </li>
- </ul>
- </section>
- <section>
- <h3>drop.org – page cycle</h3>
- <p class="left">Controller
- </p>
- <ul class="left">
- <li>loads shared functions, configuration
- </li>
- <li><code>$theme->header()</code>
- </li>
- <li>if action variants exists, switch <code>($op)
- </code>
- <ul>
- <li>adds content base on <code>$op</code>,</li>
- <li>e.g., <code>$theme->article()</code>, others build HTML inline</li>
- <li><code>article()</code>, <code>box()</code> , <code>comment()</code>, <code>abstract()</code>,
- </li>
- </ul></li>
- <li><code>footer()</code>, <code>header()</code>, <code>preview()</code></li>
- <li><code>$theme->footer()</code></li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>drop.org – block placement</h2>
- <ul class="left">
- <li>No block placement UI</li>
- <li>Theme methods decide which blocks they will display in their predefined <code>header</code> et <code>footer</code> elements.</li>
- <li><code>themes/Dries/theme.class</code>
- <code class="codeblock">
- function footer() { /* ..snip.. */<br />
- global $PHP_SELF;<br />
- if (strstr($PHP_SELF, "index.php")) {<br />
- global $user;<br />
- displayAccount($this);
- </code></li>
- <li>Predefined function invoke <code>$theme->box($subject, $content)</code></li>
- </ul>
- </section>
- <section>
- <h3>drop.org – block placement</h3>
- <ul class="left">
- <li><code>functions.inc</code>
- <code class="codeblock">
- function displayAccount($theme) {<br />
- global $user, $cookie;<br />
- if ($user) {<br />
- ### Display userblock if any:<br />
- displayUserblock();<br />
- }<br />
- else {<br />
- $content = "<CENTER><FORM METHOD=\"post\" ACTION=\"account.php\">\n
- <P>Username:<BR><INPUT TYPE=\"text\" NAME=\"uname\" MAXLENGTH=\"50\"SIZE=\"12\"></P>\n
- <P>Password:<BR> <INPUT TYPE=\"password\" NAME=\"pass\"MAXLENGTH=\"25\" SIZE=\"12\"></P>\n
- <INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Login\">\n</FORM>\n<P><A HREF=\"account.php\">
- Register</A> as new user.<BR><A HREF=\"account.php\">Forgot</A> your password?</P>
- </CENTER>";<br />
- <span class="high">$theme->box("Login", $content);</span><br />
- }<br />
- }</code></li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>drop.org : box theme</h2>
- <ul class="left">
- <li><code>themes/Natrak/theme.class</code> <span class="highlight">Themes are PHP classes</span>
- <code class="codeblock">
- ######<br />
- # Syntax.......: box($title, $body);<br />
- # Description..: a function to draw a box/block.<br />
- function box($subject, $content) {<br />
- include "config.inc";<br />
- print "<TABLE BORDER=\"0\" CELLPADDING=\"3\" CELLSPACING=\"3\" WIDTH=\"100%\">";<br />
- print " <TR><TD ALIGN=\"center\" BGCOLOR=\"$this->bgcolor1\" WIDTH=\"100%\"><FONT COLOR=\"$this->fgcolor1\"><B>$subject</B></FONT></TD></TR>";<br />
- print " <TR><TD BGCOLOR=\"$this->bgcolor2\">$content</TD></TR>";<br />
- print "</TABLE><BR>";<br />
- }
- </code></li>
- </ul>
- </section>
- <section>
- <h3>drop.org : box theme</h3>
- <ul class="left">
- <li><code>themes/Natrak/theme.php</code> <span class="highlight">Just not only...</span>
- <code class="codeblock">
- function themebox($subject, $content) {<br />
- global $bgcolor1, $bgcolor2, $bgcolor3;<br />
- include "config.inc";<br />
- print "<TABLE BORDER=\"0\" CELLPADDING=\"3\" CELLSPACING=\"3\" WIDTH=\"100%\">";<br />
- print " <TR><TD ALIGN=\"center\" BGCOLOR=\"$bgcolor1\"><FONT COLOR=\"$bgcolor2\"><B>$subject</B></FONT></TD></TR>";<br />
- print " <TR><TD BGCOLOR=\"$bgcolor2\">$content</TD></TR>";<br />
- print "</TABLE><BR>";<br />
- }</code></li>
- <li><code>webboard.php</code> uses the function format, other controllers invoke the method format.</li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>drop.org – article page</h2>
- <div class="illustration"><img src="images/drop1-article-dries.png" alt="Article page" /></div>
- </section>
- </section>
- <section>
- <section>
- <h2>drop.org – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>9.821 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>93350000 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>90880000 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>1018.24 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>9.821 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>0.982 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>9282.49 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.1</td>
- <td>0</td>
- <td>2</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>2</td>
- <td>10</td>
- <td>4.0</td>
- <td>9</td>
- <td>62</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>1</td>
- <td>9</td>
- <td>3.8</td>
- <td>9</td>
- <td>61</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>2</td>
- <td>10</td>
- <td>4.0</td>
- <td>9</td>
- <td>62</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <section>
- <h2>drop.org – default theme</h2>
- <div class="illustration"><img src="images/drop1-refer.png" alt="Theme example"></div>
- </section>
- </section>
- <section>
- <h1 class="chapter">Drupal 1</h1>
- <p class="release-date">15/01/2001</p>
- <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;" />
- </section>
- <section>
- <section>
- <h2>Drupal 1.0</h2>
- <ul class="left">
- <li><code>module</code>, <code>hook</code> and <code>weight</code> are born
- <ul>
- <li>Explicit hook naming
- <code class="codeblock">$module = array("help" => "<span class="high">box</span>_help",<br />
- "block" => "box_block",<br />
- "admin" => "box_admin");</code></li>
- <li>Hook registry, called <code>repository</code></li>
- <li>7 hooks : <code>admin <span class="high">block</span> cron export help page user</code></li>
- </ul>
- </li>
- </ul>
- </section>
- <section>
- <h3>Drupal 1.0</h3>
- <ul class="left">
- <li>Birth of the <code class="high">block</code> module
- <ul>
- <li>Separation : block vs custom block vs box</li>
- <li>Birth of regions, <code>header</code> and <code>footer</code> remain separate.</li>
- <li>User selection of optional blocks</li>
- </ul>
- </li>
- <li>“Classical” Drupal file layout:
- <ul>
- <li><code>includes/</code>, <code>modules/</code>, <code>scripts/</code>, <code>themes/</code></li>
- <li>New : <code>.htaccess</code> and <code>robots.txt</code></li>
- </ul>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 1 – block_help()</h2>
- <blockquote class="quote-small">
- <ul>
- <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>
- <li>They are either exported by the engine or by any of the available modules. […]</li>
- <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>
- <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>
- <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>
- </ul>
- </blockquote>
- <p class="right"><small>admin.php?mod=block&op=help</small></p>
- </section>
- <section>
- <h3>Drupal 1 – block_help()</h3>
- <blockquote class="quote-small">
- <ul>
- <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>
- <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>
- </ul>
- </blockquote>
- <p class="right"><small>admin.php?mod=block&op=help</small></p>
- <p>... but <code>Theme::box()</code> still exists !</p>
- </section>
- </section>
- <section>
- <h2>Drupal 1 – page cycle</h2>
- <ul class="left">
- <li>No front controller, but <code>module.php?mod=..</code></li>
- <li>Controller
- <ul>
- <li>loads shared functions from <code>common.inc</code>
- <ul>
- <li>configuration: <code>getenv("HTTP_HOST") .".conf";</code></li>
- <li>theme: <code>$theme = load_theme();</code></li>
- </ul>
- </li>
- <li>defines its action functions</li>
- <li>if variants exist, <code>switch ($op)</code>
- <ul>
- <li>invoke action functions based on <code>$op</code></li>
- </ul>
- </li>
- <li>action function
- <ul>
- <li>prepares its data</li>
- <li>requests view build from the theme:
- <ul>
- <li><code>$theme->header();</code></li>
- <li>multiple calls to <code>$theme->box()</code> on prepared data (account.php)
- – or less clean formatting... (search.php)</li>
- <li><code>$theme->footer();</code></li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </section>
- <section>
- <section>
- <h2>Drupal 1 – block placement</h2>
- <ul>
- <li>The block admin UI offers a choice of 3 layouts:
- <ul>
- <li>Left + Content</li>
- <li>Left + Content + Right</li>
- <li>Content + Right</li>
- </ul>
- </li>
- <li>Administrator decides which custom blocks to display in the <code>left</code> et <code>right</code> regions</li>
- <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>
- <li>Layouts are theme-independent</li>
- <li>The blocks table does not keep per-theme info</li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 1 – block overview</h2>
- <div class="illustration"><img src="images/drupal1-block-overview.png" alt="Drupal 1 Block override"></div>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 1: block hook</h2>
- <ul>
- <li>A single block hook: <code>hook_block()</code> returns a hash of:
- <ul>
- <li>Subject: displayed title</li>
- <li>Content: raw content, HTML, or PHP for <code>eval()</code></li>
- <li>Info: administrative title</li>
- <li>Link: URL, only displayed on the b.o.</li>
- </ul>
- </li>
- <li>Used both for administration and display</li>
- </ul>
- </section>
- <section>
- <h3>Drupal 1: block hook</h3>
- <ul>
- <li>Example : box.module<br />
- <code class="codeblock">function box_block() {<br />
- $result = db_query("SELECT * FROM boxes");<br />
- $i = 0;<br />
- while ($block = db_fetch_object($result)) {<br />
- $blocks[$i]["subject"] = check_output($block->subject);<br />
- $blocks[$i]["content"] = ($block->type == 2)
- <br />
- ? eval($block->content)<br />
- : check_output($block->content, ($block->type == 1) ? 0 : 1);<br />
- $blocks[$i]["info"] = check_output($block->info);<br />
- $blocks[$i]["link"] = check_output($block->link);<br />
- $i++;<br />
- }<br />
- return $blocks;<br />
- }</code>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 1: box theme</h2>
- <ul>
- <li><code><b>themes/marvin/marvin.theme</b></code><br /><span class="highlight">Themes are still PHP classes, but not located in <theme>.theme</span><br />
- <code class="codeblock">
- function box($subject, $content) { ?><br />
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" BGCOLOR="<? echo $this->brcolor1; ?>" WIDTH="100%"><br />
- <TR><TD><?<br />
- print "<TABLE BORDER=\"0\" CELLPADDING=\"3\" CELLSPACING=\"1\"
- WIDTH=\"100%\">";<br />
- print " <TR><TD ALIGN=\"center\" BGCOLOR=\"$this->bgcolor1\"
- NOWRAP><FONT COLOR=\"$this->fgcolor1\"><B><span class="high">$subject</span></B></FONT></TD></TR>";
- <br />
- print " <TR><TD BGCOLOR=\"$this->bgcolor2\"><span class="high">$content</span></TD></TR>";<br />
- print "</TABLE>";<br />
- ?><br />
- </TD></TR><br />
- </TABLE><BR><?<br />
- }</code>
- </li>
- <li>No longer any non-class theme functions</li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 1 – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>6.388 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>49950000 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>45530000 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>1565.36 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>6.388 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>0.639 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>7635.70 [Kbytes/sec] received</td>
- </tr>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.1</td>
- <td>0</td>
- <td>4</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>2</td>
- <td>6</td>
- <td>2.8</td>
- <td>6</td>
- <td>33</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>2</td>
- <td>6</td>
- <td>2.8</td>
- <td>6</td>
- <td>33</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>2</td>
- <td>6</td>
- <td>2.8</td>
- <td>6</td>
- <td>33</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 1 – <span class="lowercase">UnConeD</span> theme</h2>
- <p class="theme-name"><span class="lowercase">UnConeD</span></p>
- <div class="illustration"><img src="images/drupal1-account-site.png" alt="Drupal 1 Block override"></div>
- </section>
- </section>
- <section>
- <h1 class="chapter">Drupal 2</h1>
- <p class="release-date">15/03/2001 (2 months later)</p>
- <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;">
- </section>
- <section>
- <section>
- <h2>Drupal 2.0</h2>
- <ul>
- <li>Filtering of <span class="high">box</span> content climbs from the “model” to the controller
- <ul>
- <li>Filtering of <span class="high">block</span> is still on the “model”</li>
- </ul>
- </li>
- <li><span class="high">Block</span> <code>subject</code> is now translatable</li>
- </ul>
- </section>
- <section>
- <h3>Drupal 2.0</h3>
- <ul>
- <li>No significant changes on block/box
- <ul>
- <li>File Layout: birth of <code>misc/</code></li>
- <li>PHP “short tags” are dropped</li>
- <li>First dash of blue: pre-Druplicon “drop” in UnConeD turns blue</li>
- <li><code>Theme::abstract()</code> → <code>Theme::story()</code></li>
- <li><code>class Story extends Node {...}</code></li>
- <table class="new">
- <tr>
- <th rowspan="3">Newborns</th>
- <td>Locale</td>
- </tr>
- <tr>
- <td>First update script, only SQL</td>
- </tr>
- <tr>
- <td>CHANGELOG, CREDITS</td>
- </tr>
- </table>
- <table class="new">
- <tr>
- <th rowspan="2">Changes</th>
- <td>Comment, section, user ratings, permissions</td>
- </tr>
- <tr>
- <td>First optional module: submission</td>
- </tr>
- </table>
- </ul>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 2 – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>8.921 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>63570000 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>59190000 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>1120.93 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>8.921 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>0.892 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>6958.77 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.1</td>
- <td>0</td>
- <td>4</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>2</td>
- <td>9</td>
- <td>3.5</td>
- <td>8</td>
- <td>32</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>2</td>
- <td>9</td>
- <td>3.5</td>
- <td>8</td>
- <td>32</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>2</td>
- <td>9</td>
- <td>3.5</td>
- <td>8</td>
- <td>32</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 2 – <span class="lowercase">UnConeD</span> theme</h2>
- <p class="theme-name"><span class="lowercase">UnConeD</span></p>
- <div class="illustration"><img src="images/drupal2-diary.png" alt="Drupal 1 Block override"></div>
- </section>
- </section>
- <section>
- <h1 class="chapter">Drupal 3</h1>
- <p class="release-date">26/11/2001 (8 months later)</p>
- <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;">
- </section>
- <section>
- <section>
- <h2>Drupal 3.0.2</h2>
- <ul>
- <li><span class="high">Blocks</span> created by modules...
- <ul>
- <li>can now be disabled, optional, or required</li>
- <li>...just like <span class="high">boxes</span></li>
- <li>and appear in the regions preview</li>
- </ul>
- </li>
- <li>No significant changes for block/box
- <table class="new">
- <tr>
- <th rowspan="2">Newborns</th>
- <td>Node, file, (page) cache, <code>form_*()</code></td>
- </tr>
- <tr>
- <td>Front: fluid themes: Goofy, Jeroen, Yaroon, raw: Stone Age</td>
- </tr>
- </table>
- <table class="new">
- <tr class="tr-first">
- <th rowspan="5">Changes</th>
- <td>Hooks : <code>global $repository</code> → <code>function_exists()</code></td>
- </tr>
- <tr>
- <td>Druplicon looking straight ahead replaces the drop</td>
- </tr>
- <tr>
- <td>Section → meta and introduces hierarchy</td>
- </tr>
- <tr>
- <td>Faq → book and introduces hierarchy</td>
- </tr>
- <tr>
- <td><font> HTML element: 74 → 14</td>
- </tr>
- </table>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 3 – blocks configuration</h2>
- <div class="illustration downer"><img src="images/drupal3-blocks-configure.png" alt="Drupal 3 Block configuration 1"></div>
- </section>
- <section>
- <h3>Drupal 3 – blocks configuration</h3>
- <div class="illustration"><img src="images/drupal3-blocks-preview.png" alt="Drupal 3 Block configuration 2"></div>
- </section>
- <section>
- <h3>Drupal 3 – blocks configuration</h3>
- <div class="illustration"><img src="images/drupal3-blocks-optional.png" alt="Drupal 3 Block configuration 3"></div>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 3.0.2 – box theme</h2>
- <ul>
- <li>Default theme:
- <code class="codeblock">
- class Theme extends BaseTheme { /* ..snip.. */<br />
- function box($subject, $content, $region = "main") { ?><br />
- <TABLE><br />
- <TR><br />
- <TD><br />
- <DIV ALIGN="center"><br />
- <BIG><? echo $subject; ?></BIG><br />
- </DIV><br />
- <HR><br />
- </TD><br />
- </TR><br />
- <TR><br />
- <TD><br />
- <?php echo $content; ?><br />
- </TD><br />
- </TR><br />
- </TABLE><br />
- <BR><?php<br />
- } // close box function<br />
- }<br />
- </code>
- </li>
- </ul>
- </section>
- <section>
- <h3>Drupal 3.0.2 – box theme</h3>
- <ul>
- <li>And the base theme class...
- <code class="codeblock">
- class BaseTheme {/<br />
- function links(...) {...}<br />
- function image($name) {}<br />
- function comment_controls(...) {}<br />
- }<br />
- </code>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 3 – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>13.971 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>47793825 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>43413825 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>715.75 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>13.971 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>1.397 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>3340.65 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.1</td>
- <td>0</td>
- <td>5</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>4</td>
- <td>14</td>
- <td>4.6</td>
- <td>13</td>
- <td>44</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>4</td>
- <td>14</td>
- <td>4.6</td>
- <td>13</td>
- <td>44</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>4</td>
- <td>14</td>
- <td>4.6</td>
- <td>13</td>
- <td>44</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 3 – new themes</h2>
- <p class="theme-name">Goofy</p>
- <div class="illustration"><img src="images/drupal3-goofy.png" alt="Drupal 3 Goofy theme"></div>
- </section>
- <section>
- <h3>Drupal 3 – new themes</h3>
- <p class="theme-name">Jeroen</p>
- <div class="illustration"><img src="images/drupal3-jeroen.png" alt="Drupal 3 Jeroen theme"></div>
- </section>
- <section>
- <h3>Drupal 3 – new themes</h3>
- <p class="theme-name">Stoneage</p>
- <div class="illustration"><img src="images/drupal3-stoneage.png" alt="Drupal 3 Stoneage theme"></div>
- </section>
- <section>
- <h3>Drupal 3 – new themes</h3>
- <p class="theme-name">Yaroon</p>
- <div class="illustration"><img src="images/drupal3-yaroon.png" alt="Drupal 3 Yaroon theme"></div>
- </section>
- </section>
- <section>
- <h1 class="chapter">Drupal 4</h1>
- <p class="release-date">08/12/2002 (12 months later)</p>
- <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;">
- </section>
- <section>
- <section>
- <h2>Drupal 4.0</h2>
- <ul>
- <li><span class="high">block</span>/<span class="high">box</span> admin merge, box module removed</li>
- <li>Placement defined by <span class="high">block</span>, stores <code>region</code>/<code>weight</code>
- <ul>
- <li>Administrator-configured</li>
- <li>Automatic fallback from nonexistent region (left/right) to the other one</li>
- <li>Visibility defined by <span class="high">block</span>, path column (regex), vs themes/controllers</li>
- </ul>
- </li>
- <li>Content is defined by <span class="high">box</span>, with a choice of ASCII / HTML / PHP format</li>
- <li><code>BaseTheme::box()</code> provide a default <span class="high">box</span> theme implementation</li>
- </ul>
- </section>
- <section>
- <h3>Drupal 4.0</h3>
- <ul>
- <li>And elsewhere...
- <table class="new">
- <tr>
- <th rowspan="3">Newborns</th>
- <td>Default theme == Basic</td>
- </tr>
- <tr>
- <td>Node form switched to two columns, FO / BO forms differ</td>
- </tr>
- <tr>
- <td>XML-RPC, Useful Inc. version</td>
- </tr>
- </table>
- <table class="new">
- <tr class="tr-first">
- <th rowspan="6">Changes</th>
- <td>Meta/section/category → taxonomy/vocabulary/term</td>
- </tr>
- <tr>
- <td>Input format per node, in the extra table for each content type</td>
- </tr>
- <tr>
- <td>Front page is customized with PHP <code>eval</code></td>
- </tr>
- <tr>
- <td>More modules converted to generic module.php controller, but not all</td>
- </tr>
- <tr>
- <td>DB API based on PEAR:DB, supports PostgreSQL, SQL dump includes update</td>
- </tr>
- <tr>
- <td>Withdrawn themes: Dries, Jeroen; Stone Age → example</td>
- </tr>
- </table>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.0 – blocks admin/placement</h2>
- <div class="illustration"><img src="images/drupal4-block-admin.png" alt="Drupal 4 Block administration"></div>
- </section>
- <section>
- <h3>Drupal 4.0 – blocks admin/placement</h3>
- <div class="illustration"><img src="images/drupal4-block-preview.png" alt="Drupal 4 Block preview"></div>
- </section>
- <section>
- <h3>Drupal 4.0 – node form FO Basic</h3>
- <div class="illustration"><img src="images/drupal4-default.png" alt="Drupal 4 node form FO"></div>
- </section>
- <section>
- <h3>Drupal 4.0 – node form BO</h3>
- <div class="illustration"><img src="images/drupal4-admin.png" alt="Drupal 4 node form BO"></div>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4 – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>32.101 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>91560000 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>87140000 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>311.52 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>32.101 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>3.210 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>2785.42 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.1</td>
- <td>0</td>
- <td>3</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>9</td>
- <td>32</td>
- <td>11.6</td>
- <td>31</td>
- <td>225</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>9</td>
- <td>32</td>
- <td>11.5</td>
- <td>30</td>
- <td>222</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>9</td>
- <td>32</td>
- <td>11.6</td>
- <td>31</td>
- <td>225</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.1</h2>
- <p class="release-date">25/06/2003 (6 months later) *</p>
- <ul>
- <li>Conditional <span class="high">blocks</span> build: only if used</li>
- <li>Customizable blocks selection sorted by <code>module</code>/<code>delta</code>, not by name</li>
- <li>Block <code>name</code> (alias <code>$block->info</code>) withdrawn, meaning...
- <ul>
- <li><code>blocks</code> table no longer has a PK, or even an index</li>
- </ul>
- </li>
- <li>And elsewhere...
- <table class="new">
- <tr>
- <th>Newborns</th>
- <td>Profile</td>
- </tr>
- </table>
- <table class="new">
- <tr class="tr-first">
- <th rowspan="4">Changes</th>
- <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>
- </tr>
- </table>
- </li>
- </ul>
- <p class="note">* CHANGELOG claims 15/02/2003, but commits say 25/06/2003</p>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.1 – user block sorting</h2>
- <div class="illustration"><img src="images/drupal41-block-user.png" alt="Drupal 4 Block sorting"></div>
- </section>
- </section>
- <!-- BLOCK/THEME CODE SLIDE -->
- <section>
- <section>
- <h2>Drupal 4.1 – conditional build</h2>
- <ul>
- <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
- <code class="codeblock">
- functiontheme_blocks($region,&$theme){<br />
- global $user, $PHP_SELF;<br />
- $result = db_query("SELECT * FROM blocks WHERE (status = '1' OR custom =
- '1') ". ($region != "all" ? "AND region = '%s' " : "") ."ORDER BY weight, module", $region == "left" ? 0 : 1);<br />
- while ($result && ($block = db_fetch_object($result))) {<br />
- if (<br />
- ( ($block->status && (!$user->uid || !$block->custom)) || ($block->custom && $user->block[$block->module][$block->delta]))
- <span class="high">&& (!$block->path || preg_match("|$block->path|", $PHP_SELF))</span><br />
- ){<br />
- $block_data = module_invoke($block->module, "block", "view", $block->delta);<br />
- if ($block_data["content"]) {<br />
- $theme->box($block_data["subject"], $block_data["content"], $region);<br />
- }<br />
- }<br />
- }<br />
- }
- </code>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.1 – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>15.174 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>19590000 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>15170000 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>659.03 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>15.174 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>1.517 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>1260.79 [Kbytes/sec] received</td>
- </tr>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.1</td>
- <td>0</td>
- <td>5</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>5</td>
- <td>15</td>
- <td>4.9</td>
- <td>14</td>
- <td>70</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>5</td>
- <td>15</td>
- <td>4.9</td>
- <td>14</td>
- <td>70</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>5</td>
- <td>15</td>
- <td>4.9</td>
- <td>14</td>
- <td>70</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.2</h2>
- <p class="release-date">04/10/2003 (4.5 months later)</p>
- <ul>
- <li><span class="high">hook_block($op)</span> <code>$op = list|view</code></li>
- <li><span class="high">Block</span> <code>delta</code>: int → varchar(32)</li>
- <li>Block preview : “Themes with (right|left)-sidebar only...”</li>
- <li><code>t('messages from block.module code')</code></li>
- <li><code><span class="high">BaseTheme::box()</span></code> receives filtered content, no longer filters it itself</li>
- <li><code><span class="high">BaseTheme::block($subject, $content, $region = 'main')</span></code>
- <ul>
- <li>Simple wrapper for <code>BaseTheme::box()</code></li>
- <li>Separate in Xtemplate, invoked by <code>theme_blocks()</code> instead of <code>theme('box')</code></li>
- </ul>
- </li>
- </ul>
- </section>
- <section>
- <h3>Drupal 4.2</h3>
- <ul>
- <li>And elsewhere...
- <table class="new">
- <tr>
- <th rowspan="5">Newborns</th>
- <td>Support for Microsoft SQL Server</td>
- </tr>
- <tr>
- <td><code>index.php</code> front controller for “normal” paths</td>
- </tr>
- <tr>
- <td>Xtemplate, engine and base theme</td>
- </tr>
- <tr>
- <td><code>theme()</code> replaces <code>theme_invoke()</code></td>
- </tr>
- <tr>
- <td>Only <code>system.module</code> uses <code>$theme->foo()</code>, others use <code>theme('foo')</code></td>
- </tr>
- </table>
- <table class="new">
- <tr>
- <th rowspan="5">Changes</th>
- <td>Clean URLs</td>
- </tr>
- <tr>
- <td>WYSIWYG support (!)</td>
- </tr>
- <tr>
- <td>BO now integrated in the overall UI</td>
- </tr>
- <tr>
- <td>Themes: Goofy withdrawn, blue becomes more prevalent, first CSS fields</td>
- </tr>
- <tr>
- <td><code>register_globals = On</code> no longer needed</td>
- </tr>
- </table>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.2 – block admin</h2>
- <div class="illustration"><img src="images/drupal42-block-admin.png" alt="Drupal 4 Block admin page"></div>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.2 – BaseTheme::box()</h2>
- <ul>
- <li>Drupal 4.1
- <code class="codeblock">
- function box($subject, $content, $region = "main") {<br />
- $output = "<b>"<br />
- . check_output($subject)<br />
- ."</b><br />"<br />
- check_output($content)<br />
- ."<p />";<br />
- print $output;<br />
- }
- </code>
- </li>
- <li>Drupal 4.2
- <code class="codeblock">
- function box($subject, $content, $region = "main") {<br />
- $output = "<p><b>$subject</b><br />$content</p>";<br />
- print $output;<br />
- }<br />
- function block($subject, $content, $region = "main") {<br />
- global $theme;<br />
- $theme->box($subject, $content, $region);<br />
- }
- </code>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.2 – XTemplate</h2>
- <div class="illustration"><img src="images/drupal42-user.png" alt="Drupal 4 XTemplate"></div>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.2 – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>22.128 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>41080000 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>36510000 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>451.92 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>22.128 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>2.213 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>1812.97 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.1</td>
- <td>0</td>
- <td>6</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>6</td>
- <td>2</td>
- <td>7.6</td>
- <td>21</td>
- <td>154</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>6</td>
- <td>2</td>
- <td>7.6</td>
- <td>21</td>
- <td>154</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>6</td>
- <td>2</td>
- <td>7.6</td>
- <td>21</td>
- <td>154</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.3.x</h2>
- <p class="release-date">01/11/2003 (4 weeks later)</p>
- <ul>
- <li>UX: <code>admin/block</code> → <code>admin/system/block</code></li>
- <li>And elsewhere...
- <table class="new">
- <tr>
- <th></th>
- <td>Minor releases 4.3.0, 4.3.1, 4.3.2, 4.3.x unreleased HEAD until 02/2004</td>
- </tr>
- </table>
- <table class="new">
- <tr>
- <th rowspan="2">Newborns</th>
- <td>Alias</td>
- </tr>
- <tr>
- <td>DB prefixing using {}</td>
- </tr>
- </table>
- <table class="new">
- <tr>
- <th rowspan="2">Changes</th>
- <td>User object simplified</td>
- </tr>
- <tr>
- <td>Some controller actions start using <code>return</code> instead of <code>print</code></td>
- </tr>
- </table>
- </li>
- </ul>
- </section>
- <section>
- <h3>Drupal 4.3.x – Nothing</h3>
- <p>That's all for 4.3!</p>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.3 – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>15.036 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>39170000 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>34600000 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>6665.0659 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>15.036 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>1.504 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>2543.97 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.1</td>
- <td>0</td>
- <td>3</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>5</td>
- <td>15</td>
- <td>4.5</td>
- <td>14</td>
- <td>44</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>5</td>
- <td>15</td>
- <td>4.5</td>
- <td>14</td>
- <td>44</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>5</td>
- <td>15</td>
- <td>4.5</td>
- <td>14</td>
- <td>44</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.4.x</h2>
- <p class="release-date">01/04/2004 (2 months later)</p>
- <ul>
- <li><code><span class="high">theme_blocks()</span></code> delegates...
- <ul>
- <li>listing blocks to <code><span class="high">block_list()</span></code> instead of performing the request itself</li>
- <li>rendering to <code><span class="high">theme_block('view')</span></code> instead of invoking <code>hook_block('view')</code></li>
- </ul>
- </li>
- <li><code><span class="high">theme('box')</span></code> no longer implemented except in <code>theme.inc</code> and Xtemplate</li>
- <li>The lack of a PK on blocks is documented as “(bad)!”</li>
- </ul>
- </section>
- <section>
- <h3>Drupal 4.4.x</h3>
- <ul>
- <li>And elsewhere...
- <table class="new">
- <tr>
- <th rowspan="3">Performance</th>
- <td>Generic throttling with <code>throttle.module</code>: deactivation of modules or invididual functions</td>
- </tr>
- <tr>
- <td>Cached pages load less modules</td>
- </tr>
- <tr>
- <td>Locale only caches data below a size limit</td>
- </tr>
- </table>
- <table class="new">
- <tr>
- <th>Newborns</th>
- <td>Pushbutton</td>
- </tr>
- </table>
- <table class="new">
- <tr>
- <th rowspan="2">Changes</th>
- <td>Uniform use of <code>theme()</code>, theme_* functions and use of <code>return</code></td>
- </tr>
- <tr>
- <td>Marvin → Chameleon + subtheme</td>
- </tr>
- </table>
- <table class="new">
- <tr>
- <th rowspan="3">Removals</th>
- <td>Theme classes</td>
- </tr>
- <tr>
- <td>Microsoft SQL Server support</td>
- </tr>
- <tr>
- <td>Goofy</td>
- </tr>
- </table>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.4 – theme_blocks()</h2>
- <ul>
- <li>Drupal 4.3
- <ul>
- <li>cf Drupal 4.1: <code>db_query()</code> + complex test</li>
- </ul>
- </li>
- <li>Drupal 4.4
- <ul>
- <li>delegates to <code>block_list()</code>, <code>theme_block()</code></li>
- </ul>
- <code class="codeblock">
- function theme_blocks($region) {<br />
- $output = '';<br />
- <br />
- if ($list = module_invoke('block', 'list', $region)){<br />
- foreach ($list as $key => $block) {<br />
- // $key == <i>module</i>_<i>delta</i><br />
- $output .= theme('block', $block);<br />
- }<br />
- }<br />
- return $output;<br />
- }
- </code>
- </li>
- </ul>
- </section>
- <section>
- <h3>Drupal 4.4 – theme_block()</h3>
- <code class="codeblock left">
- function theme_block($block) {<br />
- $output = "<div class=\"block block-$block->module\"
- id=\"block-$block->module-$block->delta\">\n";<br />
- $output .= " <h2 class=\"title\">$block->subject</h2>\n";<br />
- $output .= " <div class=\"content\">$block-
- >content</div>\n";<br />
- $output .= "</div>\n";<br />
- return $output;<br />
- }
- </code>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.4 – Chameleon theme</h2>
- <p class="theme-name">Chameleon</p>
- <div class="illustration"><img src="images/drupal44-block-preview.png" alt="Drupal 4 Chameleon theme"></div>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.4 – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>20.207 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>34080000 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>29510000 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>494.87 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>20.207 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>2.021 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>1646.99 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.1</td>
- <td>0</td>
- <td>13</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>7</td>
- <td>20</td>
- <td>11.5</td>
- <td>19</td>
- <td>445</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>7</td>
- <td>20</td>
- <td>11.4</td>
- <td>19</td>
- <td>434</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>7</td>
- <td>20</td>
- <td>11.5</td>
- <td>19</td>
- <td>446</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.5</h2>
- <p class="release-date">18/10/2004 (6 months later)</p>
- <ul>
- <li>New blocks provided by comment, taxonomy</li>
- <li><code><span class="high">theme_(block|blocks|box)</span></code>: no changes</li>
- <li>And elsewhere...
- <table class="new">
- <tr>
- <th></th>
- <td>New menu system with caching, <code>hook_menu($may_cache)</code></td>
- </tr>
- <tr>
- <th></th>
- <td>Multiple roles per user</td>
- </tr>
- </table>
- <table class="new">
- <tr>
- <th>Newborns</th>
- <td>Bluemarine</td>
- </tr>
- </table>
- <table class="new">
- <tr>
- <th rowspan="3">Changes</th>
- <td>SQL: multiple connections, PostgreSQL no longer PEAR:DB</td>
- </tr>
- <tr>
- <td>Themes: refactoring engines, templates and styles, settings and screenshots; XTemplate and Pure themes withdrawn; XTemplate engine remains</td>
- </tr>
- <tr>
- <td>i18n: 100 % UI</td>
- </tr>
- </table>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.5 – Marvin</h2>
- <p class="theme-name">Marvin</p>
- <div class="illustration"><img src="images/drupal45-block-admin.png" alt="Drupal 4 Marvin theme"></div>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.5 – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>28.487 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>60070000 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>54620000 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>351.03 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>28.487 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>2.849 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>2059.24 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.1</td>
- <td>0</td>
- <td>3</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>8</td>
- <td>28</td>
- <td>7.5</td>
- <td>27</td>
- <td>195</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>8</td>
- <td>28</td>
- <td>7.5</td>
- <td>27</td>
- <td>195</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>8</td>
- <td>28</td>
- <td>7.5</td>
- <td>28</td>
- <td>195</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.6</h2>
- <p class="release-date">15/04/2005 (6 months later)</p>
- <ul>
- <li>New <span class="high">block</span> settings:
- <ul>
- <li><code>visibility</code>
- <ul>
- <li>Previously: everywhere or if matches regex</li>
- <li>4.6: on.. or except_on.. (but no PHP yet)</li>
- <li>Paths criteria decode aliases before being applied</li>
- </ul></li>
- <li><code>types</code>
- <ul>
- <li>On all node types or only on these...</li>
- </ul></li>
- </ul>
- </li>
- <li>New <code>hook_block() $op</code> values: <code>configure</code>, <code>save</code></li>
- <li><code>theme_(block|blocks|box)</code> unchanged</li>
- </ul>
- </section>
- <section>
- <h3>Drupal 4.6</h3>
- <ul>
- <li>And elsewhere...
- <table class="new">
- <tr>
- <td>Supports PHP 5, UTF-8 everywhere</td>
- </tr>
- <tr>
- <td>Home: 92ms without the page cache, 19ms with it...</td>
- </table>
- <table class="new">
- <tr>
- <th rowspan="">Newborns</th>
- <td>Contact, ImageAPI</td>
- </tr>
- </table>
- <table class="new">
- <tr>
- <th rowspan="">Changes</th>
- <td>First UX refactorings</td>
- </tr>
- </table>
- <table class="new">
- <tr>
- <th rowspan="2">Removals</th>
- <td>Admin controller <code>admin.php</code></td>
- </tr>
- <tr>
- <td>PEAR:DB abstraction></td>
- </tr>
- </table>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.6 – Block configuration</h2>
- <div class="illustration"><img src="images/drupal46-block-configure.png" alt="Drupal 4.6 Block configuration"></div>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.6 – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>18.530 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>920361989 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>916920711 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>539.67 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>18.530 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>1.853 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>48505.27 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.1</td>
- <td>0</td>
- <td>11</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>5</td>
- <td>18</td>
- <td>8.3</td>
- <td>17</td>
- <td>199</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>4</td>
- <td>13</td>
- <td>6.4</td>
- <td>12</td>
- <td>160</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>5</td>
- <td>18</td>
- <td>8.3</td>
- <td>17</td>
- <td>199</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.7</h2>
- <p class="release-date">01/05/2006 (11 months later)</p>
- <ul>
- <li>Placement: <span class="high">blocks</span> are now configured as placed in theme custom regions</li>
- <li>In core, regions are named, not numbered</li>
- <li>PHP visibility for blocks in addition to paths/types</li>
- <li>Input formats on <span class="high">box</span></li>
- <li><code>theme_(block|blocks|box)</code> unchanged</li>
- </ul>
- </section>
- <section>
- <h3>Drupal 4.7</h3>
- <ul>
- <li>And elsewhere...
- <table class="new">
- <tr>
- <th rowspan="4">Newborns</th>
- <td>PHPTemplate, replacing Xtemplate</td>
- </tr>
- <tr>
- <td>Maintenance mode</td>
- </tr>
- <tr>
- <td>JS: AJAX, collapse effect, textarea resize...</td>
- </tr>
- <tr>
- <td>Form API: arrays of arrays of arrays...</td>
- </tr>
- </table>
- <table class="new">
- <tr>
- <th rowspan="8">Changes</th>
- <td>“Loose caching” for pages, variables cache, data caching in modules (archive)</td>
- </tr>
- <tr>
- <td>Taxonomy: free tagging, global contact form</td>
- </tr>
- <tr>
- <td>Bluemarine and Pushbutton converted to PHPTemplate</td>
- </tr>
- <tr>
- <td>Content moderation withdrawn</td>
- </tr>
- <tr>
- <td>Upgrade path can be extended by modules</td>
- </tr>
- <tr>
- <td>XML-RPC new version</td>
- </tr>
- <tr>
- <td>SQL: PostgreSQL stored procedures removed</td>
- </tr>
- <tr>
- <td>Queue module withdrawn (moderation, not queueing)</td>
- </tr>
- </table>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.7 – block templates</h2>
- <ul>
- <li>Bluemarine 4.6 XTemplate
- <code class="codeblock">
- <!-- BEGIN: block --><br />
- <div class="block block-{module}" id="block-{module}-{delta}"><br />
- <h2 class="title">{title}</h2><br />
- <div class="content">{content}</div><br />
- </div><br />
- <!-- END: block -->
- </code>
- </li>
- <li>Bluemarine 4.7 PHPTemplate
- <code class="codeblock">
- <div class="<?php print "block block-$block->module" ?>" id="<?php<br />
- print "block-$block->module-$block->delta"; ?>"><br />
- <h2><?php print $block->subject ?></h2><br />
- <div class="content"><?php print $block->content ?></div><br />
- </div>
- </code>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.7 – custom blocks</h2>
- <div class="illustration"><img src="images/drupal47-box.png" alt="Drupal 4 Custom block page"></div>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 4.7 – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>10.249 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>53820228 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>48630000 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>975.74 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>10.249 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>1.025 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>5128.37 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.1</td>
- <td>0</td>
- <td>3</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>3</td>
- <td>10</td>
- <td>3.6</td>
- <td>10</td>
- <td>82</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>3</td>
- <td>10</td>
- <td>3.6</td>
- <td>10</td>
- <td>82</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>3</td>
- <td>10</td>
- <td>3.6</td>
- <td>10</td>
- <td>84</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <h1 class="chapter">Drupal 5</h1>
- <p class="release-date">15/01/2007 (8 months later)</p>
- <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;">
- </section>
- <section>
- <section>
- <h2>Drupal 5.0</h2>
- <ul>
- <li><span class="high">Block</span> visibility by role</li>
- <li><code>hook_block('view')</code> may not return a title, it uses the one <code>from
- block_list()</code>, passing it to <code>check_plain()</code></li>
- <li><code>theme_(block|blocks|box)</code> unchanged</li>
- <li>Blocks preview merged into the blocks admin form</li>
- </ul>
- </section>
- <section>
- <h3>Drupal 5.0</h3>
- <ul>
- <li>And elsewhere...
- <table class="new">
- <tr>
- <th rowspan="5">Newborns</th>
- <td>Localized installer replaces dump loading</td>
- </tr>
- <tr>
- <td>Install profiles</td>
- </tr>
- <tr>
- <td><code>.info</code> files for modules, dependencies</td>
- </tr>
- <tr>
- <td>jQuery 1.0.4</td>
- </tr>
- <tr>
- <td>Themes: Garland, Minelli, color.module, admin theme concept, module CSS</td>
- </tr>
- </table>
- <table class="new">
- <tr>
- <th rowspan="6">Changes</th>
- <td>Performance: sessions (in Memcached), node_access, fast404, aggressive page cache</td>
- </tr>
- <tr>
- <td>52 ms no cache, 7 ms normal cache, 5 ms aggressive cache</td>
- </tr>
- <tr>
- <td>File layout: 1 directory per core module, <code>sites/all</code> introduced</td>
- </tr>
- <tr>
- <td>Cache plugins, multiple cache bins</td>
- </tr>
- <tr>
- <td>Status page, mail altering, uninstallable modules, bulk operations on users/nodes</td>
- </tr>
- <tr>
- <td>PHPTemplate override</td>
- </tr>
- </table>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 5 – block admin + preview</h2>
- <div class="illustration"><img src="images/drupal5-block-preview.png" alt="Drupal 5 Block preview"></div>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 5 – per-role visibility</h2>
- <div class="illustration"><img src="images/drupal5-block-configure.png" alt="Drupal 5 Block visibility"></div>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 5.0 – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>5.523 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>47180102 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>41720000 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>1810.69 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>5.523 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>0.552 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>8342.63 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.0</td>
- <td>0</td>
- <td>1</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>2</td>
- <td>5</td>
- <td>3.6</td>
- <td>5</td>
- <td>110</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>2</td>
- <td>5</td>
- <td>3.6</td>
- <td>5</td>
- <td>110</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>2</td>
- <td>5</td>
- <td>3.6</td>
- <td>5</td>
- <td>111</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <h1 class="chapter">Drupal 6</h1>
- <p class="release-date">13/02/2008 (13 months later)</p>
- <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;">
- </section>
- <section>
- <section>
- <h2>Drupal 6.0</h2>
- <ul>
- <li><span class="high">Block</span> cache</li>
- <li><code><span class="high">theme_block()</span></code> → <code>modules/system/<span class="high">block.tpl.php</span></code></li>
- <li><code><span class="high">theme_(box|blocks)</span></code> unchanged, <code><span class="high">box.tpl.php</span></code> still exists</li>
- <li>Per-page <span class="high">block</span> visibility refactored to <code><span class="high">drupal_match_path()</span></code></li>
- <li><span class="high">{blocks}</span> surrogate PK on <code>bid</code>, unique index on <code>module/delta/theme</code></li>
- </ul>
- </section>
- <section>
- <h3>Drupal 6.0</h3>
- <ul>
- <li>And elsewhere...
- <table class="new">
- <tr>
- <th rowspan="">Newborns</th>
- <td><code>hook_watchdog</code>, syslog</td>
- </tr>
- </table>
- <table class="new">
- <tr>
- <th rowspan="7">Changes</th>
- <td>47 ms no cache, 46 ms block cache, 6.5 ms normal cache, 5.9 ms aggressive page cache</td>
- </tr>
- <tr>
- <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>
- </tr>
- <tr>
- <td>Quality: E_ALL, UX, core = 6.x, batch API, HTML Corrector</td>
- </tr>
- <tr>
- <td>Deployment: scripts/drupal.sh (think Drush)</td>
- </tr>
- <tr>
- <td>Security: php.module, weak password check, OpenID, update</td>
- </tr>
- <tr>
- <td>Themes: .info, templates no longer need a matching function, preprocess hooks, jQuery 1.2.3</td>
- </tr>
- <tr>
- <td>i18n: RTL, language detection, content translation, alias, JS UI</td>
- </tr>
- </table>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 6.0 – block cache</h2>
- <div class="illustration"><img src="images/drupal6-block-cache.png" alt="Drupal 6 Block cache"></div>
- </section>
- <section>
- <h3>Drupal 6.0 – block cache</h3>
- <div class="illustration downer"><img src="images/drupal6-no-block-cache.png" alt="Drupal 6 Block cache"></div>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 6 – cache + block throttling</h2>
- <code class="codeblock left" style="font-size: 0.5em;">
- if ($block->enabled && $block->page_match) {<br />
- // Check the current throttle status and see if block should be displayed<br />
- // based on server load.<br />
- if (!($block->throttle && (module_invoke('throttle', 'status') > 0))) {<br />
- // Try fetching the block from cache. Block caching is not compatible with<br />
- // node_access modules. We also preserve the submission of forms in blocks,<br />
- // by fetching from cache only if the request method is 'GET'.<br />
- if (!count(module_implements('node_grants'))<br />
- && $_SERVER['REQUEST_METHOD'] == 'GET'<br />
- && ($cid = _block_get_cache_id($block))<br />
- && ($cache = cache_get($cid, 'cache_block'))) {<br />
- $array = $cache->data;<br />
- }<br />
- else {<br />
- $array = module_invoke($block->module, 'block', 'view', $block->delta);<br />
- if (isset($cid)) {<br />
- cache_set($cid, $array, 'cache_block', CACHE_TEMPORARY);<br />
- }<br />
- }<br />
- } /* ... snip ... */<br />
- }
- </code>
- <p class="left"><span class="highlight">Q1: Why?</span><span class="highlight">Q2: What's in a cid?</span></p>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 6.0 – cache rules</h2>
- <code class="codeblock left two-columns-left" style="font-size: 0.5em;">
- * The block cache is cleared in <br />
- * cache_clear_all(), and uses the same <br />
- * clearing policy than page cache <br />
- * (node, comment, user, taxonomy added <br />
- * or updated...). Blocks requiring more <br />
- * fine-grained clearing might consider <br />
- * disabling the built-in block cache <br />
- * (BLOCK_NO_CACHE) and <b>roll their own</b>.<br />
- *<br />
- * <b>user 1 is excluded from block <br />
- * caching.</b> */<br />
- <br />
- /* This setting should be used:<br />
- * - for <b>simple blocks</b> (notably those <br />
- * that do
- not perform any db query), <br />
- * where <span class="high">querying the db cache would be <br />
- * more expensive than directly <br />
- * generating the content</span>.<br />
- * - for blocks that change too <br />
- * frequently.<br />
- */<br />
- define('BLOCK_NO_CACHE', -1);<br />
- </code>
- <code class="codeblock left two-columns-right" style="font-size: 0.5em;">
- /* This is the default setting, used when the block does not specify anything. */<br />
- define('BLOCK_CACHE_PER_ROLE', 0x0001);<br />
- <br />
- /* The block can change depending on the user viewing the page. <b>Can be resource-consuming</b> for sites with many users */<br />
- define('BLOCK_CACHE_PER_USER', 0x0002);<br />
- <br />
- /* The block can change depending on the page being viewed. */<br />
- define('BLOCK_CACHE_PER_PAGE', 0x0004);<br />
- <br />
- /* The block is the same for every user on every page where it is visible. */<br />
- define('BLOCK_CACHE_GLOBAL', 0x0008);
- <br />
- </code>
- <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>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 6.0 – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>4.690 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>3230000 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>0 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>2132.20 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>4.690 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>0.469 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>672.56 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.0</td>
- <td>0</td>
- <td>1</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>1</td>
- <td>5</td>
- <td>2.3</td>
- <td>4</td>
- <td>50</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>1</td>
- <td>5</td>
- <td>2.3</td>
- <td>4</td>
- <td>50</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>1</td>
- <td>5</td>
- <td>2.3</td>
- <td>4</td>
- <td>51</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <h1 class="chapter">Drupal 7</h1>
- <p class="release-date">05/01/2011 (35 months later)</p>
- <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;" />
- </section>
- <section>
- <section>
- <h2>Drupal 7.0</h2>
- <ul>
- <li><code>hook_block($op) → hook_block_(info|configure|save|view)</code></li>
- <li><code>hook_block_(info|list|view[_MODULE_DELTA])_alter</code></li>
- <li><code>block['content']</code> render array => cache cid without theme/language</li>
- <li><code>block_custom.body</code> translatable</li>
- <li><code>block_custom.format</code> int → varchar(255)</li>
- <li><code>block.api.php</code>, <code>block.test</code>, <code>block.js</code> (vertical tabs, d'n'd)</li>
- <li><code>block_theme()</code> declares <code>block</code>, not just <code>block_admin_display_form</code></li>
- <li><code>BLOCK_CACHE_*</code> → <code>DRUPAL_CACHE_*</code></li>
- <li><code>{blocks}</code> → <code>{block}</code>, <code>{boxes}</code> → {block_custom}</code></code></li>
- </ul>
- </section>
- <section>
- <h3>Drupal 7.0</h3>
- <ul>
- <li>Permissions:
- <ul>
- <li><code>- use PHP for block visibility</code></li>
- <li><code>+ administer blocks</code></li>
- </ul>
- </li>
- <li>UI:
- <ul>
- <li><code>block</code> integration with <code>contextual</code>, vertical tabs, local actions</li>
- <li>Generic regions: <span class="high">block</span> placement in <code>content</code>, <code>help</code>...</li>
- <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>
- <li>Regions preview again separated from block admin, without the blocks themselves</li>
- </ul>
- </li>
- </ul>
- </section>
- <section>
- <h3>Drupal 7.0</h3>
- <ul>
- <li>Theme:
- <ul>
- <li><code>theme_box()</code> RIP – <span class="high">box concept removed</span></li>
- <li>Block template suggestions</li>
- <li>Process</li>
- </ul>
- </li>
- <li><code>(block).throttle</code> RIP</li>
- <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>
- <li>Visibility:
- <ul>
- <li>Invalidates inconsistent visibility, like no page allows (positif/negative)</li>
- <li>PHP: <code>module_exists('php')</code></li>
- </ul>
- </li>
- </ul>
- </section>
- <section>
- <h3>Drupal 7.0</h3>
- <ul>
- <li><code>hook_modules_uninstalled()</code> enables block to clean blocks created by other modules</li>
- <li>Alternative: <code>drupal_set_content</code> → <code>drupal_add_region_content</code></li>
- <li>And elsewhere...
- <table class="new">
- <tr>
- <th></th>
- <td>Entity API, Field API, EFQ, DBTNG, render arrays</td>
- </tr>
- <tr>
- <th></th>
- <td>More caches and one-off plugins</td>
- </tr>
- <tr>
- <th></th>
- <td>i18n: field translation</td>
- </tr>
- <tr>
- <th></th>
- <td>Theme: Bartik, Corolla, Seven; return of the raw theme: Stark</td>
- </tr>
- </table>
- </li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 7 – block preview</h2>
- <div class="illustration"><img src="images/drupal7-preview.png" alt="Drupal 7 Block preview"></div>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 7.0 – ab -n10000 -c10 (home)</h2>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>6.223 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>63250000 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>58260000 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>1606.99 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>6.223 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>0.622 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>9926.00 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.1</td>
- <td>0</td>
- <td>4</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>2</td>
- <td>6</td>
- <td>2.3</td>
- <td>6</td>
- <td>29</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>2</td>
- <td>6</td>
- <td>2.3</td>
- <td>6</td>
- <td>29</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>2</td>
- <td>6</td>
- <td>2.3</td>
- <td>6</td>
- <td>29</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <h1 class="chapter">Drupal 8</h1>
- <p class="release-date">02/2014? (37 months later)</p>
- <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;">
- </section>
- <section>
- <section>
- <h2>Drupal 8.0</h2>
- <ul class="left two-columns-left" style="width: 35%;">
- <li>Assetic</li>
- <li>Composer</li>
- <li>Doctrine: annotations</li>
- <li>EasyRDF</li>
- <li>Guzzle</li>
- <li>PHPUnit</li>
- <li>PSR/3</li>
- </ul>
- <ul class="left two-columns-right" style="width: 55%;">
- <li>Symfony 2</li>
- <li>Symfony CMF: routing (chain router)</li>
- <li>Twig</li>
- <li>Zend Framework 2: escaper, feed, stdlib</li>
- <li>Plus some Drupal to wrap it up... ;-)</li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 8 – just the basics...</h2>
- <ul>
- <li><code>hook_block_info()</code> → Doctrine annotation on the block class</li>
- <li><code>hook_block_view()</code> → <code>BlockPluginInterface::build()</code></li>
- <li><code>hook_block_configure()</code> → <code>BlockPluginInterface::blockForm()</code></li>
- <li><code>hook_block_save()</code> → <code>BlockPluginInterface::blockSubmit()</code></li>
- <li>New methods:
- <ul>
- <li><code>BlockPluginInterface::access()</code>: block visibility</li>
- <li><code>BlockPluginInterface::settings()</code>: default configuration <br>(à la Views <code>option_definition</code>)</li>
- <li><code>BlockPluginInterface::validate()</code>: validation before submit</li>
- </ul>
- </li>
- <li>Derivative blocks</li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 8 – block "online users"</h2>
- <code class="codeblock left two-columns-left" style="width: 38.5%; font-size: 0.42em;">
- <?php<br />
- /**<br />
- * @file<br />
- * Contains \Drupal\user\Plugin\Block<br /> * \UserOnlineBlock.<br />
- */<br />
- <br />
- namespace Drupal\user\Plugin\Block;<br />
- <br />
- use Drupal\block\BlockBase;<br />
- use Drupal\Component\Annotation\Plugin;<br />
- use Drupal\Core\Annotation\Translation;<br />
- <br />
- /**<br />
- * Provides a "Who's online" block.<br />
- *<br />
- * @Plugin(<br />
- * id = "user_online_block",<br />
- * admin_label = @Translation("Who's <br />
- * online"),<br />
- * module = "user"<br />
- * )<br />
- */<br />
- </code>
- <code class="codeblock left two-columns-right" style="width: 56.5%; font-size: 0.42em;">
- class UserOnlineBlock extends BlockBase {<br />
- //** Overrides \Drupal\block\BlockBase::settings().<br />
- public function settings() { /* ... */ }<br />
- <br />
- //** Overrides \Drupal\block\BlockBase::access().<br />
- public function access() { /* ... */ }<br />
- <br />
- //** Overrides \Drupal\block\BlockBase::blockForm().<br />
- public function blockForm($form, &$form_state) <br />
- { /* ... */ }<br />
- <br />
- //** Overrides \Drupal\block\BlockBase::blockSubmit().<br />
- public function blockSubmit($form, &$form_state) <br />
- { /* ... */ }<br />
- <br />
- /**<br />
- * {@inheritdoc}<br />
- */<br />
- public function build() { }<br />
- }
- </code>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 8.0 – Block statistics</h2>
- <table class="compare-table six">
- <thead>
- <tr>
- <th>Drupal 6</th>
- <td>PHP</td>
- <td>JavaScript</td>
- <td></td>
- </tr>
- </thead>
- <tbody>
- <tr>
- <th></th>
- <td>3 files</td>
- <td>1 file</td>
- <td></td>
- </tr>
- <tr>
- <th></th>
- <td>329 comment lines</td>
- <td>20 comment lines</td>
- <td></td>
- </tr>
- <tr>
- <th></th>
- <td>651 code lines</td>
- <td>65 code lines</td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <table class="compare-table seven">
- <thead>
- <tr>
- <th>Drupal 7</th>
- <td>PHP</td>
- <td>JavaScript</td>
- <td></td>
- </tr>
- </thead>
- <tbody>
- <tr>
- <th></th>
- <td>8 files</td>
- <td>1 file</td>
- <td></td>
- </tr>
- <tr>
- <th></th>
- <td>1148 comment lines</td>
- <td>31 comment lines</td>
- <td></td>
- </tr>
- <tr>
- <th></th>
- <td>1746 code lines</td>
- <td>105 code lines</td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <table class="compare-table eight">
- <thead>
- <tr>
- <th>Drupal 8</th>
- <td>PHP</td>
- <td>JavaScript</td>
- <td>YAML</td>
- </tr>
- </thead>
- <tbody>
- <tr>
- <th></th>
- <td>85 files</td>
- <td>3 files</td>
- <td>17 files</td>
- </tr>
- <tr>
- <th></th>
- <td>3443 comment lines</td>
- <td>66 comment lines</td>
- <td>2 comment lines</td>
- </tr>
- <tr>
- <th></th>
- <td>5089 code lines</td>
- <td>170 code lines</td>
- <td>428 data lines</td>
- </tr>
- </tbody>
- </table>
- <p class="left"><span class="highlight" style="margin-left: 0;">Drupal 3 = 5622 PHP LoC</span></p>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 8 – UI</h2>
- <ul>
- <li>New administration UI:
- <ul>
- <li>No kilometer-high list of unused blocks</li>
- <li>Add block page for new blocks
- <ul>
- <li>Optionally filtered by module</li>
- <li>With search form</li>
- </ul>
- </li>
- </ul>
- </li>
- <li>Simplified configuration form</li>
- </ul>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 8 – block admin</h2>
- <div class="illustration"><img src="images/drupal8-placement.png" alt="Drupal 8 Block administration page"></div>
- </section>
- </section>
- <section>
- <section>
- <h2>Drupal 8 – block add</h2>
- <div class="illustration"><img src="images/drupal8-add.png" alt="Drupal 8 Block administration page"></div>
- </section>
- </section>
- <section>
- <section>
- <h3>Drupal 8.0 – ab -n10000 -c10 (home)</h3>
- <p>Default classloader</p>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>46.494 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>85030000 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>80260000 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>215.08 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>46.494 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>4.649 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>1785.98 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.0</td>
- <td>0</td>
- <td>3</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>14</td>
- <td>46</td>
- <td>14.9</td>
- <td>45</td>
- <td>276</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>14</td>
- <td>46</td>
- <td>14.9</td>
- <td>45</td>
- <td>276</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>14</td>
- <td>46</td>
- <td>14.9</td>
- <td>45</td>
- <td>276</td>
- </tr>
- </table>
- </code>
- </section>
- <section>
- <h2>Drupal 8.0 – ab -n10000 -c10 (home)</h2>
- <p>APC classloader</p>
- <code class="left ab">
- <table>
- <tr>
- <td>Concurrency Level:</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Time taken for tests:</td>
- <td>40.986 seconds</td>
- </tr>
- <tr>
- <td>Complete requests:</td>
- <td>10000</td>
- </tr>
- <tr>
- <td>Total transferred:</td>
- <td>85030000 bytes</td>
- </tr>
- <tr>
- <td>HTML transferred:</td>
- <td>80260000 bytes</td>
- </tr>
- <tr class="high">
- <td>Requests per second:</td>
- <td>273.78 [#/sec] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>36.526 [ms] (mean)</td>
- </tr>
- <tr class="high">
- <td>Time per request:</td>
- <td>3.653 [ms] (mean, across all concurrent requests)</td>
- </tr>
- <tr>
- <td>Transfer rate:</td>
- <td>2273.40 [Kbytes/sec] received</td>
- </tr>
- </table>
- <table>
- <tr>
- <td colspan="2">Connection Times (ms)</td>
- </tr>
- <tr>
- <td> </td>
- <td>min </td>
- <td>mean </td>
- <td>[+/-sd] </td>
- <td>median </td>
- <td>max </td>
- </tr>
- <tr>
- <td>Connect:</td>
- <td>0</td>
- <td>0</td>
- <td>0.0</td>
- <td>0</td>
- <td>1</td>
- </tr>
- <tr>
- <td>Processing:</td>
- <td>11</td>
- <td>36</td>
- <td>10.6</td>
- <td>35</td>
- <td>99</td>
- </tr>
- <tr>
- <td>Waiting:</td>
- <td>10</td>
- <td>36</td>
- <td>10.6</td>
- <td>35</td>
- <td>99</td>
- </tr>
- <tr>
- <td>Total:</td>
- <td>10</td>
- <td>36</td>
- <td>10.6</td>
- <td>35</td>
- <td>99</td>
- </tr>
- </table>
- </code>
- </section>
- </section>
- <section>
- <section>
- <h2>ms/<anonymous home></h2>
- <div class="diagramme"><img src="images/ms-anonymous-home-13I24.png" alt="Drupal"></div>
- <p class="caption">PHP 5.3.10, MySQL 5.5, APC 3.1.9, aggressive Cache, D8 APC Classloader</p>
- </section>
- <section class="full">
- <div class="diagramme-full"><img src="images/ms-anonymous-home-13I24.png" alt="Drupal"></div>
- <p class="caption">PHP 5.3.10, MySQL 5.5, APC 3.1.9, aggressive Cache, D8 APC Classloader</p>
- </section>
- </section>
- <section>
- <img src="osinet.png" class="cover-img" style="height: 150px;" />
- <div class="cover-osi">
- <h3>Thank you!</h3>
- <p>Any questions?</p>
- <img src="images/druplicon-glow.png" class="cover-img" style="height: 200px;" />
- </div>
- </section>
- <section>
- <img src="osinet.png" class="cover-img" style="height: 150px;" />
- <h3 class="people blue" style="text-align: center;">Come and say hello!</h3>
- <table class="people">
- <tr class="blue">
- <td>Frédéric G. Marand (<a href="http://drupal.org/user/27985">fgm</a>)</td>
- <td class="td-middle">Outi Munter (<a href="http://drupal.org/user/1629998">Outi</a>)</td>
- <td>Brigitte Taïeb (<a href="https://drupal.org/user/2255702">brigtai</a>)</td>
- </tr>
- <tr>
- <td><img src="images/fgm-dublin.jpg" class="cover-img"></td>
- <td class="td-middle"><img src="images/outi-2.jpg" class="cover-img"></td>
- <td><img src="images/brigitte.jpg" class="cover-img"></td>
- </tr>
- <tr style="font-size: 0.78em; opacity: 0.8;">
- <td>Let's take a look at your code!</td>
- <td class="td-middle">I design and theme for you.</td>
- <td>I can talk business.</td>
- </tr>
- </table>
- <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>
- </section>
- <section data-background="images/background-prague.png">
- <img src="images/logo-prague.png" class="cover-img" style="height: 150px; margin-bottom: 2em;">
- <p class="custom inverse">WHAT DID YOU THINK?</p>
- <p class="custom inverse">Locate this session at the DrupalCon Prague website:</p>
- <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>
- <p class="custom inverse">Click the "Take the survey" link</p>
- <p class="custom inverse">THANK YOU!</p>
- </section>
- <!-- ################################### END LATEST SLIDE ################################### -->
- </div>
- <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>
- </div>
- <script src="lib/js/head.min.js"></script>
- <script src="js/reveal.min.js"></script>
- <script>
- // Full list of configuration options available here:
- // https://github.com/hakimel/reveal.js#configuration
- Reveal.initialize({
- controls: true,
- progress: true,
- history: true,
- center: false,
- theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
- transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
- // Optional libraries used to extend on reveal.js
- dependencies: [
- { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
- { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
- { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
- { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
- { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
- { src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
- ]
- });
- </script>
- </body>
- </html>
|