for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the 2amigos/yii2-flysystem-component project.
*
* (c) 2amigOS! <http://2amigos.us/>
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace dosamigos\flysystem;
use League\Flysystem\WebDAV\WebDAVAdapter;
use Sabre\DAV\Client;
use yii\base\InvalidConfigException;
class WebDAVFsComponent extends AbstractFsComponent
{
* @var string
public $baseUri;
public $userName;
public $password;
public $proxy;
* @var integer
public $authType;
public $encoding;
* @var string|null
public $prefix;
* @inheritdoc
public function init()
if ($this->baseUri === null) {
throw new InvalidConfigException('The "baseUri" property must be set.');
}
parent::init();
* @return WebDAVAdapter
protected function initAdapter()
$config = array_filter(
[
'baseUri' => $this->baseUri,
'userName' => $this->userName,
'password' => $this->password,
'proxy' => $this->proxy,
'authType' => $this->authType,
'encoding' => $this->encoding,
]
);
return new WebDAVAdapter(new Client($config), $this->prefix);