Skip to content

Instantly share code, notes, and snippets.

@CrookedNumber
CrookedNumber / drupal-bulk-validate.py
Created December 17, 2009 22:08
Python script to bulk validate a drupal site
#!/usr/bin/env python
import urllib
import time
import httplib
base = 'www.edc.org' # NO trailing slash
lim = 200 # highest nid in your {node} table
def xhmtl_is_valid(url):
time.sleep(.75) # seconds
Index: system.install
===================================================================
--- modules/system/system.install (revision 8648)
+++ modules/system/system.install (working copy)
@@ -476,15 +476,6 @@
}
$requirements['update status']['title'] = $t('Update notifications');
- // Check that Drupal can issue HTTP requests.
- if (variable_get('drupal_http_request_fails', TRUE) && !system_check_http_request()) {
477,486d476
<
< // Check that Drupal can issue HTTP requests.
< if (variable_get('drupal_http_request_fails', TRUE) && !system_check_http_request()) {
< $requirements['http requests'] = array(
< 'title' => $t('HTTP request status'),
< 'value' => $t('Fails'),
< 'severity' => REQUIREMENT_ERROR,
< 'description' => $t('Your system or network configuration does not allow Drupal to access web pages, resulting in reduced functionality. This could be due to your webserver configuration or PHP settings, and should be resolved in order to download information about available updates, fetch aggregator feeds, sign in via OpenID, or use other network-dependent services. If you are certain that Drupal can access web pages but you are still seeing this message, you may add <code>$conf[\'drupal_http_request_fails\'] = FALSE;</code> to the bottom of your settings.php file.'),
< );
*** system.install 2012-07-09 15:58:15.000000000 -0400
--- system-patched.install 2012-01-24 17:21:30.000000000 -0500
*************** function system_requirements($phase) {
*** 474,489 ****
);
}
$requirements['update status']['title'] = $t('Update notifications');
-
- // Check that Drupal can issue HTTP requests.
- if (variable_get('drupal_http_request_fails', TRUE) && !system_check_http_request()) {
Index: system.module
===================================================================
--- modules/system/system.module (revision 8648)
+++ modules/system/system.module (working copy)
@@ -2238,7 +2238,7 @@
}
else {
// File is not found in file system, so delete record from the system table.
- $delete->condition('filename', $file->filename);
+ //$delete->condition('filename', $file->filename);
@CrookedNumber
CrookedNumber / gist:3926920
Created October 21, 2012 13:12
memcached status
echo stats | nc 127.0.0.1 11211
@CrookedNumber
CrookedNumber / gist:3946202
Created October 24, 2012 14:02
List all projects with available updates using Drush
drush vset update_check_disabled 1 -y && drush --simulate --pipe --no up
# see http://mark.shropshires.net/blog/list-all-projects-available-updates-using-drush
@CrookedNumber
CrookedNumber / gist:3946714
Created October 24, 2012 15:20
<HEAD> for create.js
<!-- load the jQuery and require.js libraries -->
<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/vendor/jquery-1.7.2.js"></script>
<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/require.js"></script>
<!-- load the Aloha Editor core and some plugins -->
<script src="http://cdn.aloha-editor.org/latest/lib/aloha.js"
data-aloha-plugins="common/ui,
common/format,
common/list,
common/link,
@CrookedNumber
CrookedNumber / gist:4057335
Created November 12, 2012 03:31
Find actual drupal queries
// From http://www.opensourcery.com/blog/jessehs/what-was-query
// Devel Configuration -- Add this to
$conf['dev_query'] = TRUE;
<?php
global $queries;
$query = array_pop($queries);
dd($query, 'descriptive text about the query being printed out -- this one is logged to /tmp/drupal_debug.txt');
dpm($query, 'descriptive text about the query being printed out -- this one is printed to the screen');
?>
// Also: debug(strtr($query, $query->getArguments())); will show a query with arguments replaced in. It won't be quoted so it's not perfect but it integrates with the testing framework and doesn't require devel. (from CHX)
@CrookedNumber
CrookedNumber / gist:4057350
Created November 12, 2012 03:33
Drupal-focused memcache GUI
<?php
$memcache = new Memcache;
$memcache->connect('127.0.0.1', 11211)
or die ("Could not connect to memcache server");
$cells = '';
$list = array();
$allSlabs = $memcache->getExtendedStats('slabs');
$items = $memcache->getExtendedStats('items');
foreach($allSlabs as $server => $slabs) {
foreach($slabs as $slabId => $slabMeta) {