Skip to content

Commit

Permalink
Add directorySeparator Normalize
Browse files Browse the repository at this point in the history
  • Loading branch information
sugeng-sulistiyawan committed May 8, 2023
1 parent fa324ff commit 0192d97
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/AbstractComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ abstract class AbstractComponent extends Component
*/
public $prefix;

/**
* @var string
*/
public $directorySeparator = '/';

/**
* @var Filesystem
*/
Expand Down
2 changes: 1 addition & 1 deletion src/FTPComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([
Expand Down
2 changes: 1 addition & 1 deletion src/LocalComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/SftpComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([
Expand Down

0 comments on commit 0192d97

Please sign in to comment.