Primo Committ
This commit is contained in:
21
vendor/laravel/framework/src/Illuminate/Config/LICENSE.md
vendored
Normal file
21
vendor/laravel/framework/src/Illuminate/Config/LICENSE.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Taylor Otwell
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
179
vendor/laravel/framework/src/Illuminate/Config/Repository.php
vendored
Normal file
179
vendor/laravel/framework/src/Illuminate/Config/Repository.php
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Config;
|
||||
|
||||
use ArrayAccess;
|
||||
use Illuminate\Contracts\Config\Repository as ConfigContract;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class Repository implements ArrayAccess, ConfigContract
|
||||
{
|
||||
/**
|
||||
* All of the configuration items.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $items = [];
|
||||
|
||||
/**
|
||||
* Create a new configuration repository.
|
||||
*
|
||||
* @param array $items
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(array $items = [])
|
||||
{
|
||||
$this->items = $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the given configuration value exists.
|
||||
*
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function has($key)
|
||||
{
|
||||
return Arr::has($this->items, $key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the specified configuration value.
|
||||
*
|
||||
* @param array|string $key
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($key, $default = null)
|
||||
{
|
||||
if (is_array($key)) {
|
||||
return $this->getMany($key);
|
||||
}
|
||||
|
||||
return Arr::get($this->items, $key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get many configuration values.
|
||||
*
|
||||
* @param array $keys
|
||||
* @return array
|
||||
*/
|
||||
public function getMany($keys)
|
||||
{
|
||||
$config = [];
|
||||
|
||||
foreach ($keys as $key => $default) {
|
||||
if (is_numeric($key)) {
|
||||
[$key, $default] = [$default, null];
|
||||
}
|
||||
|
||||
$config[$key] = Arr::get($this->items, $key, $default);
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a given configuration value.
|
||||
*
|
||||
* @param array|string $key
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function set($key, $value = null)
|
||||
{
|
||||
$keys = is_array($key) ? $key : [$key => $value];
|
||||
|
||||
foreach ($keys as $key => $value) {
|
||||
Arr::set($this->items, $key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepend a value onto an array configuration value.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function prepend($key, $value)
|
||||
{
|
||||
$array = $this->get($key);
|
||||
|
||||
array_unshift($array, $value);
|
||||
|
||||
$this->set($key, $array);
|
||||
}
|
||||
|
||||
/**
|
||||
* Push a value onto an array configuration value.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function push($key, $value)
|
||||
{
|
||||
$array = $this->get($key);
|
||||
|
||||
$array[] = $value;
|
||||
|
||||
$this->set($key, $array);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of the configuration items for the application.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the given configuration option exists.
|
||||
*
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function offsetExists($key)
|
||||
{
|
||||
return $this->has($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a configuration option.
|
||||
*
|
||||
* @param string $key
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($key)
|
||||
{
|
||||
return $this->get($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a configuration option.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($key, $value)
|
||||
{
|
||||
$this->set($key, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unset a configuration option.
|
||||
*
|
||||
* @param string $key
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($key)
|
||||
{
|
||||
$this->set($key, null);
|
||||
}
|
||||
}
|
||||
35
vendor/laravel/framework/src/Illuminate/Config/composer.json
vendored
Executable file
35
vendor/laravel/framework/src/Illuminate/Config/composer.json
vendored
Executable file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "illuminate/config",
|
||||
"description": "The Illuminate Config package.",
|
||||
"license": "MIT",
|
||||
"homepage": "https://laravel.com",
|
||||
"support": {
|
||||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "Taylor Otwell",
|
||||
"email": "taylor@laravel.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.2.5|^8.0",
|
||||
"illuminate/contracts": "^7.0",
|
||||
"illuminate/support": "^7.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Illuminate\\Config\\": ""
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "7.x-dev"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
Reference in New Issue
Block a user