Configure > Domain Information * If you want to use some other FROM email address, modify line 125 and set your valid email address. * * Save the file as UpdateMembershipRecord.php prior to running this script. */ /** * Class CRM_UpdateMembershipRecord */ class CRM_UpdateMembershipRecord { /** */ public function __construct() { // you can run this program either from an apache command, or from the cli if (php_sapi_name() == "cli") { require_once "cli.php"; $cli = new civicrm_cli(); //if it doesn't die, it's authenticated } else { //from the webserver $this->initialize(); $config = CRM_Core_Config::singleton(); // this does not return on failure CRM_Utils_System::authenticateScript(TRUE); //log the execution time of script CRM_Core_Error::debug_log_message('UpdateMembershipRecord.php'); } } public function initialize() { require_once '../civicrm.config.php'; require_once 'CRM/Core/Config.php'; $config = CRM_Core_Config::singleton(); } public function updateMembershipStatus() { require_once 'CRM/Member/BAO/Membership.php'; CRM_Member_BAO_Membership::updateAllMembershipStatus(); } } $obj = new CRM_UpdateMembershipRecord(); echo "\n Updating "; $obj->updateMembershipStatus(); echo "\n\n Membership records updated. (Done) \n";