承接 ride/lib-system-ssh 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ride/lib-system-ssh

Composer 安装命令:

composer require ride/lib-system-ssh

包简介

SSH system library of the Ride framework

README 文档

README

SSH system abstraction library of the PHP Ride framework.

Code Sample

Check this code sample to see the possibilities of this library:

<?php

use ride\library\system\System;
use ride\library\system\SshSystem;

// password authentication
$authentication = new PasswordSshAuthentication();
$authentication->setUsername('username');
$authentication->setPasswword('password');

// public key authentication
$authentication = new PublicKeySshAuthentication();
$authentication->setUsername('username');
$authentication->setPublicKeyFile('/path/to/public-key');
$authentication->setPrivateKeyFile('/path/to/private-key');
$authentication->setPrivateKeyPassphrase('passphrase'); // optional

// create the ssh system
$remoteSystem = new SshSystem($authentication, 'my-ssh-host.com', 22);

// optional host key verifycation
$remoteSystem->setHostKeys(array(
    'host:port' => 'fingerprint',
));

// optional connect and disconnect
$remoteSystem->connect();
$remoteSystem->disconnect();

// check the client
$remoteSystem->getClient(); // username

// execute a command
$output = $remoteSystem->execute('whoami');

$code = null;
$output = $remoteSystem->execute('crontab -l', $code);

// file system abstraction
$remoteFileSystem = $remoteSystem->getFileSystem();

$dir = $remoteFileSystem->getFile('path/to/dir');
$dir->isDirectory();
$dir->isReadable();
$files = $dir->read();

$file = $remoteFileSystem->getFile('path/to/file');
$file->exists();
$file->getModificationTime();
$content = $file->read();

// remote copy
$destination = $dir->getChild($file->getName());
$destination = $destination->getCopyFile();

$file->copy($destination);

// download a file
$localSystem = new System();
$localFileSystem = $localSystem->getFileSystem();
$localFile = $localFileSystem->getFile('path/to/download');

$file->copy($localFile);

统计信息

  • 总下载量: 26
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 9
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固