Planet Drupal

Powerpoint presentation to images in PHP: a Drupal example

In this post I will show you how we implemented a solution that allowed users to upload Powerpoint files to a PHP based web application (Drupal in this example) where they get converted to plain images and rendered back to the user. The requirements for the solution were:


Adding products with attributes to cart programmatically using Ubercart

While still using Ubercart on some legacy application, I found the need to add a product to the cart programmatically with attributes already set. So I uncovered the dust from this old Ubercart utility library and thought it would be nice to share.

There are a few interesting methods in it:


Drupal 8 Couchbase Integration

What is Couchbase?


Best Drupal Hosting - Choosing the right one


Drupal 8 Wincache Integration

Wether you are enjoying the incredible Azure ecosystem, need to deploy on Windows due to business requirements or you have any other reason to deploy on Windows, the basic tool to run Drupal 8 on Windows with reasonable performance - the WIncache module - is already available.

Wincache Drupal


Exposing reverse entity reference fields in Drupal

Entity references in Drupal is the mechanism used to do some "proper" (sorry for the quotes but what you can achieve with Drupal is years behind a real ORM such as the Entity Framework in terms of usability, reliability, flexibility and overal quality) data modeling without having to write everything from scratch including queries, widgets and storage. 


Drupal 8 performance: enabling the classloader cache

Drupal 8 is using some of the PHP language features that make PHP a "more or less decent" programming language and one of them is Autoloading. But because autoloading in PHP leaves the real autoloading job to userland code this can easily have very nasty performance implications.

If you want to use Autoloading now in Drupal 7 check out the extremely useful XAutoload module.


Drupal 8 Performance: Moving the service container cache away from the database

Drupal relies on pluggable cache backends to store cache data such as Memcache, Wincache, Database, etc. The default storage backend is the Database, but Drupal being a very cache intensive application (even more in Drupal 8) you want to get better performance by using faster backends that will yield lower latency and scale better.

Moving caching away from the database is done by replacing the caching services by ones that do not rely on the database. You define the services in your services.yml file and the binaries routing in settings.php:



Importing Excel data with PHP, OpenXML and SpreadsheetLight: a Drupal example

In this article you will learn how to manipulate Excel files from PHP using the OpenXML specification and the SpreadsheetLight library.

OpenXML is an open source specification that is used to build all Office 2007 and beyond document formats including Word and Excel. SpreadsheetLight builds on top of the standard OpenXML library to make Excel manipulation a piece of cake.


Drupal: Add new operators to views filters (such as contained in CSV) or how to override default view's handlers

Today I'm going to show you how to turbo boost Drupal's default views filters with an example on how to add  a "Conatained in CSV" operator for Numeric and String filters.

Imagine a user wants to perform a batch operation on entities with ID's X, Y and Z. Unless they all appear on the same page, or you set the page size to inifinte this is impossible because Views Bulk Operations won't let you manually pick items between searches and/or pages.

We want something like this to happen:



Subscribe to RSS - Planet Drupal