ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
League\Flysystem\Config Class Reference
+ Collaboration diagram for League\Flysystem\Config:

Public Member Functions

 __construct (array $settings=[])
 Constructor. More...
 
 get ($key, $default=null)
 Get a setting. More...
 
 has ($key)
 Check if an item exists by key. More...
 
 set ($key, $value)
 Set a setting. More...
 
 setFallback (Config $fallback)
 Set the fallback. More...
 

Protected Member Functions

 getDefault ($key, $default)
 Try to retrieve a default setting from a config fallback. More...
 

Protected Attributes

 $settings = []
 
 $fallback
 

Detailed Description

Definition at line 5 of file Config.php.

Constructor & Destructor Documentation

◆ __construct()

League\Flysystem\Config::__construct ( array  $settings = [])

Constructor.

Parameters
array$settings

Definition at line 22 of file Config.php.

References League\Flysystem\Config\$settings, and settings().

23  {
24  $this->settings = $settings;
25  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

Member Function Documentation

◆ get()

League\Flysystem\Config::get (   $key,
  $default = null 
)

Get a setting.

Parameters
string$key
mixed$default
Returns
mixed config setting or default when not found

Definition at line 35 of file Config.php.

References $key, League\Flysystem\Config\getDefault(), and settings().

Referenced by League\Flysystem\Adapter\Local\createDir(), League\Flysystem\Adapter\NullAdapter\write(), League\Flysystem\Adapter\Local\write(), League\Flysystem\Adapter\Local\writeStream(), and League\Flysystem\Adapter\Ftp\writeStream().

36  {
37  if ( ! array_key_exists($key, $this->settings)) {
38  return $this->getDefault($key, $default);
39  }
40 
41  return $this->settings[$key];
42  }
settings()
Definition: settings.php:2
getDefault($key, $default)
Try to retrieve a default setting from a config fallback.
Definition: Config.php:70
$default
Definition: build.php:20
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefault()

League\Flysystem\Config::getDefault (   $key,
  $default 
)
protected

Try to retrieve a default setting from a config fallback.

Parameters
string$key
mixed$default
Returns
mixed config setting or default when not found

Definition at line 70 of file Config.php.

References $default, and $key.

Referenced by League\Flysystem\Config\get().

71  {
72  if ( ! $this->fallback) {
73  return $default;
74  }
75 
76  return $this->fallback->get($key, $default);
77  }
$default
Definition: build.php:20
$key
Definition: croninfo.php:18
+ Here is the caller graph for this function:

◆ has()

League\Flysystem\Config::has (   $key)

Check if an item exists by key.

Parameters
string$key
Returns
bool

Definition at line 51 of file Config.php.

References $key, League\Flysystem\Config\has(), and settings().

Referenced by League\Flysystem\Config\has().

52  {
53  if (array_key_exists($key, $this->settings)) {
54  return true;
55  }
56 
57  return $this->fallback instanceof Config
58  ? $this->fallback->has($key)
59  : false;
60  }
settings()
Definition: settings.php:2
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set()

League\Flysystem\Config::set (   $key,
  $value 
)

Set a setting.

Parameters
string$key
mixed$value
Returns
$this

Definition at line 87 of file Config.php.

References $key, and settings().

88  {
89  $this->settings[$key] = $value;
90 
91  return $this;
92  }
settings()
Definition: settings.php:2
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

◆ setFallback()

League\Flysystem\Config::setFallback ( Config  $fallback)

Set the fallback.

Parameters
Config$fallback
Returns
$this

Definition at line 101 of file Config.php.

References League\Flysystem\Config\$fallback.

102  {
103  $this->fallback = $fallback;
104 
105  return $this;
106  }

Field Documentation

◆ $fallback

League\Flysystem\Config::$fallback
protected

Definition at line 15 of file Config.php.

Referenced by League\Flysystem\Config\setFallback().

◆ $settings

League\Flysystem\Config::$settings = []
protected

Definition at line 10 of file Config.php.

Referenced by League\Flysystem\Config\__construct().


The documentation for this class was generated from the following file: