+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
/**
- * When runing script from cli :
+ * When running script from cli :
* 1. By default script is being used for civimail processing.
* eg : nice -19 php bin/EmailProcessor.php -u<login> -p<password> -s<sites(or default)>
*
//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');
//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');