Skip to content

Instantly share code, notes, and snippets.

View pbull's full-sized avatar

Peter Bull pbull

  • Acquia
  • Arlington, MA
View GitHub Profile
@typhonius
typhonius / cacheplotter.drush.inc
Created April 30, 2014 09:51
I feel dirty putting the Drupal 6.x integration in there but it's still a supported API version so w/e. This checks your db cache tables for sizes of values. Useful if you're using memcache and are worried about exceeding the max page size.
<?php
/**
* @file
* Drush command to check for overly large items in DB cache tables that will
* not work with memcache.
*/
/**
* Implements hook_drush_command().
@cam8001
cam8001 / Add PECL library to hosting
Created March 11, 2013 15:25
How to add PECL source files (NOT binary modules) to Acquia hosting.
#!/bin/bash
$ pear install Net_SmartIRC
downloading Net_SmartIRC-1.0.2.tgz ...
Starting to download Net_SmartIRC-1.0.2.tgz (184,705 bytes)
........................................done: 184,705 bytes
install ok: channel://pear.php.net/Net_SmartIRC-1.0.2
# Now the class is downloaded to my local include path.
@ck-on
ck-on / ocp.php
Last active May 18, 2024 22:35
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
diff --git a/includes/cache.inc b/includes/cache.inc
index a19d3c3..2475c59 100644
--- a/includes/cache.inc
+++ b/includes/cache.inc
@@ -167,7 +167,7 @@ function cache_clear_all($cid = NULL, $bin = NULL, $wildcard = FALSE) {
if (!isset($cid) && !isset($bin)) {
// Clear the block cache first, so stale data will
// not end up in the page cache.
- if (module_exists('block')) {
@webbj74
webbj74 / default-site-redirect.settings.php
Created April 12, 2012 00:42
Drupal Default Site Redirection Template
<?php
/**
* Redirection rules for default Drupal site
*
* This drop-in for the default site's settings.php provides HTTP 301
* redirection rules for any request which does not already have a Drupal
* site folder assigned. Redirect rules are located in the global
* default_redirect array.
*