🚀 Hostinger Optimized
🖥️ Server: LiteSpeed
💻 System: Linux s20058.bom1.stableserver.net 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
👤 User: skhata (1324)
🐘 PHP: 8.4.20
🚫 Disabled: ✨ NONE

💻 Terminal

📁 /home/skhata/chandrasons.com/public
$

📄 DataStore.php

📁 Path: /home/skhata/chandrasons.com/vendor/livewire/livewire/src/Mechanisms/DataStore.php
📊 Size: 2.74 KB
🔒 Perm: 0644
📝 MIME: text/x-php
<?php

namespace Livewire\Mechanisms;

use WeakMap;

class DataStore extends Mechanism
{
    protected $lookup;

    function __construct()
    {
        $this->lookup = new WeakMap;
    }

    function set($instance, $key, $value)
    {
        if (! isset($this->lookup[$instance])) {
            $this->lookup[$instance] = [];
        }

        $this->lookup[$instance][$key] = $value;
    }

    function has($instance, $key, $iKey = null) {
        if (! isset($this->lookup[$instance])) {
            return false;
        }

        if (! isset($this->lookup[$instance][$key])) {
            return false;
        }

        if ($iKey !== null) {
            return !! ($this->lookup[$instance][$key][$iKey] ?? false);
        }

        return true;
    }

    function get($instance, $key, $default = null)
    {
        if (! isset($this->lookup[$instance])) {
            return value($default);
        }

        if (! isset($this->lookup[$instance][$key])) {
            return value($default);
        }

        return $this->lookup[$instance][$key];
    }

    function find($instance, $key, $iKey = null, $default = null)
    {
        if (! isset($this->lookup[$instance])) {
            return value($default);
        }

        if (! isset($this->lookup[$instance][$key])) {
            return value($default);
        }

        if ($iKey !== null && ! isset($this->lookup[$instance][$key][$iKey])) {
            return value($default);
        }

        return $iKey !== null
            ? $this->lookup[$instance][$key][$iKey]
            : $this->lookup[$instance][$key];
    }

    function push($instance, $key, $value, $iKey = null)
    {
        if (! isset($this->lookup[$instance])) {
            $this->lookup[$instance] = [];
        }

        if (! isset($this->lookup[$instance][$key])) {
            $this->lookup[$instance][$key] = [];
        }

        if ($iKey) {
            $this->lookup[$instance][$key][$iKey] = $value;
        } else {
            $this->lookup[$instance][$key][] = $value;
        }
    }

    function unset($instance, $key, $iKey = null)
    {
        if (! isset($this->lookup[$instance])) {
            return;
        }

        if (! isset($this->lookup[$instance][$key])) {
            return;
        }

        if ($iKey !== null) {
            // Set a local variable to avoid the "indirect modification" error.
            $keyValue = $this->lookup[$instance][$key];

            unset($keyValue[$iKey]);

            $this->lookup[$instance][$key] = $keyValue;
        } else {
            // Set a local variable to avoid the "indirect modification" error.
            $instanceValue = $this->lookup[$instance];

            unset($instanceValue[$key]);

            $this->lookup[$instance] = $instanceValue;
        }
    }
}
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨