* @param string $destination
* The destination path.
*/
- public final function copyDirectory($source, $destination) {
+ final public function copyDirectory($source, $destination) {
$source = $this->sanitizePath($source);
$destination = $this->fixRemotePath($destination);
$this->checkPath($destination);
*
* @see http://php.net/chmod
*/
- public final function chmod($path, $mode, $recursive = FALSE) {
+ final public function chmod($path, $mode, $recursive = FALSE) {
if (!($this instanceof ChmodInterface)) {
throw new FileTransferException('Unable to change file permissions');
}
* @param string $directory
* The directory to be created.
*/
- public final function createDirectory($directory) {
+ final public function createDirectory($directory) {
$directory = $this->fixRemotePath($directory);
$this->checkPath($directory);
$this->createDirectoryJailed($directory);
* @param string $directory
* The directory to be removed.
*/
- public final function removeDirectory($directory) {
+ final public function removeDirectory($directory) {
$directory = $this->fixRemotePath($directory);
$this->checkPath($directory);
$this->removeDirectoryJailed($directory);
* @param string $destination
* The destination file.
*/
- public final function copyFile($source, $destination) {
+ final public function copyFile($source, $destination) {
$source = $this->sanitizePath($source);
$destination = $this->fixRemotePath($destination);
$this->checkPath($destination);
* @param string $destination
* The destination file to be removed.
*/
- public final function removeFile($destination) {
+ final public function removeFile($destination) {
$destination = $this->fixRemotePath($destination);
$this->checkPath($destination);
$this->removeFileJailed($destination);
*
* @throws \Drupal\Core\FileTransfer\FileTransferException
*/
- protected final function checkPath($path) {
+ final protected function checkPath($path) {
$full_jail = $this->chroot . $this->jail;
$full_path = drupal_realpath(substr($this->chroot . $path, 0, strlen($full_jail)));
$full_path = $this->fixRemotePath($full_path, FALSE);
* @return string
* The modified path.
*/
- protected final function fixRemotePath($path, $strip_chroot = TRUE) {
+ final protected function fixRemotePath($path, $strip_chroot = TRUE) {
$path = $this->sanitizePath($path);
- $path = preg_replace('|^([a-z]{1}):|i', '', $path); // Strip out windows driveletter if its there.
+ // Strip out windows driveletter if its there.
+ $path = preg_replace('|^([a-z]{1}):|i', '', $path);
if ($strip_chroot) {
if ($this->chroot && strpos($path, $this->chroot) === 0) {
$path = ($path == $this->chroot) ? '' : substr($path, strlen($this->chroot));
* The modified path.
*/
public function sanitizePath($path) {
- $path = str_replace('\\', '/', $path); // Windows path sanitization.
+ // Windows path sanitization.
+ $path = str_replace('\\', '/', $path);
if (substr($path, -1) == '/') {
$path = substr($path, 0, -1);
}