Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 18.219.81.129
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/book24.ng/vendor/bavix/laravel-wallet/src/Services/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/book24.ng/vendor/bavix/laravel-wallet/src/Services/LockService.php
<?php

namespace Bavix\Wallet\Services;

use Bavix\Wallet\Objects\EmptyLock;
use Illuminate\Contracts\Cache\Lock;
use Illuminate\Contracts\Cache\LockProvider;
use Illuminate\Contracts\Cache\Store;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Str;

class LockService
{
    /**
     * @var string
     */
    protected $uniqId;

    /**
     * LockService constructor.
     */
    public function __construct()
    {
        $this->uniqId = Str::random();
    }

    /**
     * @param object $self
     * @param string $name
     * @param \Closure $closure
     *
     * @return mixed
     */
    public function lock($self, string $name, \Closure $closure)
    {
        return $this->lockProvider($self, $name, (int) config('wallet.lock.seconds', 1))
            ->get($this->bindTo($self, $closure));
    }

    /**
     * @param object $self
     * @param \Closure $closure
     * @return \Closure
     *
     * @throws
     */
    protected function bindTo($self, \Closure $closure): \Closure
    {
        $reflect = new \ReflectionFunction($closure);
        if (strpos((string) $reflect, 'static') === false) {
            return $closure->bindTo($self);
        }

        return $closure;
    }

    /**
     * @return Store|null
     *
     * @codeCoverageIgnore
     */
    protected function cache(): ?Store
    {
        try {
            return Cache::store(config('wallet.lock.cache'))
                ->getStore();
        } catch (\Throwable $throwable) {
            return null;
        }
    }

    /**
     * @param object $self
     * @param string $name
     * @param int $seconds
     *
     * @return Lock
     */
    protected function lockProvider($self, string $name, int $seconds): Lock
    {
        $store = $this->cache();
        $enabled = $store && config('wallet.lock.enabled', false);

        // fixme: CodeClimate
        // @codeCoverageIgnoreStart
        if ($enabled && $store instanceof LockProvider) {
            $class = \get_class($self);
            $uniqId = $class.$this->uniqId;
            if ($self instanceof Model) {
                $uniqId = $class.$self->getKey();
            }

            return $store->lock("$name.$uniqId", $seconds);
        }
        // @codeCoverageIgnoreEnd

        return app(EmptyLock::class);
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit