function hosting_context_load in Hosting 6.2
Same name and namespace in other branches
- 7.4 hosting.module \hosting_context_load()
- 7.3 hosting.module \hosting_context_load()
Get the node associated with a given provision context.
Parameters
$name: The name of the context to load.
Return value
Either the node object associated with the context, or FALSE if no associated node can be found.
3 calls to hosting_context_load()
- drush_hosting_resume in ./
resume.hosting.inc - Drush command to resume the Aegir frontend site.
- drush_hosting_task_validate in ./
task.hosting.inc - Validate hook for the hosting-task Drush command.
- hosting_drush_import in ./
hosting.drush.inc - Imports a drush named context / "site alias" into the hostmaster front end, by creating nodes and translating the value.
File
- ./
hosting.module, line 850 - Hosting module.
Code
function hosting_context_load($name) {
$name = ltrim($name, '@');
// TODO : introduce static caching ?
$result = db_query("SELECT nid FROM {hosting_context} WHERE name='%s'", $name);
if ($obj = db_fetch_object($result)) {
return node_load($obj->nid);
}
return FALSE;
}