コード例 #1
0
ファイル: Backend.php プロジェクト: SevenMonks/100cities-dev
 /**
  * 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
0
ファイル: Backend.php プロジェクト: mat33470/PFA
 /**
  * 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
0
 /**
  * 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
0
ファイル: FileManager.php プロジェクト: romeoz/rock-file
 /**
  * @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
0
 /**
  * @inheritdoc
  */
 public function __construct(AdapterInterface $adapter, $config = null)
 {
     parent::__construct($adapter, $config);
 }
コード例 #6
0
 /**
  * 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
0
 /**
  * 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
0
ファイル: File.php プロジェクト: adrianobnu/parvus-filesystem
    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
0
 public function __construct(\Zend\ServiceManager\ServiceManager $serviceManager, $adapter, $filesystem)
 {
     parent::__construct($adapter);
     $this->service = $serviceManager;
     $this->filesystem = $filesystem;
 }
コード例 #10
0
ファイル: Tempdir.php プロジェクト: emgag/flysystem-tempdir
 /**
  * Creates a temporary directory
  *
  * @param string $prefix
  * @param null   $dir
  */
 public function __construct($prefix = '', $dir = null)
 {
     parent::__construct(new TempdirAdapter($prefix, $dir));
 }