Planet Drupal

Non-local Files on Drupal 6

Drupal 6 does not handle non-local files well. That means if you want to use something like Amazon's S3 file service you are pretty much out of luck. Media Mover got around this by overriding some templates but the implementation did not work well for extensibility and left most use cases in the dark.

Media Mover 2: Now With 72% More Objects!

Ok so I totally missed my deadline of January 1 for Media Mover 2. Fine.

The alpha is actually nearing- this time I mean it. The selecting files from views works, auto generating images for imagecache (multiples all at once), full Drush support, unlimited actions per step, FTP module has been completely rewritten and does a better job of auto linking FTP content (by users, by directory, by token) then it did previously, the number of modules has been reduced to make configuration building easier, configurations in code, the API is new and simplified (and easy to upgrade to!) and so on. Hey, the interface even got an overhaul which makes it feel more like Views, and so on. Yes there are probably lots of bugs still. There is no upgrade path from Media Mover 1 and won't be until the bugs are not serious.

So here is some of the pudding. This is the new admin landing page which lists all of the configurations. Here you see three different types of configurations- disabled, overriden from code, and normal- built from the admin interface. What is no longer here is the notion of child configurations- with configurations now having unlimited steps it seems unnecessary to add the complexity of having the child configurations. Selecting files from an existing configuration is still possible so I'm going to argue that Media Mover 2 offers more possibilities for building configurations despite lacking this feature.

PHP Memory Issues? There's a Hack for That!

I've had to raise my php memory limits much further than I'd like just to get some normal things done in D7. The admin page for Drupal's menu system with a large menu tree can easily crush what I'd consider a healthy amount of available ram. Here is a fast and ugly fix settings.php:


$path = explode('/', $_GET['q']);
if ($path[0] == 'admin') {
  ini_set('memory_limit', '192M');
}

Hopefully this is sufficient for most cases.

Hooks and Queues - Media Mover 2 Improvements

As Media Mover 2 finally moves toward alpha, I've taken the risk of doing some significant refactoring- or at least improvements- to make the transition to Drupal 7 easier as well as to provide a much more robust platform people to start leveraging.

Similar to Drupal 7's hook_file_load, Media Mover now offers hook_media_mover_file_load() and hook_media_mover_file_save(). This allows for easy altering of files as they pass through the system. These are both cache aware so you can still benefit from caching while having the ability to avoid modifying a cached file if your modifications are not dynamic (cached Media Mover files have $file->cached set). Steps and configurations are also alterable on load and save.

Slides from SF DrupalCon Media Panel

Here are the slides from the Media Module panel. No additional cats were harmed in the creation of this pdf.

Media Mover 2 and Drupal Queue

With folks using Media Mover to transcode larger and larger video files, cron time outs have become somewhat of a problem as Drupal waits for FFmpeg to complete its processing. With Media Mover one, configurations are run from cron by default (not required, but out of the box) which means that cron runs as long as the Media Mover configuration takes. While it is possible to limit cron runs, the reality of transcoding a gigabyte file is that it takes time regardless of how much horsepower you can throw at it. Media Mover one was setup to be friendly to multi-machine systems, but the system left some things to be desired.

Media Mover S3 CDN Improvements

The S3 module for Media Mover just got updated to make the CDN integration easier. As files come through the system, files which already reside on S3 will have $file->s3_uri set which allows theming functions to display the local URI if it is present or the S3 URI if the file is already on S3.

Make that $file->s3_data which is a serialized array of data from the S3 file. This allows for the generation of private urls.

Drupal S3 API Module

Heshan Wanigasooriya just let me know that he has started developing an API module for S3. This means that for modules that are implementing S3 functionality, we can all use a single API module instead of reinventing the wheel every time. Basic get/put functionality is already in place and support for query string authenticated files is coming quickly.

Media Mover's S3 implementation will likely transition to this quite quickly. I suspect we'll be doing a stream wrapper implementation in the near future....

Pages