| 1 |
<?php |
<?php |
| 2 |
// $Id: acquia_spi.module,v 1.1 2008/12/30 16:51:46 pwolanin Exp $ |
// $Id: acquia_spi.module,v 1.2.2.1 2009/11/20 15:36:30 pwolanin Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 32 |
$interval = variable_get('acquia_spi_cron_interval', 8*60*60); |
$interval = variable_get('acquia_spi_cron_interval', 8*60*60); |
| 33 |
$now = time(); |
$now = time(); |
| 34 |
if ($now - $last > $interval) { |
if ($now - $last > $interval) { |
| 35 |
acquia_spi_send(); |
acquia_spi_send_profile_info(); |
| 36 |
variable_set('acquia_spi_cron_last', $now); |
variable_set('acquia_spi_cron_last', $now); |
| 37 |
} |
} |
| 38 |
} |
} |
| 49 |
*/ |
*/ |
| 50 |
function acquia_spi_agent_settings_submit($form, &$form_state) { |
function acquia_spi_agent_settings_submit($form, &$form_state) { |
| 51 |
// Send information as soon as the key/identifier pair is submitted. |
// Send information as soon as the key/identifier pair is submitted. |
| 52 |
acquia_spi_send(); |
acquia_spi_send_profile_info(); |
| 53 |
} |
} |
| 54 |
|
|
| 55 |
/** |
/** |
| 56 |
* Send site profile information to Acquia Network via XML-RPC. |
* Send site profile information to Acquia Network via XML-RPC. |
| 57 |
*/ |
*/ |
| 58 |
function acquia_spi_send() { |
function acquia_spi_send_profile_info() { |
| 59 |
// Do nothing unless we have credentials. |
// Do nothing unless we have credentials. |
| 60 |
if (acquia_agent_has_credentials()) { |
if (acquia_agent_has_credentials()) { |
| 61 |
$spi = acquia_spi_get(); |
$spi = acquia_spi_get(); |