Skip to content

Repository files navigation

Pendenga Sftp Library

1 Test2 Assertions100% Coverage

This is the package implementation for pushing to Domo's SFTP connector. It handles all the package includes and negotiateing with Vault to get the security certificate (pem).

Installation

This package is hosted on Packagist and is installable via Composer.

Requirements

  • PHP version 7.1 or greater
  • Composer (for installation)

Installing Via Composer

Run the following command (assuming composer is available in your PATH):

$ composer require pendenga/domo

Usage

After creating a Domo data set, you'll get a dataset_id which is used for the remote filename. That's the only loose variable. All the reset of the connection information can be abstracted in a SftpLoaderInterface, in this case the demo class IniLoader.

// using example iniLoader to simplify (1 variable to look up)$domo = newDomoPush(newIniLoader());
$domo->push($local_file, $domo->getRemoteFilename($domo_dataset_id));
// manual sftp operation (5 variables to look up)$sftp = newSFTP($sftp_remote_path);
$rsa = newRSA();
$rsa->setPassword($rsa_password);
$rsa->loadKey(base64_decode($rsa_key_base64));
$sftp->login($sftp_username, $rsa);
$sftp->put($remote_file, $local_file, SFTP::SOURCE_LOCAL_FILE);

About

Simplify SFTP push with RSA key

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages