Putting data to file.
You may put into depth of multidimensional array
when your key is array.
e.g. $this->set(['a', 'b'], 1) will set data to ['a' => ['b' => 1 ... ] ...].
@param array|string $key
@param mixed $value
@return int
548230
public function set($key, $value)
    {
        $config = $this->data;
        if (!$key) {
            $config = array_merge($config, $value);
        }
        $key = is_array($key) ? $key : [$key];

        $data = &$config;
        while ($key) {
            $k = array_shift($key);
            $config[$k] = isset($config[$k]) ? $config[$k] : [];
            $config[$k] = $key
                ? $config[$k]
                : (is_array($value)
                    ? array_merge($config[$k], $value)
                    : $value);
            $config = &$config[$k];
        }
        $this->data = $data;
        return $this->save();
    }
752146
public function insert(string $key, $value): int
    {
        return $this->handle->hSet($this->name, $key, $value) ?: 0;
    }
1272701
public static function set(&$array, $key, $value)
    {
        $key = static::normalizeKey($key);

        if ($key === null || $key === '')
        {
            return ($array = $value);
        }

        $keys = explode('.', $key);
        $last = array_pop($keys);
        $currentElement =& $array;

        foreach ($keys as $currentKey)
        {
            if (!array_key_exists($currentKey, $currentElement) || !is_array($currentElement[$currentKey]))
            {
                $currentElement[$currentKey] = [];
            }

            $currentElement =& $currentElement[$currentKey];
        }

        $currentElement[$last] = $value;

        return $array;
    }
1286739
private static function recursiveSetFromKey($data, $key, $value)
    {
        if (empty($key)) {
            return $value;
        } else {
            if (!is_array($data)) {
                $data = [];
            }
            $currentKey = array_shift($key);

            if (!isset($data[$currentKey])) {
                $data[$currentKey] = [];
            }

            $data[$currentKey] = self::recursiveSetFromKey($data[$currentKey], $key, $value);
            return $data;
        }
    }
1074067
public static function set(array & $array, $key, $value)
    {
        if (strpos($key, '.') !== false) {
            $keys = explode('.', $key);
            $topKey = array_shift($keys);

            if (!isset($array[$topKey]) || !is_array($array[$topKey])) {
                $array[$topKey] = [];
            }

            static::set($array[$topKey], implode('.', $keys), $value);
        } else {
            $array[$key] = $value;
        }
    }
780336
public function set($key, $value) {
        if (is_array($key)) {
            $this->data = array_merge($this->data, $key);
        } else {
            $this->data[ $key ] = $value;
        }
        return $this;
    }
48314
public function set($key, $value = null)
    {
        $keys = is_array($key) ? $key : [$key => $value];

        foreach ($keys as $key => $value) {
            Arr::set($this->items, $key, $value);
        }
    }
243699
public function set($key, $value) {

        $keys = \explode('/',$key);

        if (\count($keys)>5) return false;

        switch (\count($keys)){

          case 1:
            $this->registry[$keys[0]] = $value;
            break;

          case 2:
            $this->registry[$keys[0]][$keys[1]] = $value;
            break;

          case 3:
            $this->registry[$keys[0]][$keys[1]][$keys[2]] = $value;
            break;

          case 4:
            $this->registry[$keys[0]][$keys[1]][$keys[2]][$keys[3]] = $value;
            break;

          case 5:
            $this->registry[$keys[0]][$keys[1]][$keys[2]][$keys[3]][$keys[4]] = $value;
            break;
        }

        return $this;
    }
567672
public static function set(array &$array, $key, $value)
    {
        $keys = explode('.', $key);
        foreach($keys as $key) {
            if(!isset($array[$key])) {
                $array[$key] = [];
            }
            $array = &$array[$key];
        }

        $array = $value;
    }
555999
public static function set($key, $value)
    {
        if (is_array($key)) {
            $now = self::self()->getContainer()['settings'];
            foreach ($key as $item) {
                $now = $now[$item];
            }
            $now = $value;
        } else {
            $settings = self::self()->getContainer()['settings'];
            $settings[$key] = $value;
        }
    }
346437
public function put($key, $value) {
        if (isset($this->data[$key])) {
            $this->data[$key] = $value;
            $this->recordAccess($key);
        } else {
            $this->data[$key] = $value;
            if ($this->size() > $this->maximumSize) {
                // remove least recently used element (front of array)
                reset($this->data);
                unset($this->data[key($this->data)]);
            }
        }
    }
713522
protected function __storeData($key, $value = null)
    {
        if (property_exists($this, $key)) {
            $this->$key = $value;
        }
        else {
            parent::__storeData($key, $value);
        }
    }
616549
protected function setJavascriptData($key, $value = null)
    {
        if (is_array($key)) {
            JavaScriptFacade::put($key);
        } else {
            JavaScriptFacade::put([$key => $value]);
        }
    }
620414
public static function set($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $_key => $_value) {
                static::set($_key, $_value);
            }
            return true;
        }

        $record = static::findRecord($key);
        if (!$record) {
            $record = new static;
            list($namespace, $group, $item) = $record->parseKey($key);
            $record->namespace = $namespace;
            $record->group = $group;
            $record->item = $item;
        }

        $record->value = $value;
        $record->save();

        static::$cache[$key] = $value;
        return true;
    }
1365503
public function set($key, $value = null)
    {
        if (is_array($key))
        {
            foreach ($key as $name => $value)
            {
                $this->_data[$name] = $value;
            }
        }
        else
        {
            $this->_data[$key] = $value;
        }

        return $this;
    }
374040
public function with( $key, $value = null ) {
		if ( is_array( $key ) ) {
			$this->data = array_merge( $this->data, $key );
		} else if ( is_object( $key ) && method_exists( $key, 'to_array' ) ) {
			$this->data = array_merge( $this->data, $key->to_array() );
		} else {
			$this->data[$key] = $value;
		}

		return $this;
	}
940295
public function put( $key, $value = null ) {
		if ( ! is_array( $key ) ) {
			$key = [ $key => $value ];
		}

		foreach ( $key as $array_key => $array_value ) {
			Arr::set( $this->attributes, $array_key, $array_value );
		}
	}