当前位置: 首页>>代码示例>>PHP>>正文


PHP Config::has方法代码示例

本文整理汇总了PHP中League\Flysystem\Config::has方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::has方法的具体用法?PHP Config::has怎么用?PHP Config::has使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在League\Flysystem\Config的用法示例。


在下文中一共展示了Config::has方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getOptionsFromConfig

 /**
  * Returns an array of options from the config.
  *
  * @param Config $config
  * @return array
  */
 protected function getOptionsFromConfig(Config $config)
 {
     $options = [];
     if ($config->has('visibility')) {
         $options['acl'] = $config->get('visibility') === AdapterInterface::VISIBILITY_PUBLIC ? 'publicRead' : 'private';
     }
     if ($config->has('mimetype')) {
         $options['mimetype'] = $config->get('mimetype');
     }
     // TODO: consider other metadata which we can set here
     return $options;
 }
开发者ID:codixor,项目名称:flysystem-google-storage,代码行数:18,代码来源:GoogleStorageAdapter.php

示例2: write

 /**
  * Write a new file.
  *
  * @param string $path
  * @param string $contents
  * @param Config $config   Config object
  *
  * @return array|false false on failure file meta data on success
  */
 public function write($path, $contents, Config $config)
 {
     if ($config->has('ttl') && !$config->has('expirationType')) {
         $config->set('expirationType', self::EXPIRE_IN_SECONDS);
     }
     $args = array_merge([$path, $contents], array_filter([$config->get('expirationType'), $config->get('ttl'), $config->get('setFlag')], function ($value) {
         return !is_null($value);
     }));
     if (!call_user_func_array([$this->client, 'set'], $args)) {
         return false;
     }
     return compact('path', 'contents');
 }
开发者ID:patrickrose,项目名称:flysystem-redis,代码行数:22,代码来源:RedisAdapter.php

示例3: write

 /**
  * {@inheritdoc}
  */
 public function write($path, $contents, Config $config)
 {
     $location = $this->applyPathPrefix($path);
     $headers = [];
     if ($config && $config->has('headers')) {
         $headers = $config->get('headers');
     }
     $response = $this->container->uploadObject($location, $contents, $headers);
     return $this->normalizeObject($response);
 }
开发者ID:jiiis,项目名称:ptn,代码行数:13,代码来源:RackspaceAdapter.php

示例4: testGet

 public function testGet()
 {
     $config = new Config();
     $this->assertFalse($config->has('setting'));
     $this->assertNull($config->get('setting'));
     $config->set('setting', 'value');
     $this->assertEquals('value', $config->get('setting'));
     $fallback = new Config(['fallback_setting' => 'fallback_value']);
     $config->setFallback($fallback);
     $this->assertEquals('fallback_value', $config->get('fallback_setting'));
 }
开发者ID:mechiko,项目名称:staff-october,代码行数:11,代码来源:ConfigTests.php

示例5: getOptionsFromConfig

 /**
  * Get options from the config.
  *
  * @param Config $config
  *
  * @return array
  */
 protected function getOptionsFromConfig(Config $config)
 {
     $options = $this->options;
     if ($visibility = $config->get('visibility')) {
         // For local reference
         $options['visibility'] = $visibility;
         // For external reference
         $options['ACL'] = $visibility === AdapterInterface::VISIBILITY_PUBLIC ? 'public-read' : 'private';
     }
     if ($mimetype = $config->get('mimetype')) {
         // For local reference
         $options['mimetype'] = $mimetype;
         // For external reference
         $options['ContentType'] = $mimetype;
     }
     foreach (static::$metaOptions as $option) {
         if (!$config->has($option)) {
             continue;
         }
         $options[$option] = $config->get($option);
     }
     return $options;
 }
开发者ID:janhartigan,项目名称:flysystem-aws-s3-v3,代码行数:30,代码来源:AwsS3Adapter.php

示例6: getOptionsFromConfig

 /**
  * Get options from the config.
  *
  * @param Config $config
  * @return array
  */
 protected function getOptionsFromConfig(Config $config)
 {
     $options = $this->options;
     foreach (static::$mappingOptions as $option => $ossOption) {
         if (!$config->has($option)) {
             continue;
         }
         $options[$ossOption] = $config->get($option);
     }
     return $options;
 }
开发者ID:apollopy,项目名称:flysystem-aliyun-oss,代码行数:17,代码来源:AliyunOssAdapter.php

示例7: getOptionsFromConfig

 /**
  * Retrieve options from a Config instance.
  *
  * @param Config $config
  *
  * @return array
  */
 protected function getOptionsFromConfig(Config $config)
 {
     $options = [];
     foreach (static::$metaOptions as $option) {
         if (!$config->has($option)) {
             continue;
         }
         $options[$option] = $config->get($option);
     }
     if ($mimetype = $config->get('mimetype')) {
         // For local reference
         $options['mimetype'] = $mimetype;
         // For external reference
         $options['ContentType'] = $mimetype;
     }
     return $options;
 }
开发者ID:hellojujian,项目名称:aliyun-oss,代码行数:24,代码来源:AliyunOssAdapter.php

示例8: getOptionsFromConfig

 /**
  * Retrieve options from a Config instance.
  *
  * @param Config $config
  *
  * @return CreateBlobOptions
  */
 protected function getOptionsFromConfig(Config $config)
 {
     $options = new CreateBlobOptions();
     foreach (static::$metaOptions as $option) {
         if (!$config->has($option)) {
             continue;
         }
         call_user_func([$options, "set{$option}"], $config->get($option));
     }
     if ($mimetype = $config->get('mimetype')) {
         $options->setContentType($mimetype);
     }
     return $options;
 }
开发者ID:mat33470,项目名称:PFA,代码行数:21,代码来源:AzureAdapter.php


注:本文中的League\Flysystem\Config::has方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。