public function toJSon($filter, &$error)
	{
		$array = array(
			self::KEY_VERSION => self::VERSION_CURRENT,
			self::KEY_DBTYPE => $this->_dbType,
			self::KEY_DBFILEHASH => $this->_dbFileHash,
			self::KEY_KEYFILEHASH => $this->_keyFileHash,
			self::KEY_HEADERHASH => base64_encode($this->_headerHash),
			self::KEY_DB => $this->_db->toArray($filter));
		$r = json_encode($array);
		if($r === false)
		{
			$error = "KphpDB JSon save: " . json_last_error();
			return null;
		}
		$error = null;
		return $r;
	}