Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SSH.php

function SSH::chmodJailed

Overrides ChmodInterface::chmodJailed

File

core/lib/Drupal/Core/FileTransfer/SSH.php, line 130

Class

SSH
The SSH connection class for the update module.

Namespace

Drupal\Core\FileTransfer

Code

public function chmodJailed($path, $mode, $recursive) {
    $cmd = sprintf("chmod %s%o %s", $recursive ? '-R ' : '', $mode, escapeshellarg($path));
    if (@(!ssh2_exec($this->connection, $cmd))) {
        throw new FileTransferException('Cannot change permissions of @path.', 0, [
            '@path' => $path,
        ]);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal