Skip to content

Commit

Permalink
SSH2: openChannel -> open_channel
Browse files Browse the repository at this point in the history
makes openChannel snake case like close_channel already is. this is
not a BC break as openChannel is protected
  • Loading branch information
terrafrost committed Feb 26, 2024
1 parent c2fb513 commit 792314e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion phpseclib/Net/SFTP.php
Expand Up @@ -547,7 +547,7 @@ private function precheck()
*/
private function partial_init_sftp_connection()
{
$response = $this->openChannel(self::CHANNEL, true);
$response = $this->open_channel(self::CHANNEL, true);
if ($response === true && $this->isTimeout()) {
return false;
}
Expand Down
12 changes: 6 additions & 6 deletions phpseclib/Net/SSH2.php
Expand Up @@ -2840,7 +2840,7 @@ public function exec($command, callable $callback = null)
// throw new \RuntimeException('If you want to run multiple exec()\'s you will need to disable (and re-enable if appropriate) a PTY for each one.');
//}

$this->openChannel(self::CHANNEL_EXEC);
$this->open_channel(self::CHANNEL_EXEC);

if ($this->request_pty === true) {
$terminal_modes = pack('C', NET_SSH2_TTY_OP_END);
Expand Down Expand Up @@ -2937,7 +2937,7 @@ public function getOpenChannelCount()
* @param bool $skip_extended
* @return bool
*/
protected function openChannel($channel, $skip_extended = false)
protected function open_channel($channel, $skip_extended = false)
{
if (isset($this->channel_status[$channel]) && $this->channel_status[$channel] != NET_SSH2_MSG_CHANNEL_CLOSE) {
throw new \RuntimeException('Please close the channel (' . $channel . ') before trying to open it again');
Expand Down Expand Up @@ -2994,7 +2994,7 @@ public function openShell()
throw new InsufficientSetupException('Operation disallowed prior to login()');
}

$this->openChannel(self::CHANNEL_SHELL);
$this->open_channel(self::CHANNEL_SHELL);

$terminal_modes = pack('C', NET_SSH2_TTY_OP_END);
$packet = Strings::packSSH2(
Expand Down Expand Up @@ -3242,7 +3242,7 @@ public function write($cmd, $channel = null)
*/
public function startSubsystem($subsystem)
{
$this->openChannel(self::CHANNEL_SUBSYSTEM);
$this->open_channel(self::CHANNEL_SUBSYSTEM);

$packet = Strings::packSSH2(
'CNsCs',
Expand Down Expand Up @@ -3369,7 +3369,7 @@ public function isConnected($level = 0)
if ($level == 1) {
$this->send_binary_packet(pack('CN', NET_SSH2_MSG_IGNORE, 0));
} else {
$this->openChannel(self::CHANNEL_KEEP_ALIVE);
$this->open_channel(self::CHANNEL_KEEP_ALIVE);
$this->close_channel(self::CHANNEL_KEEP_ALIVE);
}
return true;
Expand Down Expand Up @@ -3448,7 +3448,7 @@ public function ping()
}

try {
$this->openChannel(self::CHANNEL_KEEP_ALIVE);
$this->open_channel(self::CHANNEL_KEEP_ALIVE);
} catch (\RuntimeException $e) {
return $this->reconnect();
}
Expand Down

0 comments on commit 792314e

Please sign in to comment.