/**
  * the singleton pattern
  *
  * @return Voipmanager_Controller_Snom_Xml
  */
 public static function getInstance()
 {
     if (self::$_instance === NULL) {
         self::$_instance = new Voipmanager_Controller_Snom_Xml();
     }
     return self::$_instance;
 }
Пример #2
0
 /**
  * retrieve firmware settings
  *
  * @param string $mac
  */
 public function firmware($mac)
 {
     $this->_authenticate();
     Zend_Registry::get('logger')->debug(__METHOD__ . '::' . __LINE__ . ' get firmware for ' . $mac);
     $controller = Voipmanager_Controller_Snom_Phone::getInstance();
     $phone = $controller->getByMacAddress($mac);
     $phone = $this->_setStatus($phone, 'firmware');
     $xmlFirmware = Voipmanager_Controller_Snom_Xml::getInstance()->getFirmware($phone);
     header('Content-Type: application/xml');
     // we must sent this header, as the snom phones can't work with chunked encoding
     header('Content-Length: ' . strlen($xmlFirmware));
     echo $xmlFirmware;
 }