本文整理汇总了PHP中League\Flysystem\Filesystem::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::__construct方法的具体用法?PHP Filesystem::__construct怎么用?PHP Filesystem::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类League\Flysystem\Filesystem
的用法示例。
在下文中一共展示了Filesystem::__construct方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* @param array $backendConfig backend configuration node
* @param AclInterface $acl CKFinder ACL
* @param Config $ckConfig CKFinder Config
* @param AdapterInterface $adapter adapter
* @param null $config config
*/
public function __construct(array $backendConfig, AclInterface $acl, Config $ckConfig, AdapterInterface $adapter, $config = null)
{
$this->backendConfig = $backendConfig;
$this->acl = $acl;
$this->ckConfig = $ckConfig;
parent::__construct($adapter, $config);
$this->addPlugin(new GetWithMetadata());
}
示例2: __construct
/**
* Constructor.
*
* @param array $backendConfig the backend configuration node
* @param CKFinder $app the CKFinder app container
* @param AdapterInterface $adapter the adapter
* @param array|null $filesystemConfig the configuration
*/
public function __construct(array $backendConfig, CKFinder $app, AdapterInterface $adapter, $filesystemConfig = null)
{
$this->app = $app;
$this->backendConfig = $backendConfig;
$this->acl = $app['acl'];
$this->ckConfig = $app['config'];
parent::__construct($adapter, $filesystemConfig);
$this->addPlugin(new GetWithMetadata());
}
示例3: __construct
/**
* FileManagement constructor.
* @param string $host
* @param string $username
* @param string $password
* @param array $settings
*/
public function __construct($host, $username, $password, $settings = array())
{
$settings['baseUri'] = $host;
$settings['userName'] = $username;
$settings['password'] = $password;
$client = new \Sabre\DAV\Client($settings);
$adapter = new WebDAVAdapter($client, 'remote.php/webdav/');
parent::__construct($adapter);
}
示例4: __construct
/**
* @inheritdoc
*/
public function __construct($config = [])
{
$this->parentConstruct($config);
if ($this->cache instanceof CacheInterface) {
$this->cache->save();
$this->adapter = new CachedAdapter($this->adapter, $this->cache);
}
parent::__construct($this->adapter, $this->config);
$this->addPlugin(new ListPaths());
$this->addPlugin(new ListWith());
$this->addPlugin(new GetWithMetadata());
}
示例5: __construct
/**
* @inheritdoc
*/
public function __construct(AdapterInterface $adapter, $config = null)
{
parent::__construct($adapter, $config);
}
示例6: __construct
/**
* Create a new AdapterFilesystem instance.
*
* @param DiskInterface $disk
* @param AdapterInterface $adapter
* @param null $config
*/
public function __construct(DiskInterface $disk, AdapterInterface $adapter, $config = null)
{
$this->disk = $disk;
parent::__construct($adapter, $config);
}
示例7: __construct
/**
* Constructor.
*
* @param AdapterInterface $adapter
* @param CacheInterface $cache
* @param mixed $config
* @param Emitter $emitter
*/
public function __construct(AdapterInterface $adapter, CacheInterface $cache = null, $config = null, Emitter $emitter = null)
{
$this->setEmitter($emitter);
parent::__construct($adapter, $cache, $config);
}
示例8: __construct
public final function __construct($prDisk = NULL)
{
$defaultDisk = NULL;
$returnAdapter = NULL;
$file = path . 'app/config/File.php';
/** If the config file not exists */
if (!file_exists($file)) {
$tmp = @fopen($file, 'w+');
@fwrite($tmp, '<?php
return array (
\'default\' => \'local\',
\'local\' => array (
\'adapter\' => \'local\',
\'path\' => \'\'
),
/*\'aws-s3\' => array (
\'adapter\' => \'s3\',
\'key\' => \'\',
\'secret\' => \'\',
\'region\' => \'\',
\'prefix\' => NULL,
\'bucket\' => \'\'
)*/
);');
@fclose($tmp);
@chmod($file, 0775);
if (!file_exists($file)) {
trigger_error('File config not found in app/config [' . $file . '].', E_USER_ERROR);
}
}
$aConfigTMP = (include $file);
foreach ($aConfigTMP as $label => $aConfig) {
if ($label == 'default' && !is_array($aConfig)) {
$defaultDisk = $aConfig;
continue;
}
if ($aConfig['adapter'] == NULL) {
trigger_error('Adapter missing in connection ' . $label, E_USER_ERROR);
} else {
$adapter = NULL;
switch (mb_strtolower($aConfig['adapter'], 'UTF-8')) {
case 'local':
if ($aConfig['path'] == NULL) {
trigger_error('Path for connection ' . $label . ' is not defined.', E_USER_ERROR);
return false;
}
$adapter = new Local($aConfig['path']);
break;
case 's3':
if ($aConfig['key'] == NULL) {
trigger_error('Key for connection ' . $label . ' is not defined.', E_USER_ERROR);
return false;
}
if ($aConfig['secret'] == NULL) {
trigger_error('Secret for connection ' . $label . ' is not defined.', E_USER_ERROR);
return false;
}
if ($aConfig['bucket'] == NULL) {
trigger_error('Bucket for connection ' . $label . ' is not defined.', E_USER_ERROR);
return false;
}
$client = S3Client::factory(array('credentials' => new Credentials($aConfig['key'], $aConfig['secret']), 'region' => $aConfig['region']));
$adapter = new AwsS3Adapter($client, $aConfig['bucket'], $aConfig['prefix']);
break;
}
if ($label == $defaultDisk) {
$returnAdapter = $adapter;
}
if ($label == $prDisk) {
$returnAdapter = $adapter;
$defaultDisk = NULL;
}
}
}
return parent::__construct($returnAdapter);
}
示例9: __construct
public function __construct(\Zend\ServiceManager\ServiceManager $serviceManager, $adapter, $filesystem)
{
parent::__construct($adapter);
$this->service = $serviceManager;
$this->filesystem = $filesystem;
}
示例10: __construct
/**
* Creates a temporary directory
*
* @param string $prefix
* @param null $dir
*/
public function __construct($prefix = '', $dir = null)
{
parent::__construct(new TempdirAdapter($prefix, $dir));
}