Пример #1
0
 protected function doRun()
 {
     $threemaId = $this->getArgument(self::argThreemaId);
     $from = $this->getArgument(self::argFrom);
     $secret = $this->getArgument(self::argSecret);
     $privateKey = $this->getArgumentPrivateKey(self::argPrivateKey);
     $path = $this->getArgumentFile(self::argFile);
     $thumbnailPath = $this->getArgument(self::argThumbnail);
     Common::required($threemaId, $from, $secret, $privateKey, $path);
     $settings = new ConnectionSettings($from, $secret);
     $connector = new Connection($settings, $this->publicKeyStore);
     $helper = new E2EHelper($privateKey, $connector);
     $result = $helper->sendFileMessage($threemaId, $path, $thumbnailPath);
     if ($result->isSuccess()) {
         Common::l('Message ID: ' . $result->getMessageId());
     } else {
         Common::e('Error: ' . $result->getErrorMessage());
     }
 }