Ejemplo n.º 1
0
 /**
  * Constructor
  *
  * Sets up SMS carriers and other settings from sms.ini.
  *
  * @param \Zend\Mail\Transport\TransportInterface $transport Mail transport
  * object (we'll build our own if none is provided).
  * @param \Zend\Config\Config                     $config    VuFind configuration
  * object (we'll auto-load if none is provided).
  */
 public function __construct($transport = null, $config = null)
 {
     // Set up parent object first:
     parent::__construct($transport, $config);
     // if using sms.ini, then load the carriers from it
     // otherwise, fall back to the default list of US carriers
     $smsConfig = ConfigReader::getConfig('sms');
     if (isset($smsConfig->Carriers) && count($smsConfig->Carriers) > 0) {
         $this->carriers = array();
         foreach ($smsConfig->Carriers as $id => $settings) {
             list($domain, $name) = explode(':', $settings, 2);
             $this->carriers[$id] = array('name' => $name, 'domain' => $domain);
         }
     }
     // Load default "from" address:
     $this->defaultFrom = isset($this->config->Site->email) ? $this->config->Site->email : '';
 }