Software
Victor Kane: Super simple example of local drush alias configuration
So I have a folder for drush scripts _above_ several doc root folders on a dev user's server. And I want to run status or whatever and my own custom drush scripts on _different_ Drupal web app instances. Drush has alias capability for different site instances, so you can do:
$ drush @site1 status
So, how to set up an aliases file?
(I'm on Ubuntu with Drush 6.2.0 installed with PEAR as per this great d.o. doc page Installing Drush on Any Linux Server Out There (Kalamuna people, wouldn't you know it?)).
Careful reading of the excellent drush documentation points you to a Drush Shell Aliases doc page, and from there to the actual example aliases file that comes with every drush installation.
So to be able to run drush commands for a few of my local Drupal instances, I did this:
- In my Linux user directory, I created the file ~/.drush/aliases.drushrc.php
- Contents:
Then I can do, from anywhere as long as I am logged in as that user:
$ cd /tmp$ drush @site1 status
...
$ drush @site2 status
and lots of other good stuff. Have a nice weekend.
Wesley Tanaka: Fast, Low Memory Drupal 6 System Module
A Drupal 5 version of this module is also available. If you would like this patch to be committed to Drupal core, please do not leave a comment on this page—please instead add your comment to Drupal issue #455092.
This is a drop-in replacement for the system.module of Drupal 6.33 which makes your Drupal 6 site use less memory and may even make it faster. A test I ran in a development environment with a stock Drupal 6 installation suggested that I got:
Appnovation Technologies: Some World-Class Museums Using Drupal
I love museums and galleries! I love Open Source! I love Drupal! Why not weave them all together into a single, harmonious blog post, I thought….
var switchTo5x = false;stLight.options({"publisher":"dr-75626d0b-d9b4-2fdb-6d29-1a20f61d683"});Mediacurrent: Join Mediacurrent for These Drupal and Digital Marketing Events
Some Mediacurrent's top talent will be leading discussions on the latest developments in Drupal and digital marketing trends in many upcoming events. Check out the links below for more information and to register. We hope to see you there and make sure you stop by and say “hello”!
Drupal @ Penn State: Drupal, Singularity, Digital Activism, and saving our institutions
It is as important to tell a great story using technology as it is to author technology that allows more stories to be told.
Acquia: New Commons Media Integration
Drupal is known for providing a broad range of functionality with its extensible core and the tens of thousands of free contributed modules which add or extend functionality. One challenge for people who are building applications on top of Drupal is taking advantage of this flexibility and broad range of available functionality without compromising the usability of their applications for end users, and even for themselves as site maintainers.
Four Kitchens: Frontend roundup: DrupalCon Amsterdam
As many of you might know, I am now on the other side of the pond, so I’ve paid extra attention to the DrupalCon Amsterdam schedule as it has been coming together. I want to highlight a few frontend goodies that I’m particularly excited to see.
DrupalCon Sass CSS JavaScript DrupalMediacurrent: Responsive Web Design using Sass at Drupalcamp Los Angeles
I'm very excited to be a featured speaker at this year's DrupalCamp Los Angeles on Saturday, September 6th and Sunday, September 7th. This event, held at annually at the conference center at the University of California, Irvine, is a free event for the Drupal Community of Los Angeles, Orange County, and the Greater Southern California area. My session will focus on Responsive Web Design using Sass.
Morten.dk: Frontend United copenhagen 2014
Welcome back from your summer vacation. Now its time to get out of the sun, and get indoors and geeking out!
Its gonna be the fifth time for Frontend Drupal Badass'es that we gather and discuss & talk Drupal Frontend. We have done this since 2010 (Prague, Berlin, Amsterdam, London) and now its time for the bike loving city of copenhagen to again host a little Drupal Event.
IXIS: We are 10 today - A look back
We are 10 today (ok strictly tomorrow but it's the weekend!) We're all off to Centre Parcs over the bank holiday weekend to celebrate, and thought it was good time to reflect on some of the highlights and changes over the previous ten years.
Drupal 8 and iOS: GSoC 2014 : An example iOS app project status
Hello Drupal Community,
I and my mentor Jeff Linwood ( https://www.drupal.org/u/jefflinwood ) we are very glad to inform you that GSoC 2014 project - an example iOS application for Drupal 8 has been completed.Links to all these projects along with demo video is given below.
DrupalRESTKit : https://github.com/vivekvpandya/DrupalRESTKit
Tips&Tricks AFNetworking : https://github.com/vivekvpandya/TipsAndTricksAFNetworkingDrupal
Tips&Tricks NSURLSessionAPI : https://github.com/vivekvpandya/TipsAndTricksCFNetworkingDrupal
Demo :https://www.youtube.com/watch?v=iny71Kwgn_I
As per the requirement we have demonstrated CRUD operation for content entity , login - logout , fetching data from REST export ( for view). Due to file related bug in REST module () we are unable to demonstrate CRUD on file resources. We have used AFNetworking and we have also created same project with NSURLSession API.
We have also created a generic DrupalRESTKit it simplifies developers task for CRUD on content entity, user, and comments. And still we are improving it. Any suggestion and feature requests are welcomed. If you are an iOS developer then you can participate too.
We have several other ideas in mind like we want to create an iOS app that can control Drupal 8 settings and configuration like putting site on maintenance mode, approving comments , user etc.
Is you face any problem regarding iOS and Drupal 8 communication ( specially REST module ) I would like to help you please mail me at vivekvpandya@gmail.com. If you find my project useful please intimate me.
Tags:
Metal Toad: Drupal 7 Form API: Using #states with multiple conditionals (AND, OR and XOR)
I've been playing with D7 forms lately and have found #states to be somewhat challenging due to lack of documentation on Form API page.
I've poked around a bit and decided to write a blog with my findings in case someone else is in need of this info down the road.
If you are looking for a robust solution for conditional fields, I would suggest looking into conditional fields.
Dries Buytaert: Drupal.com refresh launched
Back in the early days of Drupal, Drupal.com looked like this:
Drupal.com as launched in 2005.
On August 14 2009, I relaunched Drupal.com to replace the oh-so-embarrassing placeholder page. The 2009 re-launch turned Drupal.com into a better spotlight for Drupal. It wasn't hard to beat the white page with a Druplicon logo.
Drupal.com as launched in 2009.
What was a good spotlight five years ago though is no longer a good spotlight today. Five years later, Drupal.com didn't do Drupal justice. It didn't really explain what Drupal is, what you can use Drupal for, and more. Along with sub-optimal content, the site wasn't optimized for mobile use either.
Today, exactly five years later to the day, I'm excited to announce that I relaunched Drupal.com again:
Redesigning Drupal.com to make it more useful and current has been one of my New Year's resolutions for a number of years now. And as of today, I can finally strike that off my list.
The new Drupal.com has become richer in its content; you'll find a bit more information about Drupal to help people understand what Drupal is all about and how to get started with Drupal. On a desktop, on a tablet, on a phone, the site has become much easier to navigate and read.
I believe the new Drupal.com is a much better, more relevant showcase for Drupal. The goal is to update the site more regularly and to keep adding to it. My next step is to add more use cases and to include short demo videos of both the Drupal backend as well as the showcases. Drupal.com will become an increasingly helpful resource and starting point for people who are evaluating Drupal.
The changes are not limited to content and look; Drupal.com also has a new engine as the site was upgraded from Drupal 6 to Drupal 8 alpha (don't try this at home). We're using Drupal 8 to push the boundaries of site building and responsive design and to uncover bugs and usability issues with Drupal 8. Because we're using an alpha version of Drupal 8, things might not function perfectly yet. We’d still love to hear feedback from designers and front end developers on how it’s working.
Aten Design Group: Making Sense of Drupal Views Relationships and Entity References
If you're not already familiar with the subject, check out Joel Steidl's intro to Entity References.
Drupal has some powerful tools for creating and managing complex content relationships. Views relationships using Entity References across more than one content type can be used to establish multi-tiered content relationships. The results can be great, but setting up Entity References across content types with Views can be... well, complicated.
We recently added new functionality to a client’s site that involved Entity References to group content and display it dynamically. The project included a sidebar of links to all the related content that spanned three content types. This wasn’t really possible as a menu block because the links needed to contain some of the actual content. I also considered doing all of this in code but that could mean running a number of extra database queries on every page load. With Views, all of that can be easily cached.
When it comes to relationships in Views, creating a relationship from one content type to another, the number of permutations is usually small enough that it only takes a few minutes to try all of them until you get the desired output. When you try to relate content to content to content, the permutations of configuration options in Views gets a little unwieldy. And, I create and/or modify Views with complicated relationships so infrequently that I never remember how to do it. Trying to debug the query built by Views looks even scarier. Clayton Dewey was able to assist me, and we got relationships working even when needing to chain five different nodes together through their reference fields.
Here’s one portion of the sidebar:
Rather than go through the specific case with our client, I’ve setup a very general one.
Content Type A has an entity reference field to Content Type B. Content Type B has an entity reference field to Content Type C:
Here’s how that content relates.
When trying to set this up in views, relationship descriptions for entity reference fields don’t help. Is it A bridge to the Content entity that is referencing Content via field_other_content or is it A bridge to the Content entity that is referenced via field_content?
A bridge to the Content entity that is referenced via field_content means your entity is referenced by another via an entity reference field. A bridge to the Content entity that is referencing Content via field_other_content means your entity has the reference field. This will become more clear as we go through our example.
Let’s say we’re on the page for node 4, of Content Type C, and on this page we want to list all the related nodes that are of Content Type C. To do that, you need the B node referencing your C node. Then the A node referencing the B node. Next all the B nodes referenced by the A node. Finally, all C nodes referenced by the B nodes. Phew!
To do this with Views, we start with a contextual filter of the current node.
Next we setup the layers of relationships. First from that C node to the B node. Thus we’re using an entity reference relationship called A bridge to the Content entity that is referencing Content via field_c.
Each B node has an entity reference field to its C nodes. To make things easier to read we’re setting the Identifier and the Administrative title.
To get the A node we need another relationship for the entity reference field in A nodes I’ve named field_b. A bridge to the Content entity that is referencing Content via field_b. Again, the content this relationship gives you is doing the referencing. And we’re connecting it to the previous relationship.
Now we want to go back down the chain and get all B nodes. So, now we’ve got content that is referenced. So, we use A bridge to the Content entity that is referenced via field_b. Again, include the previous relationship.
To get all C nodes it’s done the same way.
Finally, to output the titles of all those C nodes, we use the correct relationship for that field. For this Views preview we use the nid of C 4, and get the following output of node titles:
You’ll want to turn on caching for the database queries and if possible, for the rendered HTML in query settings.
See, that wasn’t so hard, was it?
Localize.drupal.org: We love localize.drupal.org BoF at DrupalCon Amsterdam
There is a huge amount of exciting things happening around Drupal multilingual at DrupalCon Amsterdam. This time we'll have a meetup of all the people who love localize.drupal.org. The site seriously needs people who care about it enough to devote time to maintaining and fixing bugs. I set up this BoF to gather people interesting in the well-being of the site titled We love localize.drupal.org. We need to upgrade to Drupal 7, support the whole range of new Drupal 8 APIs, drastically improve performance and then get new features going. See you there!
Drupal Association News: NERD Summit: Building Diversity in New England's Open Source Community
Sometime last year, a local Drupalist named Kelly Albrecht reached out to me. He had this idea that came out of his own personal experiences, and was further inspired by NYC Camp and Forest Mars (Forest, of course, coined the acronym NERDS). The first-ever NERD (New England Regional Developers) Summit will be held at the University of Massachusetts Amherst, September 12-14, 2014. Its seed was, in part, the Western Mass Drupal Camp. But in the interests of making Drupal better, NERDS has a bigger mission and a bigger tent.
In starting NERDS, Kelly’s “a-ha!” moment came when he was having trouble finding good developers to hire at Last Call Media. He found an amazing new addition to his development team, but she had to be urged to apply for the job because she assumed she wasn’t good enough. Now she’s one of his best developers. All of this caused him to wonder: How many more closeted tech geeks, who are usually marginalized in our industry for various reasons, could be encouraged to learn the skills they need to be great web professionals?
Kelly was also thinking about all the other things going on right now in Drupal, and in other open source communities. We all know the incredibly important post by Larry Garfield, Getting off the island. Drupal is working hard to cross-pollinate with other open source technologies. I like to call that “tech diversity”. We also know that the Drupal community is working hard to increase human diversity in its community as well. And there is increasing awareness that diversity in open source, and in tech in general, will help make our technologies, our companies, and our working lives better.
As the NERDS steering committee came together to start talking, a clear vision started to form. What if we put a huge effort into making a richer, more diverse talent pool in New England? What if we put on a free, welcoming, friendly, annual conference, where people could come together to learn with and from peers? Would that start to shift things for the better? What if we also brought Drupal, Wordpress, general web development, UX strategists, Rubyists, Python coders, hackers, and everyone together for this event, so that we could get off our islands and out of our silos and grow our communities? Would these connections then help spur momentum for ongoing collaborative, informal learning and business networking throughout the rest of the year?
So those are the main ideas behind NERDS. Kelly, myself, and a great bunch of volunteers are working to help make it a reality. Even though we’re new and a little disorganized, we’ve got momentum, passion, and the willingness to experiment and iterate. If being part of this idea appeals to you, please consider submitting a session by 8/15, volunteering to do planning tasks now or event tasks on the day(s) of the conference, or joining Acquia, Pantheon, and others in sponsoring the conference (there are many levels and options, and you can get mad karma points for sponsoring childcare). Tomorrow’s richer, better, more diverse open source communities will thank you.
NERDS in a Nutshell- NERDS is a FREE collaborative learning conference. Yes, free. It you want a t-shirt with our awesome logo and meal tickets, you can pay more. But you don’t have to. Either way, if you want to attend, you must register to let us know you’re coming.
- Friday is a learning day for beginners and for experienced devs who want to level up and try new things (Susan Buck of thewc.co, keynote); Saturday is the main sessions day (Ashe Dreyden, keynote); Sunday is sprinting day and a hackathon (Damien McKenna, keynote).
- Have kids? We will have childcare for ages 0-10, and a youth Scratch and maker track. Really.
- NERDS is a brand new, volunteer-run, sponsor-funded experiment. There’s already much momentum and over 50 excellent proposed sessions. It’s happening, and we need sponsors, volunteers to help before and during the conference, and we’re still accepting sessions until 8/15 if you’d like to submit something.
Drupal Association News: Join the Next Drupal Association Board Meeting: 20 August
Our next board meeting is scheduled for 20 August, 2014 and in addition to our regular updates we will have a couple of great topics to discuss: DrupalCon Austin Recap and Licensing issues on Drupal.org.
Our DrupalCon Austin Recap will cover all the results of the Con, from the logistics to the sessions, to the marketing, to the finances. There is a lot of great news to report, along with some really great questions that we are going to have to answer to continue to improve the conference.
Licensing on Drupal.org has been an issue for a very long time now. With so much contributed content, so few volunteers in this area, and with little guidance, the policies we do have in place have been applied inconsistently and some issues that have been reported have never really been addressed. I pulled together a group of folks who have been working on licensing over the years and they developed a proposal for the board's consideration about how to best move forward to provide clear, consistent, and timely action for licensing issues.
All of the materials for the board meeting can be found online, and we hope you'll join us on 20 August!
Flickr photo: Kristen Pol
Forum One: Running Drupal on HHVM
Last March, Facebook announced HACK, a new open source programming language for its HipHop Virtual Machine (HHVM) touted to interoperate seamlessly with PHP. Following the announcement, I was fascinated watching everything they attempted with the new release in trying to wring as much performance as possible from PHP. This gave me an idea: Although we don’t face the exact challenges that Facebook does on a daily basis, it would be interesting to see what would happen if I tried running Drupal under HHVM, the latest iteration of Facebook’s execution engine.
Official HHVM packages are only distributed for Ubuntu and Debian, but thankfully some enterprising people have packaged them up for CentOS. So with a quick stand up of a Virtual Machine and some additional packages, we were good to go. To test, we chose a fairly complex site that we developed last year, built on the usual Panels and Display Suite with significant relationships between the content. This meant that on any given page, Drupal was likely to load and render several entities beyond just the one on the page.
I took the current PHP and database for the site and stood it up on a local VM with 4 cores and 6.5 GB of memory. We did some minor optimization of FPM to set the number of servers, along with some increases to the caches in MySQL. Other than that, it’s pretty much a vanilla installation of PHP 5.3 with XCache, Percona 5.5, and nginx. The goal was to provide as much of an “apples to apples” comparison of the two interpreters without as much regard for making everything as fast possible. We then spidered the site and sampled out 1000 URLs at random and ran JMeter to generate 30 concurrent requests against the site running with HHVM and PHP-FPM. We recorded time and load on the server.
PHP-FPMStarting off, we ran the test against a cold start of the site. We cleared the Drupal cache and restarted nginx, PHP-FPM and MySQL. We then hit the home page with a single request to build the persistently cached items. As the requests started ramping up, the time to complete each one went up as expected.
What was happening on the server mirrors that.
We checked the actual processes that were generating the CPU and memory usage, in this case only pulling out mysqld since tracking each process from PHP-FHM was challenging.
MySQL was using anywhere from 40 – 60%, with a few spikes to just over 100% of one core. All the other cores were entirely used by PHP-FPM. Similarly, MySQL was using, on average, about 300 MB of memory. I’m not entirely sure what was causing the areas where processing pauses and response times spike. I saw them on all scenarios, and my guess is that they were due to some sort of I/O blocking, maybe from MySQL or nginx.
As a second test, we ran the exact same URLs against the system, clearing the Drupal cache to see if a burn in iteration for XCache and MySQL would help. Overall, it reduced the median response time by a whole 400 milliseconds and increased the throughput by a whopping 2.081 pages per minute. The response times in general were a little more choppy with fewer of the peaks and valleys from the previous run, but the results were pretty consistent.
HHVMAfter that we restarted the machine, switching out PHP-FPM for HHVM. Thankfully, it supports fastCGI, so it was a simple matter of altering the nginx configuration slightly. The setup was the exact same as for PHP-FPM; we made sure that the Drupal cache was cleared and restarted MySQL and nginx. We then hit the homepage with a single request and started up JMeter.
The first thing we noticed was that it completed in just under half the time, 6:28 as opposed to 13:21. Every part of the response graph was better, and both the peaks and valleys were significantly lower. The little hiccup at the very start before it dropped, was the JIT compiler running.
Looking at the server stats, those were improved as well.
HHVM runs as a single process, so we were able to capture CPU and memory usage separately for them.
Just looking at these graphs, it’s pretty easy to tell a couple of things. Namely, both CPU and memory usage for HHVM are improved over PHP-FPM. Peak memory usage for HHVM was just about 320 MB for a total system usage of approximately 20% compared to the 25 – 26% under PHP-FPM. Likewise, total CPU usage was lower with only a couple of spikes to over 90% and the median closer to 60%, compared to consistent spike to 95% CPU and a median closer to 70 – 75%.
Similar to the PHP-FPM test, we also ran the scenario against a warm start of HHVM. Like PHP-FPM, there was very little difference, only about a 200 millisecond difference in median response time.
AnalysisIf we are to look at the high level, HHVM compares very well to PHP-FPM.
We saw more than double the throughput and less than half the average response time. Combined with the decrease in system resources needed, it’s a pretty compelling argument to switch to HHVM.
There are some important considerations, however. The biggest is that while the HHVM team is attempting to get as close to Zend PHP as possible, they aren’t there yet. As of the latest reports, HHVM passes 99.83% of the unit tests for Drupal, but there’s no idea how whatever idiosyncrasies exist in various contributed modules will affect it. For instance, we couldn’t get GD to work at all, despite all indications that it should. Thankfully, it’s easily replaceable with ImageMagick – for most manipulations. In fact, we didn’t run into any pages during our test that failed with HHVM, but you never know what might not work until you actually run into it. In addition, the testing was done entirely on the front end. While we went through a couple of common scenarios on the administrative side, we didn’t test that thoroughly. Some PHP modules have been ported, such as APC and memcache, and there is work by third parties to add others, such as MongoDB, Ice and Redis, but many modules haven’t and probably will never be.
It’s also a moving target. Right now the HHVM team is looking at around an 8-week release cycle. Presumably there won’t be significant regressions as they move forward, but you never know. Similarly, they are targeting Ubuntu and Debian for official packages, so if you’re running Fedora or CentOS you have to either build from source or depend on a third party repository that may not be up to date.
DisclaimersThe performance results shown above are from running a production site on a very much ‘non-production’ virtual machine running on MacBook Pro with a 2.3 GHz Core i7 processor. There was very little tuning on any portion of the stack to ensure best performance. Load testing was performed from a separate machine over a wireless network, albeit one that was not being used for any other purpose. The load testing did not include any wait time or requests for non-PHP assets and was not intended to simulate real usage, merely to benchmark the performance of the PHP interpreters.
Gábor Hojtsy: All the multilingual happenings at DrupalCon Amsterdam
DrupalCon Amsterdam is coming up in just a few weeks and it is full of opportunities to learn about and get all your questions answered when it comes to multilingual Drupal. What's better, you can get involved making things happen and learn from those implementing the features firsthand. Here are my picks:
Multilingual Drupal 8 site building and programming- There is no excuse to not attend some of the sprints at and around DrupalCon. Sprints start two days ahead of the start of the conference on Saturday the week before. And there are still sprints going on the Sunday after the conference. It is not just the last day of DrupalCon itself where you can get involved and make a difference. In fact the leads are actually focusing more on the sprint on the weekend days. Also the weekend sprints are in a really cool venue. The best way to learn is to do!
- You are looking for more of a directed guide of Drupal 8 still with the possibility to do it all hands-on? Look no further than the Drupal 8 multilingual hands-on lab presented by Aimee Degnan of Hook42 and myself from Acquia. The schedule info is a bit misleading, this session spans two timeslots and lasts two hours. Bring your laptop with Drupal 8 freshly installed!
- Dive deeper into the APIs of Drupal 8! Francesco Placella from Tag1 presents Multilingual Content in D8: a Highly Evolved Permutated API showing how to code with the new system. While not strictly multilingual, in Field API is dead. Long live Entity Field API! swentel, yched and amateescu show how the most essential content element storage system changed and this is full of multilingual support of course.
- Multilingual Site Setup and Management is a half hour session from Robert Vandenberg and Rob Bailey of Lingotek back to back with Building a multilingual & multi-country e-commerce site for luxury brands another half hour talk from Arthur Murauskas of Adyax with real life examples.
- Dagmar Muth and Urs Bucher from Amazee Labs are presenting Building a Multilingual, Multidomain Drupal Site synthesizing their experience from multiple customers.
- I proposed the Multilingual therapy (questions and answers) BoF again! Waiting experienced folks as well as everyone with questions. You'll see even if you arrive with several questions, you can answer others! There is no set agenda, just to answer all the questions!
The localize.drupal.org site seriously needs people who care about it enough to devote time to maintaining and fixing bugs. I set up one more BoF to gather people interesting in the well-being of this site titled We love localize.drupal.org. We need to upgrade to Drupal 7, support the whole range of new Drupal 8 APIs, drastically improve performance and then get new features going.
These are all the multilingual pieces that I collected. There may still be more, BoF scheduling just started and I may have missed a session or two. Let us know in the comments what other great events happen around multilingual Drupal. See you in Amsterdam!
Drupal @ Penn State: Delicious Drush desserts
I'm incredibly lazy, motivated, but lazy; and I hope you are too. This drives all of us to try and automate everything in life and makes Drupal developers look like rock stars of productivity while lounging in sleep pants with their morning coffee. What am I talking about? Drush, and specifically a new form of chain automation with drush that I'm going to be show-casing today. This is something I've been raving about the sandbox / dev build of on twitter for awhile now.