Add vendor files to dist
This commit is contained in:
4
vendor/composer/autoload_classmap.php
vendored
4
vendor/composer/autoload_classmap.php
vendored
@@ -1157,7 +1157,7 @@ return array(
|
||||
'Illuminate\\Contracts\\Console\\Application' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Console/Application.php',
|
||||
'Illuminate\\Contracts\\Console\\Kernel' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Console/Kernel.php',
|
||||
'Illuminate\\Contracts\\Container\\BindingResolutionException' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Container/BindingResolutionException.php',
|
||||
'Illuminate\\Contracts\\Container\\Container' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Container/Container.php',
|
||||
'Illuminate\\Contracts\\Container\\Container' => $baseDir . '/overrides/laravel/framework/src/Illuminate/Contracts/Container/Container.php',
|
||||
'Illuminate\\Contracts\\Container\\ContextualBindingBuilder' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Container/ContextualBindingBuilder.php',
|
||||
'Illuminate\\Contracts\\Cookie\\Factory' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Cookie/Factory.php',
|
||||
'Illuminate\\Contracts\\Cookie\\QueueingFactory' => $vendorDir . '/laravel/framework/src/Illuminate/Contracts/Cookie/QueueingFactory.php',
|
||||
@@ -1670,7 +1670,7 @@ return array(
|
||||
'Illuminate\\Session\\Store' => $vendorDir . '/laravel/framework/src/Illuminate/Session/Store.php',
|
||||
'Illuminate\\Session\\TokenMismatchException' => $vendorDir . '/laravel/framework/src/Illuminate/Session/TokenMismatchException.php',
|
||||
'Illuminate\\Support\\AggregateServiceProvider' => $vendorDir . '/laravel/framework/src/Illuminate/Support/AggregateServiceProvider.php',
|
||||
'Illuminate\\Support\\Arr' => $vendorDir . '/laravel/framework/src/Illuminate/Support/Arr.php',
|
||||
'Illuminate\\Support\\Arr' => $baseDir . '/overrides/laravel/framework/src/Illuminate/Support/Arr.php',
|
||||
'Illuminate\\Support\\Carbon' => $baseDir . '/overrides/laravel/framework/src/Illuminate/Support/Carbon.php',
|
||||
'Illuminate\\Support\\Collection' => $baseDir . '/overrides/laravel/framework/src/Illuminate/Support/Collection.php',
|
||||
'Illuminate\\Support\\Composer' => $vendorDir . '/laravel/framework/src/Illuminate/Support/Composer.php',
|
||||
|
||||
1
vendor/composer/autoload_psr4.php
vendored
1
vendor/composer/autoload_psr4.php
vendored
@@ -117,6 +117,7 @@ return array(
|
||||
'Illuminate\\Database\\' => array($baseDir . '/overrides/laravel/framework/src/Illuminate/Database'),
|
||||
'Illuminate\\Cookie\\Middleware\\' => array($baseDir . '/overrides/laravel/framework/src/Illuminate/Cookie/Middleware'),
|
||||
'Illuminate\\Cookie\\' => array($baseDir . '/overrides/laravel/framework/src/Illuminate/Cookie'),
|
||||
'Illuminate\\Contracts\\Container\\' => array($baseDir . '/overrides/laravel/framework/src/Illuminate/Contracts/Container'),
|
||||
'Illuminate\\Container\\' => array($baseDir . '/overrides/laravel/framework/src/Illuminate/Container'),
|
||||
'Illuminate\\Console\\' => array($baseDir . '/overrides/laravel/framework/src/Illuminate/Console'),
|
||||
'Illuminate\\Config\\' => array($baseDir . '/overrides/laravel/framework/src/Illuminate/Config'),
|
||||
|
||||
9
vendor/composer/autoload_static.php
vendored
9
vendor/composer/autoload_static.php
vendored
@@ -181,6 +181,7 @@ class ComposerStaticInitbf8dc242a640d7c740f283f226d0bdb4
|
||||
'Illuminate\\Database\\' => 20,
|
||||
'Illuminate\\Cookie\\Middleware\\' => 29,
|
||||
'Illuminate\\Cookie\\' => 18,
|
||||
'Illuminate\\Contracts\\Container\\' => 31,
|
||||
'Illuminate\\Container\\' => 21,
|
||||
'Illuminate\\Console\\' => 19,
|
||||
'Illuminate\\Config\\' => 18,
|
||||
@@ -719,6 +720,10 @@ class ComposerStaticInitbf8dc242a640d7c740f283f226d0bdb4
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/overrides/laravel/framework/src/Illuminate/Cookie',
|
||||
),
|
||||
'Illuminate\\Contracts\\Container\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/overrides/laravel/framework/src/Illuminate/Contracts/Container',
|
||||
),
|
||||
'Illuminate\\Container\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/overrides/laravel/framework/src/Illuminate/Container',
|
||||
@@ -2126,7 +2131,7 @@ class ComposerStaticInitbf8dc242a640d7c740f283f226d0bdb4
|
||||
'Illuminate\\Contracts\\Console\\Application' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Console/Application.php',
|
||||
'Illuminate\\Contracts\\Console\\Kernel' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Console/Kernel.php',
|
||||
'Illuminate\\Contracts\\Container\\BindingResolutionException' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Container/BindingResolutionException.php',
|
||||
'Illuminate\\Contracts\\Container\\Container' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Container/Container.php',
|
||||
'Illuminate\\Contracts\\Container\\Container' => __DIR__ . '/../..' . '/overrides/laravel/framework/src/Illuminate/Contracts/Container/Container.php',
|
||||
'Illuminate\\Contracts\\Container\\ContextualBindingBuilder' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Container/ContextualBindingBuilder.php',
|
||||
'Illuminate\\Contracts\\Cookie\\Factory' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Cookie/Factory.php',
|
||||
'Illuminate\\Contracts\\Cookie\\QueueingFactory' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Contracts/Cookie/QueueingFactory.php',
|
||||
@@ -2639,7 +2644,7 @@ class ComposerStaticInitbf8dc242a640d7c740f283f226d0bdb4
|
||||
'Illuminate\\Session\\Store' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Session/Store.php',
|
||||
'Illuminate\\Session\\TokenMismatchException' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Session/TokenMismatchException.php',
|
||||
'Illuminate\\Support\\AggregateServiceProvider' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/AggregateServiceProvider.php',
|
||||
'Illuminate\\Support\\Arr' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/Arr.php',
|
||||
'Illuminate\\Support\\Arr' => __DIR__ . '/../..' . '/overrides/laravel/framework/src/Illuminate/Support/Arr.php',
|
||||
'Illuminate\\Support\\Carbon' => __DIR__ . '/../..' . '/overrides/laravel/framework/src/Illuminate/Support/Carbon.php',
|
||||
'Illuminate\\Support\\Collection' => __DIR__ . '/../..' . '/overrides/laravel/framework/src/Illuminate/Support/Collection.php',
|
||||
'Illuminate\\Support\\Composer' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/Composer.php',
|
||||
|
||||
4
vendor/composer/installed.php
vendored
4
vendor/composer/installed.php
vendored
@@ -3,7 +3,7 @@
|
||||
'name' => 'freescout-helpdesk/freescout',
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '3ad3cf5ab91c52c72c8a54d59b14e86cd73ec682',
|
||||
'reference' => 'f8f9400e0636f4b7c076abe80dd7c87a428e139f',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
@@ -175,7 +175,7 @@
|
||||
'freescout-helpdesk/freescout' => array(
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '3ad3cf5ab91c52c72c8a54d59b14e86cd73ec682',
|
||||
'reference' => 'f8f9400e0636f4b7c076abe80dd7c87a428e139f',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
// Don't redefine the functions if included multiple times.
|
||||
if (!function_exists('GuzzleHttp\Promise\promise_for')) {
|
||||
require __DIR__ . '/functions.php';
|
||||
require __DIR__ . '/../../../../overrides/guzzlehttp/promises/src/functions.php';
|
||||
}
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Contracts\Container;
|
||||
|
||||
use Closure;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
interface Container extends ContainerInterface
|
||||
{
|
||||
/**
|
||||
* Determine if the given abstract type has been bound.
|
||||
*
|
||||
* @param string $abstract
|
||||
* @return bool
|
||||
*/
|
||||
public function bound($abstract);
|
||||
|
||||
/**
|
||||
* Alias a type to a different name.
|
||||
*
|
||||
* @param string $abstract
|
||||
* @param string $alias
|
||||
* @return void
|
||||
*/
|
||||
public function alias($abstract, $alias);
|
||||
|
||||
/**
|
||||
* Assign a set of tags to a given binding.
|
||||
*
|
||||
* @param array|string $abstracts
|
||||
* @param array|mixed ...$tags
|
||||
* @return void
|
||||
*/
|
||||
public function tag($abstracts, $tags);
|
||||
|
||||
/**
|
||||
* Resolve all of the bindings for a given tag.
|
||||
*
|
||||
* @param string $tag
|
||||
* @return array
|
||||
*/
|
||||
public function tagged($tag);
|
||||
|
||||
/**
|
||||
* Register a binding with the container.
|
||||
*
|
||||
* @param string $abstract
|
||||
* @param \Closure|string|null $concrete
|
||||
* @param bool $shared
|
||||
* @return void
|
||||
*/
|
||||
public function bind($abstract, $concrete = null, $shared = false);
|
||||
|
||||
/**
|
||||
* Register a binding if it hasn't already been registered.
|
||||
*
|
||||
* @param string $abstract
|
||||
* @param \Closure|string|null $concrete
|
||||
* @param bool $shared
|
||||
* @return void
|
||||
*/
|
||||
public function bindIf($abstract, $concrete = null, $shared = false);
|
||||
|
||||
/**
|
||||
* Register a shared binding in the container.
|
||||
*
|
||||
* @param string $abstract
|
||||
* @param \Closure|string|null $concrete
|
||||
* @return void
|
||||
*/
|
||||
public function singleton($abstract, $concrete = null);
|
||||
|
||||
/**
|
||||
* "Extend" an abstract type in the container.
|
||||
*
|
||||
* @param string $abstract
|
||||
* @param \Closure $closure
|
||||
* @return void
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function extend($abstract, Closure $closure);
|
||||
|
||||
/**
|
||||
* Register an existing instance as shared in the container.
|
||||
*
|
||||
* @param string $abstract
|
||||
* @param mixed $instance
|
||||
* @return mixed
|
||||
*/
|
||||
public function instance($abstract, $instance);
|
||||
|
||||
/**
|
||||
* Define a contextual binding.
|
||||
*
|
||||
* @param string $concrete
|
||||
* @return \Illuminate\Contracts\Container\ContextualBindingBuilder
|
||||
*/
|
||||
public function when($concrete);
|
||||
|
||||
/**
|
||||
* Get a closure to resolve the given type from the container.
|
||||
*
|
||||
* @param string $abstract
|
||||
* @return \Closure
|
||||
*/
|
||||
public function factory($abstract);
|
||||
|
||||
/**
|
||||
* Resolve the given type from the container.
|
||||
*
|
||||
* @param string $abstract
|
||||
* @param array $parameters
|
||||
* @return mixed
|
||||
*/
|
||||
public function make($abstract, array $parameters = []);
|
||||
|
||||
/**
|
||||
* Call the given Closure / class@method and inject its dependencies.
|
||||
*
|
||||
* @param callable|string $callback
|
||||
* @param array $parameters
|
||||
* @param string|null $defaultMethod
|
||||
* @return mixed
|
||||
*/
|
||||
public function call($callback, array $parameters = [], $defaultMethod = null);
|
||||
|
||||
/**
|
||||
* Determine if the given abstract type has been resolved.
|
||||
*
|
||||
* @param string $abstract
|
||||
* @return bool
|
||||
*/
|
||||
public function resolved($abstract);
|
||||
|
||||
/**
|
||||
* Register a new resolving callback.
|
||||
*
|
||||
* @param \Closure|string $abstract
|
||||
* @param \Closure|null $callback
|
||||
* @return void
|
||||
*/
|
||||
public function resolving($abstract, Closure $callback = null);
|
||||
|
||||
/**
|
||||
* Register a new after resolving callback.
|
||||
*
|
||||
* @param \Closure|string $abstract
|
||||
* @param \Closure|null $callback
|
||||
* @return void
|
||||
*/
|
||||
public function afterResolving($abstract, Closure $callback = null);
|
||||
}
|
||||
@@ -1,610 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Support;
|
||||
|
||||
use ArrayAccess;
|
||||
use InvalidArgumentException;
|
||||
use Illuminate\Support\Traits\Macroable;
|
||||
|
||||
class Arr
|
||||
{
|
||||
use Macroable;
|
||||
|
||||
/**
|
||||
* Determine whether the given value is array accessible.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
public static function accessible($value)
|
||||
{
|
||||
return is_array($value) || $value instanceof ArrayAccess;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an element to an array using "dot" notation if it doesn't exist.
|
||||
*
|
||||
* @param array $array
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @return array
|
||||
*/
|
||||
public static function add($array, $key, $value)
|
||||
{
|
||||
if (is_null(static::get($array, $key))) {
|
||||
static::set($array, $key, $value);
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Collapse an array of arrays into a single array.
|
||||
*
|
||||
* @param array $array
|
||||
* @return array
|
||||
*/
|
||||
public static function collapse($array)
|
||||
{
|
||||
$results = [];
|
||||
|
||||
foreach ($array as $values) {
|
||||
if ($values instanceof Collection) {
|
||||
$values = $values->all();
|
||||
} elseif (! is_array($values)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$results = array_merge($results, $values);
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cross join the given arrays, returning all possible permutations.
|
||||
*
|
||||
* @param array ...$arrays
|
||||
* @return array
|
||||
*/
|
||||
public static function crossJoin(...$arrays)
|
||||
{
|
||||
$results = [[]];
|
||||
|
||||
foreach ($arrays as $index => $array) {
|
||||
$append = [];
|
||||
|
||||
foreach ($results as $product) {
|
||||
foreach ($array as $item) {
|
||||
$product[$index] = $item;
|
||||
|
||||
$append[] = $product;
|
||||
}
|
||||
}
|
||||
|
||||
$results = $append;
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Divide an array into two arrays. One with keys and the other with values.
|
||||
*
|
||||
* @param array $array
|
||||
* @return array
|
||||
*/
|
||||
public static function divide($array)
|
||||
{
|
||||
return [array_keys($array), array_values($array)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Flatten a multi-dimensional associative array with dots.
|
||||
*
|
||||
* @param array $array
|
||||
* @param string $prepend
|
||||
* @return array
|
||||
*/
|
||||
public static function dot($array, $prepend = '')
|
||||
{
|
||||
$results = [];
|
||||
|
||||
foreach ($array as $key => $value) {
|
||||
if (is_array($value) && ! empty($value)) {
|
||||
$results = array_merge($results, static::dot($value, $prepend.$key.'.'));
|
||||
} else {
|
||||
$results[$prepend.$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of the given array except for a specified array of keys.
|
||||
*
|
||||
* @param array $array
|
||||
* @param array|string $keys
|
||||
* @return array
|
||||
*/
|
||||
public static function except($array, $keys)
|
||||
{
|
||||
static::forget($array, $keys);
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the given key exists in the provided array.
|
||||
*
|
||||
* @param \ArrayAccess|array $array
|
||||
* @param string|int $key
|
||||
* @return bool
|
||||
*/
|
||||
public static function exists($array, $key)
|
||||
{
|
||||
if ($array instanceof ArrayAccess) {
|
||||
return $array->offsetExists($key);
|
||||
}
|
||||
|
||||
return array_key_exists($key, $array);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the first element in an array passing a given truth test.
|
||||
*
|
||||
* @param array $array
|
||||
* @param callable|null $callback
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public static function first($array, callable $callback = null, $default = null)
|
||||
{
|
||||
if (is_null($callback)) {
|
||||
if (empty($array)) {
|
||||
return value($default);
|
||||
}
|
||||
|
||||
foreach ($array as $item) {
|
||||
return $item;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($array as $key => $value) {
|
||||
if (call_user_func($callback, $value, $key)) {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
return value($default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the last element in an array passing a given truth test.
|
||||
*
|
||||
* @param array $array
|
||||
* @param callable|null $callback
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public static function last($array, callable $callback = null, $default = null)
|
||||
{
|
||||
if (is_null($callback)) {
|
||||
return empty($array) ? value($default) : end($array);
|
||||
}
|
||||
|
||||
return static::first(array_reverse($array, true), $callback, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Flatten a multi-dimensional array into a single level.
|
||||
*
|
||||
* @param array $array
|
||||
* @param int $depth
|
||||
* @return array
|
||||
*/
|
||||
public static function flatten($array, $depth = INF)
|
||||
{
|
||||
$result = [];
|
||||
|
||||
foreach ($array as $item) {
|
||||
$item = $item instanceof Collection ? $item->all() : $item;
|
||||
|
||||
if (! is_array($item)) {
|
||||
$result[] = $item;
|
||||
} elseif ($depth === 1) {
|
||||
$result = array_merge($result, array_values($item));
|
||||
} else {
|
||||
$result = array_merge($result, static::flatten($item, $depth - 1));
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove one or many array items from a given array using "dot" notation.
|
||||
*
|
||||
* @param array $array
|
||||
* @param array|string $keys
|
||||
* @return void
|
||||
*/
|
||||
public static function forget(&$array, $keys)
|
||||
{
|
||||
$original = &$array;
|
||||
|
||||
$keys = (array) $keys;
|
||||
|
||||
if (count($keys) === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($keys as $key) {
|
||||
// if the exact key exists in the top-level, remove it
|
||||
if (static::exists($array, $key)) {
|
||||
unset($array[$key]);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$parts = explode('.', $key);
|
||||
|
||||
// clean up before each pass
|
||||
$array = &$original;
|
||||
|
||||
while (count($parts) > 1) {
|
||||
$part = array_shift($parts);
|
||||
|
||||
if (isset($array[$part]) && is_array($array[$part])) {
|
||||
$array = &$array[$part];
|
||||
} else {
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
unset($array[array_shift($parts)]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an item from an array using "dot" notation.
|
||||
*
|
||||
* @param \ArrayAccess|array $array
|
||||
* @param string $key
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public static function get($array, $key, $default = null)
|
||||
{
|
||||
if (! static::accessible($array)) {
|
||||
return value($default);
|
||||
}
|
||||
|
||||
if (is_null($key)) {
|
||||
return $array;
|
||||
}
|
||||
|
||||
if (static::exists($array, $key)) {
|
||||
return $array[$key];
|
||||
}
|
||||
|
||||
if (strpos($key, '.') === false) {
|
||||
return $array[$key] ?? value($default);
|
||||
}
|
||||
|
||||
foreach (explode('.', $key) as $segment) {
|
||||
if (static::accessible($array) && static::exists($array, $segment)) {
|
||||
$array = $array[$segment];
|
||||
} else {
|
||||
return value($default);
|
||||
}
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an item or items exist in an array using "dot" notation.
|
||||
*
|
||||
* @param \ArrayAccess|array $array
|
||||
* @param string|array $keys
|
||||
* @return bool
|
||||
*/
|
||||
public static function has($array, $keys)
|
||||
{
|
||||
if (is_null($keys)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$keys = (array) $keys;
|
||||
|
||||
if (! $array) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($keys === []) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($keys as $key) {
|
||||
$subKeyArray = $array;
|
||||
|
||||
if (static::exists($array, $key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (explode('.', $key) as $segment) {
|
||||
if (static::accessible($subKeyArray) && static::exists($subKeyArray, $segment)) {
|
||||
$subKeyArray = $subKeyArray[$segment];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if an array is associative.
|
||||
*
|
||||
* An array is "associative" if it doesn't have sequential numerical keys beginning with zero.
|
||||
*
|
||||
* @param array $array
|
||||
* @return bool
|
||||
*/
|
||||
public static function isAssoc(array $array)
|
||||
{
|
||||
$keys = array_keys($array);
|
||||
|
||||
return array_keys($keys) !== $keys;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a subset of the items from the given array.
|
||||
*
|
||||
* @param array $array
|
||||
* @param array|string $keys
|
||||
* @return array
|
||||
*/
|
||||
public static function only($array, $keys)
|
||||
{
|
||||
return array_intersect_key($array, array_flip((array) $keys));
|
||||
}
|
||||
|
||||
/**
|
||||
* Pluck an array of values from an array.
|
||||
*
|
||||
* @param array $array
|
||||
* @param string|array $value
|
||||
* @param string|array|null $key
|
||||
* @return array
|
||||
*/
|
||||
public static function pluck($array, $value, $key = null)
|
||||
{
|
||||
$results = [];
|
||||
|
||||
list($value, $key) = static::explodePluckParameters($value, $key);
|
||||
|
||||
foreach ($array as $item) {
|
||||
$itemValue = data_get($item, $value);
|
||||
|
||||
// If the key is "null", we will just append the value to the array and keep
|
||||
// looping. Otherwise we will key the array using the value of the key we
|
||||
// received from the developer. Then we'll return the final array form.
|
||||
if (is_null($key)) {
|
||||
$results[] = $itemValue;
|
||||
} else {
|
||||
$itemKey = data_get($item, $key);
|
||||
|
||||
if (is_object($itemKey) && method_exists($itemKey, '__toString')) {
|
||||
$itemKey = (string) $itemKey;
|
||||
}
|
||||
|
||||
$results[$itemKey] = $itemValue;
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Explode the "value" and "key" arguments passed to "pluck".
|
||||
*
|
||||
* @param string|array $value
|
||||
* @param string|array|null $key
|
||||
* @return array
|
||||
*/
|
||||
protected static function explodePluckParameters($value, $key)
|
||||
{
|
||||
$value = is_string($value) ? explode('.', $value) : $value;
|
||||
|
||||
$key = is_null($key) || is_array($key) ? $key : explode('.', $key);
|
||||
|
||||
return [$value, $key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Push an item onto the beginning of an array.
|
||||
*
|
||||
* @param array $array
|
||||
* @param mixed $value
|
||||
* @param mixed $key
|
||||
* @return array
|
||||
*/
|
||||
public static function prepend($array, $value, $key = null)
|
||||
{
|
||||
if (is_null($key)) {
|
||||
array_unshift($array, $value);
|
||||
} else {
|
||||
$array = [$key => $value] + $array;
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a value from the array, and remove it.
|
||||
*
|
||||
* @param array $array
|
||||
* @param string $key
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public static function pull(&$array, $key, $default = null)
|
||||
{
|
||||
$value = static::get($array, $key, $default);
|
||||
|
||||
static::forget($array, $key);
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get one or a specified number of random values from an array.
|
||||
*
|
||||
* @param array $array
|
||||
* @param int|null $number
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function random($array, $number = null)
|
||||
{
|
||||
$requested = is_null($number) ? 1 : $number;
|
||||
|
||||
$count = count($array);
|
||||
|
||||
if ($requested > $count) {
|
||||
throw new InvalidArgumentException(
|
||||
"You requested {$requested} items, but there are only {$count} items available."
|
||||
);
|
||||
}
|
||||
|
||||
if (is_null($number)) {
|
||||
return $array[array_rand($array)];
|
||||
}
|
||||
|
||||
if ((int) $number === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$keys = array_rand($array, $number);
|
||||
|
||||
$results = [];
|
||||
|
||||
foreach ((array) $keys as $key) {
|
||||
$results[] = $array[$key];
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set an array item to a given value using "dot" notation.
|
||||
*
|
||||
* If no key is given to the method, the entire array will be replaced.
|
||||
*
|
||||
* @param array $array
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @return array
|
||||
*/
|
||||
public static function set(&$array, $key, $value)
|
||||
{
|
||||
if (is_null($key)) {
|
||||
return $array = $value;
|
||||
}
|
||||
|
||||
$keys = explode('.', $key);
|
||||
|
||||
while (count($keys) > 1) {
|
||||
$key = array_shift($keys);
|
||||
|
||||
// If the key doesn't exist at this depth, we will just create an empty array
|
||||
// to hold the next value, allowing us to create the arrays to hold final
|
||||
// values at the correct depth. Then we'll keep digging into the array.
|
||||
if (! isset($array[$key]) || ! is_array($array[$key])) {
|
||||
$array[$key] = [];
|
||||
}
|
||||
|
||||
$array = &$array[$key];
|
||||
}
|
||||
|
||||
$array[array_shift($keys)] = $value;
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shuffle the given array and return the result.
|
||||
*
|
||||
* @param array $array
|
||||
* @return array
|
||||
*/
|
||||
public static function shuffle($array)
|
||||
{
|
||||
shuffle($array);
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort the array using the given callback or "dot" notation.
|
||||
*
|
||||
* @param array $array
|
||||
* @param callable|string|null $callback
|
||||
* @return array
|
||||
*/
|
||||
public static function sort($array, $callback = null)
|
||||
{
|
||||
return Collection::make($array)->sortBy($callback)->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively sort an array by keys and values.
|
||||
*
|
||||
* @param array $array
|
||||
* @return array
|
||||
*/
|
||||
public static function sortRecursive($array)
|
||||
{
|
||||
foreach ($array as &$value) {
|
||||
if (is_array($value)) {
|
||||
$value = static::sortRecursive($value);
|
||||
}
|
||||
}
|
||||
|
||||
if (static::isAssoc($array)) {
|
||||
ksort($array);
|
||||
} else {
|
||||
sort($array);
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the array using the given callback.
|
||||
*
|
||||
* @param array $array
|
||||
* @param callable $callback
|
||||
* @return array
|
||||
*/
|
||||
public static function where($array, callable $callback)
|
||||
{
|
||||
return array_filter($array, $callback, ARRAY_FILTER_USE_BOTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* If the given value is not an array, wrap it in one.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return array
|
||||
*/
|
||||
public static function wrap($value)
|
||||
{
|
||||
return ! is_array($value) ? [$value] : $value;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
359
vendor/psy/psysh/src/functions.php
vendored
359
vendor/psy/psysh/src/functions.php
vendored
@@ -1,358 +1 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Psy Shell.
|
||||
*
|
||||
* (c) 2012-2018 Justin Hileman
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Psy;
|
||||
|
||||
use Psy\VersionUpdater\GitHubChecker;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputDefinition;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use XdgBaseDir\Xdg;
|
||||
|
||||
if (!\function_exists('Psy\sh')) {
|
||||
/**
|
||||
* Command to return the eval-able code to startup PsySH.
|
||||
*
|
||||
* eval(\Psy\sh());
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function sh()
|
||||
{
|
||||
return 'extract(\Psy\debug(get_defined_vars(), isset($this) ? $this : @get_called_class()));';
|
||||
}
|
||||
}
|
||||
|
||||
if (!\function_exists('Psy\debug')) {
|
||||
/**
|
||||
* Invoke a Psy Shell from the current context.
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* foreach ($items as $item) {
|
||||
* \Psy\debug(get_defined_vars());
|
||||
* }
|
||||
*
|
||||
* If you would like your shell interaction to affect the state of the
|
||||
* current context, you can extract() the values returned from this call:
|
||||
*
|
||||
* foreach ($items as $item) {
|
||||
* extract(\Psy\debug(get_defined_vars()));
|
||||
* var_dump($item); // will be whatever you set $item to in Psy Shell
|
||||
* }
|
||||
*
|
||||
* Optionally, supply an object as the `$bindTo` parameter. This determines
|
||||
* the value `$this` will have in the shell, and sets up class scope so that
|
||||
* private and protected members are accessible:
|
||||
*
|
||||
* class Foo {
|
||||
* function bar() {
|
||||
* \Psy\debug(get_defined_vars(), $this);
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* For the static equivalent, pass a class name as the `$bindTo` parameter.
|
||||
* This makes `self` work in the shell, and sets up static scope so that
|
||||
* private and protected static members are accessible:
|
||||
*
|
||||
* class Foo {
|
||||
* static function bar() {
|
||||
* \Psy\debug(get_defined_vars(), get_called_class());
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* @param array $vars Scope variables from the calling context (default: array())
|
||||
* @param object|string $bindTo Bound object ($this) or class (self) value for the shell
|
||||
*
|
||||
* @return array Scope variables from the debugger session
|
||||
*/
|
||||
function debug(array $vars = [], $bindTo = null)
|
||||
{
|
||||
echo PHP_EOL;
|
||||
|
||||
$sh = new Shell();
|
||||
$sh->setScopeVariables($vars);
|
||||
|
||||
// Show a couple of lines of call context for the debug session.
|
||||
//
|
||||
// @todo come up with a better way of doing this which doesn't involve injecting input :-P
|
||||
if ($sh->has('whereami')) {
|
||||
$sh->addInput('whereami -n2', true);
|
||||
}
|
||||
|
||||
if (\is_string($bindTo)) {
|
||||
$sh->setBoundClass($bindTo);
|
||||
} elseif ($bindTo !== null) {
|
||||
$sh->setBoundObject($bindTo);
|
||||
}
|
||||
|
||||
$sh->run();
|
||||
|
||||
return $sh->getScopeVariables(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (!\function_exists('Psy\info')) {
|
||||
/**
|
||||
* Get a bunch of debugging info about the current PsySH environment and
|
||||
* configuration.
|
||||
*
|
||||
* If a Configuration param is passed, that configuration is stored and
|
||||
* used for the current shell session, and no debugging info is returned.
|
||||
*
|
||||
* @param Configuration|null $config
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
function info(Configuration $config = null)
|
||||
{
|
||||
static $lastConfig;
|
||||
if ($config !== null) {
|
||||
$lastConfig = $config;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$xdg = new Xdg();
|
||||
$home = \rtrim(\str_replace('\\', '/', $xdg->getHomeDir()), '/');
|
||||
$homePattern = '#^' . \preg_quote($home, '#') . '/#';
|
||||
|
||||
$prettyPath = function ($path) use ($homePattern) {
|
||||
if (\is_string($path)) {
|
||||
return \preg_replace($homePattern, '~/', $path);
|
||||
} else {
|
||||
return $path;
|
||||
}
|
||||
};
|
||||
|
||||
$config = $lastConfig ?: new Configuration();
|
||||
|
||||
$core = [
|
||||
'PsySH version' => Shell::VERSION,
|
||||
'PHP version' => PHP_VERSION,
|
||||
'OS' => PHP_OS,
|
||||
'default includes' => $config->getDefaultIncludes(),
|
||||
'require semicolons' => $config->requireSemicolons(),
|
||||
'error logging level' => $config->errorLoggingLevel(),
|
||||
'config file' => [
|
||||
'default config file' => $prettyPath($config->getConfigFile()),
|
||||
'local config file' => $prettyPath($config->getLocalConfigFile()),
|
||||
'PSYSH_CONFIG env' => $prettyPath(\getenv('PSYSH_CONFIG')),
|
||||
],
|
||||
// 'config dir' => $config->getConfigDir(),
|
||||
// 'data dir' => $config->getDataDir(),
|
||||
// 'runtime dir' => $config->getRuntimeDir(),
|
||||
];
|
||||
|
||||
// Use an explicit, fresh update check here, rather than relying on whatever is in $config.
|
||||
$checker = new GitHubChecker();
|
||||
$updateAvailable = null;
|
||||
$latest = null;
|
||||
try {
|
||||
$updateAvailable = !$checker->isLatest();
|
||||
$latest = $checker->getLatest();
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
|
||||
$updates = [
|
||||
'update available' => $updateAvailable,
|
||||
'latest release version' => $latest,
|
||||
'update check interval' => $config->getUpdateCheck(),
|
||||
'update cache file' => $prettyPath($config->getUpdateCheckCacheFile()),
|
||||
];
|
||||
|
||||
if ($config->hasReadline()) {
|
||||
$info = \readline_info();
|
||||
|
||||
$readline = [
|
||||
'readline available' => true,
|
||||
'readline enabled' => $config->useReadline(),
|
||||
'readline service' => \get_class($config->getReadline()),
|
||||
];
|
||||
|
||||
if (isset($info['library_version'])) {
|
||||
$readline['readline library'] = $info['library_version'];
|
||||
}
|
||||
|
||||
if (isset($info['readline_name']) && $info['readline_name'] !== '') {
|
||||
$readline['readline name'] = $info['readline_name'];
|
||||
}
|
||||
} else {
|
||||
$readline = [
|
||||
'readline available' => false,
|
||||
];
|
||||
}
|
||||
|
||||
$pcntl = [
|
||||
'pcntl available' => \function_exists('pcntl_signal'),
|
||||
'posix available' => \function_exists('posix_getpid'),
|
||||
];
|
||||
|
||||
$disabledFuncs = \array_map('trim', \explode(',', \ini_get('disable_functions')));
|
||||
if (\in_array('pcntl_signal', $disabledFuncs) || \in_array('pcntl_fork', $disabledFuncs)) {
|
||||
$pcntl['pcntl disabled'] = true;
|
||||
}
|
||||
|
||||
$history = [
|
||||
'history file' => $prettyPath($config->getHistoryFile()),
|
||||
'history size' => $config->getHistorySize(),
|
||||
'erase duplicates' => $config->getEraseDuplicates(),
|
||||
];
|
||||
|
||||
$docs = [
|
||||
'manual db file' => $prettyPath($config->getManualDbFile()),
|
||||
'sqlite available' => true,
|
||||
];
|
||||
|
||||
try {
|
||||
if ($db = $config->getManualDb()) {
|
||||
if ($q = $db->query('SELECT * FROM meta;')) {
|
||||
$q->setFetchMode(\PDO::FETCH_KEY_PAIR);
|
||||
$meta = $q->fetchAll();
|
||||
|
||||
foreach ($meta as $key => $val) {
|
||||
switch ($key) {
|
||||
case 'built_at':
|
||||
$d = new \DateTime('@' . $val);
|
||||
$val = $d->format(\DateTime::RFC2822);
|
||||
break;
|
||||
}
|
||||
$key = 'db ' . \str_replace('_', ' ', $key);
|
||||
$docs[$key] = $val;
|
||||
}
|
||||
} else {
|
||||
$docs['db schema'] = '0.1.0';
|
||||
}
|
||||
}
|
||||
} catch (Exception\RuntimeException $e) {
|
||||
if ($e->getMessage() === 'SQLite PDO driver not found') {
|
||||
$docs['sqlite available'] = false;
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
$autocomplete = [
|
||||
'tab completion enabled' => $config->useTabCompletion(),
|
||||
'custom matchers' => \array_map('get_class', $config->getTabCompletionMatchers()),
|
||||
'bracketed paste' => $config->useBracketedPaste(),
|
||||
];
|
||||
|
||||
// Shenanigans, but totally justified.
|
||||
if ($shell = Sudo::fetchProperty($config, 'shell')) {
|
||||
$core['loop listeners'] = \array_map('get_class', Sudo::fetchProperty($shell, 'loopListeners'));
|
||||
$core['commands'] = \array_map('get_class', $shell->all());
|
||||
|
||||
$autocomplete['custom matchers'] = \array_map('get_class', Sudo::fetchProperty($shell, 'matchers'));
|
||||
}
|
||||
|
||||
// @todo Show Presenter / custom casters.
|
||||
|
||||
return \array_merge($core, \compact('updates', 'pcntl', 'readline', 'history', 'docs', 'autocomplete'));
|
||||
}
|
||||
}
|
||||
|
||||
if (!\function_exists('Psy\bin')) {
|
||||
/**
|
||||
* `psysh` command line executable.
|
||||
*
|
||||
* @return \Closure
|
||||
*/
|
||||
function bin()
|
||||
{
|
||||
return function () {
|
||||
$usageException = null;
|
||||
|
||||
$input = new ArgvInput();
|
||||
try {
|
||||
$input->bind(new InputDefinition([
|
||||
new InputOption('help', 'h', InputOption::VALUE_NONE),
|
||||
new InputOption('config', 'c', InputOption::VALUE_REQUIRED),
|
||||
new InputOption('version', 'v', InputOption::VALUE_NONE),
|
||||
new InputOption('cwd', null, InputOption::VALUE_REQUIRED),
|
||||
new InputOption('color', null, InputOption::VALUE_NONE),
|
||||
new InputOption('no-color', null, InputOption::VALUE_NONE),
|
||||
|
||||
new InputArgument('include', InputArgument::IS_ARRAY),
|
||||
]));
|
||||
} catch (\RuntimeException $e) {
|
||||
$usageException = $e;
|
||||
}
|
||||
|
||||
$config = [];
|
||||
|
||||
// Handle --config
|
||||
if ($configFile = $input->getOption('config')) {
|
||||
$config['configFile'] = $configFile;
|
||||
}
|
||||
|
||||
// Handle --color and --no-color
|
||||
if ($input->getOption('color') && $input->getOption('no-color')) {
|
||||
$usageException = new \RuntimeException('Using both "--color" and "--no-color" options is invalid');
|
||||
} elseif ($input->getOption('color')) {
|
||||
$config['colorMode'] = Configuration::COLOR_MODE_FORCED;
|
||||
} elseif ($input->getOption('no-color')) {
|
||||
$config['colorMode'] = Configuration::COLOR_MODE_DISABLED;
|
||||
}
|
||||
|
||||
$shell = new Shell(new Configuration($config));
|
||||
|
||||
// Handle --help
|
||||
if ($usageException !== null || $input->getOption('help')) {
|
||||
if ($usageException !== null) {
|
||||
echo $usageException->getMessage() . PHP_EOL . PHP_EOL;
|
||||
}
|
||||
|
||||
$version = $shell->getVersion();
|
||||
$name = \basename(\reset($_SERVER['argv']));
|
||||
echo <<<EOL
|
||||
$version
|
||||
|
||||
Usage:
|
||||
$name [--version] [--help] [files...]
|
||||
|
||||
Options:
|
||||
--help -h Display this help message.
|
||||
--config -c Use an alternate PsySH config file location.
|
||||
--cwd Use an alternate working directory.
|
||||
--version -v Display the PsySH version.
|
||||
--color Force colors in output.
|
||||
--no-color Disable colors in output.
|
||||
|
||||
EOL;
|
||||
exit($usageException === null ? 0 : 1);
|
||||
}
|
||||
|
||||
// Handle --version
|
||||
if ($input->getOption('version')) {
|
||||
echo $shell->getVersion() . PHP_EOL;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// Pass additional arguments to Shell as 'includes'
|
||||
$shell->setIncludes($input->getArgument('include'));
|
||||
|
||||
try {
|
||||
// And go!
|
||||
$shell->run();
|
||||
} catch (\Exception $e) {
|
||||
echo $e->getMessage() . PHP_EOL;
|
||||
|
||||
// @todo this triggers the "exited unexpectedly" logic in the
|
||||
// ForkingLoop, so we can't exit(1) after starting the shell...
|
||||
// fix this :)
|
||||
|
||||
// exit(1);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
<?php require_once __DIR__ . '/../../../../overrides/psy/psysh/src/functions.php';
|
||||
@@ -1,12 +1 @@
|
||||
<?php
|
||||
|
||||
use Spatie\Activitylog\ActivityLogger;
|
||||
|
||||
if (! function_exists('activity')) {
|
||||
function activity(string $logName = null): ActivityLogger
|
||||
{
|
||||
$defaultLogName = config('activitylog.default_log_name');
|
||||
|
||||
return app(ActivityLogger::class)->useLog($logName ?? $defaultLogName);
|
||||
}
|
||||
}
|
||||
<?php require_once __DIR__ . '/../../../../overrides/spatie/laravel-activitylog/src/helpers.php';
|
||||
Reference in New Issue
Block a user