Beispiel #1
0
 /**
  * Отправляет сообщение
  *
  * @param Mail_Message_Message $message
  *
  * @return boolean
  */
 public function send(Mail_Message_Message $message)
 {
     $pipe = Proc::Pipe($this->sendmail_command(), 'wb');
     Mail_Serialize::Encoder()->to_stream($pipe)->encode($message);
     return $pipe->close()->exit_status ? false : true;
 }
Beispiel #2
0
 /**
  */
 protected function output($result)
 {
     switch ($application = $this->config->application) {
         case 'dot':
         case 'neato':
         case 'fdp':
         case 'circo':
         case 'twopi':
             Proc::Pipe(Core_Strings::format('%s -T%s %s', $application, $this->config->format, $this->config->output ? ' -o ' . $this->config->output : ''), 'w')->write($result)->close();
             break;
         default:
             throw new Dev_Diagram_Exception(Core_Strings::format('Unknown application (%s)', $application));
     }
 }
Beispiel #3
0
 /**
  * @param string $path
  */
 protected function sql($path)
 {
     $p = Proc::Pipe($this->build_command(), 'wb');
     foreach (IO_FS::File($path) as $line) {
         $p->write($line);
     }
     $p->close();
     if ($p->exit_status != 0) {
         throw new Core_Exception('Erro while running db_script');
     }
 }