コード例 #1
0
 /**
  * Opts a subscriber out, used by STOP, QUIT and END
  * 
  */
 public function optOut()
 {
     //echo "I am here in keyword abstract";
     // Check if this is a single folder subscriber first...
     $subscriber = new Application_Model_Subscriber();
     $folders = $subscriber->getContainingFolders($this->_inbound->device_address, false);
     if ($folders && is_array($folders) && count($folders) == 1) {
         // Unsubsribe from this folder
         $this->optOutSubscriber($folders[0]->folderid, $this->_inbound->device_address);
     } else {
         $outbound = $this->_inbound->getReplytoMessage();
         //echo $outbound->folderid;
         //die;
         if ($outbound && $outbound->folderid) {
             //$user = Zend_Registry::isRegistered('user') ? Zend_Registry::get('user') : new Application_Model_User($outbound->createuser);
             //$folder = new Application_Model_Folder($user, $outbound->folderid);
             $this->optOutSubscriber($outbound->folderid, $this->_inbound->device_address);
         }
         //$this->_keyword->deleteSubscriber($this->_sender);
     }
 }
コード例 #2
0
$autoloader = Zend_Loader_Autoloader::getInstance();
// Setup routing of model autoloaders
$loader = new Zend_Loader_Autoloader_Resource(array('basePath' => $apppath . '/application/', 'namespace' => 'Application'));
// Name, path, namepsace
$loader->addResourceType('model', 'models', 'Model');
// Get our config file
$config = new Zend_Config_Ini($apppath . '/application/configs/application.ini');
Zend_Registry::set('config', $config->production);
// Because our models need it this way
// Get the Delivery Report model
$timestamp = date('Y-m-d H:i:s');
// Log the start of this read
logWrite("####################################");
logWrite("Begin store memcache optouts: {$timestamp}");
logWrite("------------------------------------");
$inb = new Application_Model_Smsinbound();
$inb->optoutsListFromInboundToMemcache();
$endofset = date('Y-m-d H:i:s');
logWrite("End of storing optouts into memcache: {$endofset}");
logWrite("------------------------------------");
return 0;
/**
 * Simply writes a log message line to the log file
 * 
 * @param string $msg The message to write
 */
function logWrite($msg)
{
    global $logfile;
    $fh = fopen($logfile, 'a');
    fwrite($fh, "{$msg}\n");