Skip to content

Instantly share code, notes, and snippets.

View pdrakeweb's full-sized avatar

Peter Drake pdrakeweb

View GitHub Profile
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my $file = $ARGV[0] or die('Must pass an apache access logfile');
open IN, "<$file" or die("Can't open $file");
DO WTF YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alexey Silin <pinkoblomingo@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WTF YOU WANT TO PUBLIC LICENSE
// Internal recursive views data mapping function
private function mapViewsDataRecurse(&$response, &$view, $key, $filter_fields) {
if (is_array($response)) {
foreach($response as $field => $definition) {
if (!empty($filter_fields) && !in_array($field, $filter_fields)) {
unset($response[$field]);
}
elseif ($definition['#type'] == 'group') {
$response[$field] = $this->mapViewsDataRecurse($response[$field]['#content'], &$view, $key, $fields);
}