Database Automaton
Automation for Object Oriented database access for all your external databases.
It is supposed to:
- create objects for databases, tables and rows, for use in other modules
- provide basic CRUD API
- provide basic CRUD GUI
- provide Views integration
- allow export database's classes and forms to external "static" module for future development
doheditor
dreditor companion for use at http://core.drupalofficehours.org/
Install user script http://drupalcode.org/project/doheditor.git/blob_plain/HEAD:/doheditor.u...
Important! Please remove and reinstall user script if you have installed it from the sandbox link, otherwise you'll get double buttons
Health monitor
Health monitor is a great solution to monitor custom functionality built into your site.
The Health monitor module makes it easy to hook into, and add custom "monitors" that display status messages on an admin dashboard. Health monitor can automatically send e-mails when a monitor returns an error.
Adding a new monitor is simple, just create a hook: hook_health_monitors().
Return some info:
$monitors['check_nodes'] = array(
'name' => t('Check number of nodes'),
'group' => t('Example Group'),
'description' => t('Checks to make sure at least 1 node exists.'),
'args' => array('threshold' => 1),
);This monitor will now call hook_health_monitor_MONITOR().
Your hook should return a status:
function health_health_monitor_check_nodes($args) {
$count = get_node_count();
if ($count >= $args['threshold']) {
return array(
'status' => HEALTH_OKAY,
'message' => t('There are !count nodes in the database.', array("!count" => $count)),
);
}
else {
return array(
'status' => HEALTH_ERROR,
'message' => t('There are only !count nodes in the database!', array('!count' => $count)),
);
}
}.... And you're done. Wasn't that easy?
Batch video
Mockery
This is an experiment for exploring possibilities to integrate the third party PHP mock object framework mockery into DrupalWebTestCase. The goal is to provide an easy to use API for testing drupal hooks invoked during DrupalWebTestCase::drupalGet in a stub module.
Installation
Install PHP mockery using PEAR:
sudo pear channel-discover pear.survivethedeepend.com
sudo pear channel-discover hamcrest.googlecode.com/svn/pear
sudo pear install --alldeps deepend/MockeryThis module does not expose an UI. It is not even shown in the module administration page. The module should only be enabled and loaded as part of a test-case requiring it.
Example
When modules expose hooks for other modules to implement, it is good practice to document them in MY_MODULE.api.php file:
<?php
/**
* Hook triggered when running out of ideas.
*
* @return string
* Return a list of things to try in response
*/
function hook_MY_MODULE_stand_up_and() {
return array(
t('Make coffee'),
t('Go for a walk'),
);
}
?>