Merge remote-tracking branch 'origin/4.6' into 4.6-master-2015-08-03-16-00-35
[civicrm-core.git] / bin / deprecated / EmailProcessor.php
index 28c2d4181a2af4f739bd11bcca64ae305053c4be..e2bfd120d20c3620108b51b040ad4afb2395c342 100644 (file)
@@ -51,8 +51,7 @@ if (php_sapi_name() == "cli") {
   //if it doesn't die, it's authenticated
   //log the execution of script
   CRM_Core_Error::debug_log_message('EmailProcessor.php from the cli');
-  require_once 'CRM/Core/Lock.php';
-  $lock = new CRM_Core_Lock('EmailProcessor');
+  $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.mailing.EmailProcessor');
 
   if (!$lock->isAcquired()) {
     throw new Exception('Could not acquire lock, another EmailProcessor process is running');
@@ -83,8 +82,7 @@ else {
   //log the execution of script
   CRM_Core_Error::debug_log_message('EmailProcessor.php');
 
-  require_once 'CRM/Core/Lock.php';
-  $lock = new CRM_Core_Lock('EmailProcessor');
+  $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.mailing.EmailProcessor');
 
   if (!$lock->isAcquired()) {
     throw new Exception('Could not acquire lock, another EmailProcessor process is running');