在多台远程机器上并行运行的命令行的PHP库.zip
今天给大家带来在多台远程机器上并行运行的命令行的PHP库,我们下面来看一段代码。<?php namespace League\Shunt; use League\Shunt\Contracts\SCPInterface; use League\Shunt\Contracts\SessionInterface; use League\Shunt\BaseObject; use Symfony\Component\Console\Output\OutputInterface; use RuntimeException; class SCP extends BaseObject implements SCPInterface { protected $session; public function __construct(SessionInterface $session, OutputInterface $output) { // Set the base object properties parent::__construct($session, $output); if ( ! $session->valid()) throw new RuntimeException('SSH connection failed.'); $this->session = $session; } public function put($localFile = '', $remoteFile = '') { return $this->doRun(__METHOD__, func_get_args(), ssh2_scp_send($this->session->getConnection(), $localFile, $remoteFile)); } public function get($remoteFile = '', $localFile = '') { return $this->doRun(__METHOD__, func_get_args(), ssh2_scp_recv($this->session->getConnection(), $remoteFile, $localFile)); } }
- 1
- 粉丝: 443
- 资源: 1万+
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助