diff --git a/src/AbstractComponent.php b/src/AbstractComponent.php index 9afbe06..964f99b 100644 --- a/src/AbstractComponent.php +++ b/src/AbstractComponent.php @@ -54,6 +54,11 @@ abstract class AbstractComponent extends Component */ public $prefix; + /** + * @var string + */ + public $directorySeparator = '/'; + /** * @var Filesystem */ diff --git a/src/FTPComponent.php b/src/FTPComponent.php index 2d0cffc..4dc5e66 100644 --- a/src/FTPComponent.php +++ b/src/FTPComponent.php @@ -151,7 +151,7 @@ public function init() protected function initAdapter() { $this->root = (string) Yii::getAlias($this->root); - $this->root = FileHelper::normalizePath($this->root . '/' . $this->prefix, '/'); + $this->root = FileHelper::normalizePath($this->root . '/' . $this->prefix, $this->directorySeparator); $options = []; foreach ([ diff --git a/src/LocalComponent.php b/src/LocalComponent.php index df748e2..9f4cd94 100644 --- a/src/LocalComponent.php +++ b/src/LocalComponent.php @@ -78,7 +78,7 @@ public function init() protected function initAdapter() { $this->path = (string) Yii::getAlias($this->path); - $this->_location = FileHelper::normalizePath($this->path . '/' . $this->prefix, '/'); + $this->_location = FileHelper::normalizePath($this->path . '/' . $this->prefix, $this->directorySeparator); return new LocalFilesystemAdapter($this->_location); } diff --git a/src/SftpComponent.php b/src/SftpComponent.php index c293365..50a5d4b 100644 --- a/src/SftpComponent.php +++ b/src/SftpComponent.php @@ -138,7 +138,7 @@ public function init() protected function initAdapter() { $this->root = (string) Yii::getAlias($this->root); - $this->root = FileHelper::normalizePath($this->root . '/' . $this->prefix, '/'); + $this->root = FileHelper::normalizePath($this->root . '/' . $this->prefix, $this->directorySeparator); $options = []; foreach ([