Writes the meta-data to files

@param string $key
@param array  $data
977037
public function write($key, $data)
    {
        $this->_cachedData[$key] = $data;
        Cache::set('model-metadata', $this->_cachedData, Cache::TTL_ONE_MONTH);
    }
557827
static function write($key,$value){
	
		$segments = self::engineName($key);
		$file = [implode($segments->file,'.')];
		
		// set key data
		$keys = array_merge($file,$segments->keys);
		
		// update config data
		self::$data = array_replace_recursive(
			self::$data ,
			self::_makeDimensional($keys,$value)
		);
	}
181469
private function write_to($file, $data)
  {
    $handler = fopen($file, "w");
    fwrite($handler, $data);
    fclose($handler);
  }
272977
function set($key, $data)
    {
        $this->cache[$key]         = $data;
        $this->cache_changes[$key] = true;
    }
741229
public function deleteMetadata(string $key, string $name): void
    {
        $this->execute([
            [
                'command' => 'set',
                'key' => $key,
                'metadata.' . $name => ''
            ]
        ]);
    }
263230
static function write($file, $data)
	{
		$content = "";
		foreach($data as $key => $value)
		{
			if(is_array($value))
			{
				for($i=0; $i<count($value); $i++)
					$content .= $key."[] = \"".addslashes($value[$i])."\"\n";
			}
			elseif($value)
				$content .= $key." = \"".addslashes($value)."\"\n";
			else
				$content .= $key." = \n";
		}

		bors_function_include('fs/file_put_contents_lock');
		file_put_contents_lock($file, $content);
	}
405590
public function setData($key, $data, $registry = null)
	{
		if ($registry == null) {
			$registry = $this->default;
		}
		if (is_string($key . $registry) && $this->registryExists($registry)) {
			$this->data[self::REGISTRY][$registry][$key] = $data;
			$this->dirty = true;
			return true;
		}
		return false;
	}
401511
public function writeTo(string $key, $data, array $params = []): bool
    {
        $result = false;

        if (empty($params['path'])) {
            $this->errors[] = "Path parameter is required";

            return $result;
        }
        $path = $params['path'];

        try {
            Utility::validatePath($path);
        } catch (InvalidArgumentException $e) {
            $this->errors[] = "Path does not exist or is not readable: $path";

            return $result;
        }

        $content = (string)file_get_contents($path);
        $cachedData = [
            'path' => $path,
            'md5' => md5($content),
            'data' => $data,
        ];

        $result = parent::writeTo($key, $cachedData, ['raw' => true]);

        return $result;
    }
1012098
protected function _putData($key, $data)
    {
        $bool = $this->_validateDataKey($key, $data);
        if (!$bool) {
            return $this;
        }

        $hasData = $this->has($key);
        if ($this->_setPreparationOn) {
            $data = $this->_dataPreparation(
                $key,
                $data,
                $this->_dataPreparationCallbacks
            );
        }

        if (!$hasData
            || ($hasData && $this->_comparator($this->_DATA[$key], $data, '!=='))
        ) {
            $this->_changeData($key, $data, $hasData);
        }

        return $this;
    }
1331034
public function forgetMetaData($key): void
    {
        $meta = $this->getAttribute('meta');

        if (\is_array($key)) {
            foreach ($key as $name) {
                $meta->forget($name);
            }
        } else {
            $meta->forget($key);
        }

        $this->setMetaAttribute($meta);
    }
547244
protected function setData($key, $value)
    {
        $this->data[$key] = (is_array($value)) ? $value : [$value];
    }
688298
public function insert($storageName, $key, array $data)
    {
        try {
            $this->conn->insert($this->table, [
                $this->keyColumn  => $key,
                $this->dataColumn => serialize($data),
            ]);
        } catch (\Exception $e) {
        }
    }
294470
public function hmSet($key, array $data) {
        $array = ['hmset', $key];

        foreach ($data as $dataKey => $value) {
            $array[] = $dataKey;
            $array[] = $value;
        }

        return $this->send($array);
    }
905409
private function store($key, $data) 
    {
        $cachePath = $this->getCachePath($key);
        $cacheDir  = dirname($cachePath);
    
        if(!is_dir($cacheDir) && !@mkdir($cacheDir, 0755, true)) {
            throw new \wf\cache\Exception("Could not make cache directory");
        }
            
        if($this->isCompress && function_exists('gzdeflate') && function_exists('gzinflate')) {
            $data['value'] = gzdeflate($data['value']);
        }
        
        $text = "<?php\n# Auto generate by windwork cache engine,please don't edit me.\nreturn " . var_export($data, true) . ';';
        return @file_put_contents($cachePath, $text);
    }
132835
private function createManyToOneRelation(array &$data, $key)
    {
        $uid = isset($data[$key]) ? (int)$data[$key] : 0;

        $data[$key] = ($uid > 0)
            ? \Tx_Oelib_MapperRegistry::get($this->relations[$key])->find($uid)
            : null;
    }
989965
public function set($key, $data)
    {
        $file = $this->getFilePath($key);

        if ($handle = fopen($file, 'w')) {
            fwrite($handle, $data);
            fclose($handle);
        }
    }
1306810
public function update($storageName, $key, array $data)
    {
        if (!isset($this->data[$storageName])) {
            $this->data[$storageName] = [];
        }

        $this->data[$storageName][serialize($key)] = $data;
    }