- 2014-03-27: MongoDB Watchdog module ported to Drupal 8 at the Szeged Dev Days.
- 2014-01-26: My post on the Symfony web profiler in Silex selected in Week of Symfony. w00t !
- 2013-09-20 to 29: Working on Drupal 8 EntityAPI at the extended code sprints during and around DrupalCon Prague
- 2012-08-19: Working on Drupal 8 EntityAPI at Drupalcon Munich
- 2012-06-15: Working on Drupal 8 EntityAPI at DrupalDevDays Barcelona
- 2012-03-23: Working on the future Drupal Document Oriented Storage at DrupalCon Denver. D8 or later ?
Bets are onLater
Grokking Drupal, Drupal tips and tricks, DRUPAL-4-7, DRUPAL-5, DRUPAL-4-6, DRUPAL-6, drupal, DRUPAL-7, drupalcon, DRUPAL-8, DrupalDevDays
A few days ago, while I was writing a bit of Silex code and grumbling at Doctrine DBAL's lack of support for a SQL Merge operation, I wondered if it wouldn't be possible to use DBTNG without the rest of Drupal.
Obviously, although DBTNG is described as having been designed for standalone use:
DBTNG should be a stand-alone library with no external dependences other than PHP 5.2 and the PDO database library, in actual use, the Github DBTNG repo has seen no commit in the last 3 years, and the D8 version is still not a Drupal 8 "Component" (i.e. decoupled code), but still a plain library with Drupal dependencies. How would it fare on its own ? Let's give it a try...
So, since I always supported PSR-4 in FIG discussions, and after the tl;dr discussion about it regarding autoloading in Drupal 8, I jumped on the occasion and converted the code base for PlusVite to PSR-4 to get an idea of how PSR-4 "felt" in practice.
So DrupalCon Prague is almost over, and I can now share with you the video of my session about the history of the Drupal block system, from drop.org to Drupal 8, just as recorded on wednesday.
The session page is available on https://prague2013.drupal.org/session/blocks-drop.org-drupal-8-and-beyond where you can also rate it. Please to it over there, or add your comments here: it is very useful for me to see what needs to be adjusted for upcoming presentations. Based on the overall feedback, it seems that:
These last few days, I had noticed a problem with Drush Make and patches: some patches, be they rolled by our team or from elsewhere, would apply without a glitch, but some others, which worked normally according to the test bot on Drupal.org, would fail to apply without any obvious reason.
I had mostly put it out of my list of pressing issues when I really had to use an old version of OpenLayers, 7.x-2.0-alpha2 to be specific, AND apply a patch fixing one of the bugs in that module: behaviors plugin not being located correctly (http://drupal.org/node/1898662 if you want details). So I rolled the patch, tested it locally, the qa.d.o bot applied it and did not report more errors than expected for that old version.... and my Drush Make install refused to apply it.
Here was the relevant excerpt:
projects[domain] = 3.7
projects[domain][patch] = "http://drupal.org/files/domain-foreach_argument-1879502-1.patch"
projects[openlayers] = 2.0-alpha2
projects[openlayers][patch] = "http://drupal.org/files/0001-Fix-the-path-file-declaration-for-behaviors.patch"
The Domain patch applied normally, but the OpenLayers patch would't apply. What could be wrong ?
Continuing this exploration of logging solutions used in various projects, let's look at logging in Kohana 3.
While Monolog and log4php share a mostly common logging model of a frontal Logger object instantiated as many times as needed to supply different logging channels, in which log events are Processed/Filtered then written out by Handlers/Writers, Kohana builds upon a simpler model, which can be summarized by three patterns:
- Singleton: there is only one instance of the Kohana
Log_Writerinstances are attached (and detached) to(/from) the logger instance and handle events they are interested in based on their own configuration. Much like a Drupal hook, all writer instances receive each
- Delegation: the
write()to trigger the buffered writing, but does not implement it itself, but delegates to the
Log_Writerobjects to perform it. Buffered logging control is a
Logproperty, not a
It is based on the famous log4j package from the Java world, and from uses of this package I have seen on customer sites, I feel that it carries a lot of useless baggage, and is - in my opinion - significantly less of a good match than Monolog for Drupal 8.
Monolog vs log4php : equivalences
There is some degree of equivalence between the Monolog and log4php components:
|Log an event||Logger||Logger||Very similar|
|Store an event||Handler||Appender||both can be chained, group, control bubbling (Monolog) / filtering (log4php)|
|Format an event representation||Formatter||Layout||log4php layouts can format a group of events, Monolog formatters format an individual event|
|Massage event data||Processor||Renderer||Not so similar. Monolog processors will often add extra data, while log4php Renderers are typically used to format non-string events as strings.|
I've been discussing Monolog in Drupal events (DrupalCamp Lyon, DevDays Barcelona) as a possible alternative to the legacy Drupal
watchdog() service for quite some time, but never took the time to explain it in writing, and the feature freeze date is looming ahead, so since I'm taking part in th Gent code sprint, and code has been starting to take shape
here is an overview of the Monolog classes.
The diagram below is a simplified version of the Monolog architecture. It includes all classes and interfaces, but only the most significant methods, no constants, and none of the non-bundled classes and interfaces upon which some of the builtins depend.
If you have been wondering about the general organization of Field API in D8 and did not take time to work yched's existing D8 Field API sandbox, here is a simplified and cleaned-up version of the currently envisioned class and interface set.
Coming back from yesterday's first Drupal 8 core code sprint in Paris with lifted spirits from the event, I has a rather disturbing surprise awaiting me on this Drupal (and music) blog: there, on the comment approval queue, stood a single comment on an old blog post for Planet Drupal, authored by someone supposedly called "Johnson" and supposedly writing from "firstname.lastname@example.org":