<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
// in that case (ie. makes it non-configurable via the UI). Another approach would be to set a default of 0
// in the _spec function - but since that is a deprecated value it seems more contentious than this approach
$params['rowCount'] = 0;
- $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.core.ActionSchedule');
+ $lock = Civi::lockManager()->acquire('worker.core.ActionSchedule');
if (!$lock->isAcquired()) {
return civicrm_api3_create_error('Could not acquire lock, another ActionSchedule process is running');
}
* @return array
*/
function civicrm_api3_job_fetch_bounces($params) {
- $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.mailing.EmailProcessor');
+ $lock = Civi::lockManager()->acquire('worker.mailing.EmailProcessor');
if (!$lock->isAcquired()) {
return civicrm_api3_create_error('Could not acquire lock, another EmailProcessor process is running');
}
* @return array
*/
function civicrm_api3_job_fetch_activities($params) {
- $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.mailing.EmailProcessor');
+ $lock = Civi::lockManager()->acquire('worker.mailing.EmailProcessor');
if (!$lock->isAcquired()) {
return civicrm_api3_create_error('Could not acquire lock, another EmailProcessor process is running');
}
* true if success, else false
*/
function civicrm_api3_job_process_membership($params) {
- $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.member.UpdateMembership');
+ $lock = Civi::lockManager()->acquire('worker.member.UpdateMembership');
if (!$lock->isAcquired()) {
return civicrm_api3_create_error('Could not acquire lock, another Membership Processing process is running');
}
* @throws \API_Exception
*/
function civicrm_api3_job_group_rebuild($params) {
- $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.core.GroupRebuild');
+ $lock = Civi::lockManager()->acquire('worker.core.GroupRebuild');
if (!$lock->isAcquired()) {
throw new API_Exception('Could not acquire lock, another EmailProcessor process is running');
}
return civicrm_api3_create_success();
}
+
+/**
+ * Check for CiviCRM software updates.
+ *
+ * Anonymous site statistics are sent back to civicrm.org during this check.
+ */
+function civicrm_api3_job_version_check() {
+ $vc = new CRM_Utils_VersionCheck();
+ $vc->fetch();
+ return civicrm_api3_create_success();
+}