initial commit

This commit is contained in:
Milos Stojanovic
2019-06-13 18:52:40 +02:00
commit 261607e1d3
160 changed files with 41704 additions and 0 deletions

42
backend/Config/Config.php Normal file
View File

@@ -0,0 +1,42 @@
<?php
/*
* This file is part of the FileGator package.
*
* (c) Milos Stojanovic <alcalbg@gmail.com>
*
* For the full copyright and license information, please view the LICENSE file
*/
namespace Filegator\Config;
class Config
{
protected $config;
public function __construct(array $config = [])
{
$this->config = $config;
}
public function get($key = null, $default = null)
{
if (is_null($key)) {
return $this->config;
}
$key = is_array($key) ? $key : explode('.', $key);
$target = $this->config;
while (! is_null($segment = array_shift($key))) {
if (is_array($target) && array_key_exists($segment, $target)) {
$target = $target[$segment];
} else {
return $default;
}
}
return $target;
}
}