Update to Drupal 8.0.0-rc3. For more information, see https://www.drupal.org/node/2608078
This commit is contained in:
parent
6419a031d7
commit
4afb23bbd3
762 changed files with 20080 additions and 6368 deletions
|
@ -13,7 +13,7 @@ namespace Drupal\Core\FileTransfer;
|
|||
abstract class FTP extends FileTransfer {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\Core\FileTransfer\FileTransfer::__construct().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct($jail, $username, $password, $hostname, $port) {
|
||||
$this->username = $username;
|
||||
|
@ -24,7 +24,7 @@ abstract class FTP extends FileTransfer {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\Core\FileTransfer\FileTransfer::factory().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
static function factory($jail, $settings) {
|
||||
$username = empty($settings['username']) ? '' : $settings['username'];
|
||||
|
@ -43,7 +43,7 @@ abstract class FTP extends FileTransfer {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\Core\FileTransfer\FileTransfer::getSettingsForm().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSettingsForm() {
|
||||
$form = parent::getSettingsForm();
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Drupal\Core\FileTransfer;
|
|||
class FTPExtension extends FTP implements ChmodInterface {
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::connect().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function connect() {
|
||||
$this->connection = ftp_connect($this->hostname, $this->port);
|
||||
|
@ -27,7 +27,7 @@ class FTPExtension extends FTP implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::copyFileJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function copyFileJailed($source, $destination) {
|
||||
if (!@ftp_put($this->connection, $destination, $source, FTP_BINARY)) {
|
||||
|
@ -36,7 +36,7 @@ class FTPExtension extends FTP implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::createDirectoryJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function createDirectoryJailed($directory) {
|
||||
if (!ftp_mkdir($this->connection, $directory)) {
|
||||
|
@ -45,7 +45,7 @@ class FTPExtension extends FTP implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::removeDirectoryJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function removeDirectoryJailed($directory) {
|
||||
$pwd = ftp_pwd($this->connection);
|
||||
|
@ -75,7 +75,7 @@ class FTPExtension extends FTP implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::removeFileJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function removeFileJailed($destination) {
|
||||
if (!ftp_delete($this->connection, $destination)) {
|
||||
|
@ -84,7 +84,7 @@ class FTPExtension extends FTP implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::isDirectory().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isDirectory($path) {
|
||||
$result = FALSE;
|
||||
|
@ -97,14 +97,14 @@ class FTPExtension extends FTP implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::isFile().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isFile($path) {
|
||||
return ftp_size($this->connection, $path) != -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\ChmodInterface::chmodJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
function chmodJailed($path, $mode, $recursive) {
|
||||
if (!ftp_chmod($this->connection, $mode, $path)) {
|
||||
|
|
|
@ -13,21 +13,21 @@ namespace Drupal\Core\FileTransfer;
|
|||
class Local extends FileTransfer implements ChmodInterface {
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::connect().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function connect() {
|
||||
// No-op
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\Core\FileTransfer\FileTransfer::factory().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
static function factory($jail, $settings) {
|
||||
return new Local($jail);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::copyFileJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function copyFileJailed($source, $destination) {
|
||||
if (@!copy($source, $destination)) {
|
||||
|
@ -36,7 +36,7 @@ class Local extends FileTransfer implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::createDirectoryJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function createDirectoryJailed($directory) {
|
||||
if (!is_dir($directory) && @!mkdir($directory, 0777, TRUE)) {
|
||||
|
@ -45,7 +45,7 @@ class Local extends FileTransfer implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::removeDirectoryJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function removeDirectoryJailed($directory) {
|
||||
if (!is_dir($directory)) {
|
||||
|
@ -70,7 +70,7 @@ class Local extends FileTransfer implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::removeFileJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function removeFileJailed($file) {
|
||||
if (@!drupal_unlink($file)) {
|
||||
|
@ -79,21 +79,21 @@ class Local extends FileTransfer implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::isDirectory().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isDirectory($path) {
|
||||
return is_dir($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::isFile().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isFile($path) {
|
||||
return is_file($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\ChmodInterface::chmodJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function chmodJailed($path, $mode, $recursive) {
|
||||
if ($recursive && is_dir($path)) {
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Drupal\Core\FileTransfer;
|
|||
class SSH extends FileTransfer implements ChmodInterface {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\Core\FileTransfer\FileTransfer::__construct().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
function __construct($jail, $username, $password, $hostname = "localhost", $port = 22) {
|
||||
$this->username = $username;
|
||||
|
@ -24,7 +24,7 @@ class SSH extends FileTransfer implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::connect().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function connect() {
|
||||
$this->connection = @ssh2_connect($this->hostname, $this->port);
|
||||
|
@ -37,7 +37,7 @@ class SSH extends FileTransfer implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\Core\FileTransfer\FileTransfer::factory().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
static function factory($jail, $settings) {
|
||||
$username = empty($settings['username']) ? '' : $settings['username'];
|
||||
|
@ -48,7 +48,7 @@ class SSH extends FileTransfer implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::copyFileJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function copyFileJailed($source, $destination) {
|
||||
if (!@ssh2_scp_send($this->connection, $source, $destination)) {
|
||||
|
@ -57,7 +57,7 @@ class SSH extends FileTransfer implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::copyDirectoryJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function copyDirectoryJailed($source, $destination) {
|
||||
if (@!ssh2_exec($this->connection, 'cp -Rp ' . escapeshellarg($source) . ' ' . escapeshellarg($destination))) {
|
||||
|
@ -66,7 +66,7 @@ class SSH extends FileTransfer implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::createDirectoryJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function createDirectoryJailed($directory) {
|
||||
if (@!ssh2_exec($this->connection, 'mkdir ' . escapeshellarg($directory))) {
|
||||
|
@ -75,7 +75,7 @@ class SSH extends FileTransfer implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::removeDirectoryJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function removeDirectoryJailed($directory) {
|
||||
if (@!ssh2_exec($this->connection, 'rm -Rf ' . escapeshellarg($directory))) {
|
||||
|
@ -84,7 +84,7 @@ class SSH extends FileTransfer implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::removeFileJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function removeFileJailed($destination) {
|
||||
if (!@ssh2_exec($this->connection, 'rm ' . escapeshellarg($destination))) {
|
||||
|
@ -113,7 +113,7 @@ class SSH extends FileTransfer implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\FileTransfer::isFile().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isFile($path) {
|
||||
$file = escapeshellarg($path);
|
||||
|
@ -130,7 +130,7 @@ class SSH extends FileTransfer implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\FileTransfer\ChmodInterface::chmodJailed().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
function chmodJailed($path, $mode, $recursive) {
|
||||
$cmd = sprintf("chmod %s%o %s", $recursive ? '-R ' : '', $mode, escapeshellarg($path));
|
||||
|
@ -140,7 +140,7 @@ class SSH extends FileTransfer implements ChmodInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\Core\FileTransfer\FileTransfer::getSettingsForm().
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSettingsForm() {
|
||||
$form = parent::getSettingsForm();
|
||||
|
|
Reference in a new issue