You are here

function hosting_quota_get in Hostmaster (Aegir) 6

Get info about hosting quotas

We call here every declaration of hook_hosting_quota_resource

Parameters

$resource string: The name of the requested resource

Return value

A multidimensional array containing the resource, or false if the provided resource does not validate

3 calls to hosting_quota_get()
hosting_quota_check in modules/hosting/quota/hosting_quota.module
Quickly check if a given quota has been exceeded
hosting_quota_get_usage in modules/hosting/quota/hosting_quota.module
Get the usage for the specified resource
hosting_quota_resource_render in modules/hosting/quota/hosting_quota.module
Rendering function for quotas

File

modules/hosting/quota/hosting_quota.module, line 59
Implement quota's for the resource used by client.

Code

function hosting_quota_get($resource) {
  $all_resources = module_invoke_all('hosting_quota_resource');
  if (in_array($resource, array_keys($all_resources))) {
    return $all_resources[$resource];
  }
  else {

    // $resource is not valid, so generate an error
    watchdog('hosting_quota', 'Invalid resource called', array(), WATCHDOG_ERROR);
    return FALSE;
  }
}