Esempio n. 1
0
 public function toAnt()
 {
     if (!$this->isActive()) {
         return true;
     }
     if (!$this->getMessage()) {
         SystemEvent::raise(SystemEvent::ERROR, 'Message not set for echo task.', __METHOD__);
         return false;
     }
     $xml = new XmlDoc();
     $xml->startElement('echo');
     if ($this->getFile()) {
         $xml->writeAttribute('file', $this->getFile());
         if ($this->getAppend() !== null) {
             $xml->writeAttribute('append', $this->getAppend() ? 'true' : 'false');
         }
     } else {
         $xml->text($this->getMessage());
     }
     $xml->endElement();
     return $xml->flush();
 }