文件名称:在多台远程机器上并行运行的命令行的PHP库.zip
文件大小:35KB
文件格式:ZIP
更新时间:2022-07-31 03:25:08
类库下载-在多台远程机器上并行运行的命令行的PHP库
今天给大家带来在多台远程机器上并行运行的命令行的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)); } }
【文件预览】:
shunt-master
----composer.json(910B)
----.travis.yml(536B)
----bin()
--------shunt(2KB)
----.noninteractive(0B)
----LICENSE(1KB)
----CONTRIBUTING.md(234B)
----src()
--------League()
----travis.xml.dist(2KB)
----.shuntpwd(22B)
----.gitignore(33B)
----CHANGELOG.md(344B)
----phpunit.xml.dist(794B)
----README.md(5KB)