Add data to buffer

@param  mixed   $data
@return boolean
323911
public function add($data)
    {

        if(empty($data) || !$this->_getAdapter()->isClientConnected()) {
            return false;
        }

        if(!$this->_getAdapter()->add($this->_cacheKey, json_encode($data))) {
            return false;
        }

        // overflow handling
        if($this->getUsage() >= $this->getSize()) {
            if (!empty ($this->_overflowCallback) && is_callable ($this->_overflowCallback)) {
                call_user_func_array ($this->_overflowCallback, array ($this->readAndFlush()));
            } else {
                $this->_overflowHandler();
            }
        }
    }
319952
public function write($data) {
    $this->byte_buffer .= $data;
    $current_buffer_len = strlen($this->byte_buffer);
    $data_len = strlen($data);
    // If this data doesn't fill the buffer then write it and return.
    if ($current_buffer_len < self::WRITE_CHUNK_SIZE) {
      return $data_len;
    }

    // Write out this data
    if (!$this->writeBufferToGS()) {
      // Remove the bytes we added to the buffer
      $this->byte_buffer = substr($this->byte_buffer, 0, -strlen($data));
      return 0;
    }

    // We wrote the buffered content - but only return the amount of $data
    // we wrote as per the contract of write()
    return $data_len;
  }
1169963
public function write($data)
    {
        if (!$this->connected && !$this->connect()) {
            return false;
        }
        $totalBytes = strlen($data);
        $written = 0;
        while ($written < $totalBytes) {
            $rv = fwrite($this->connection, substr($data, $written));
            if ($rv === false || $rv === 0) {
                return $written;
            }
            $written += $rv;
        }

        return $written;
    }
1277698
public function process($data = '')
	{
		$this->data = $data;

		$ext = $this->extensionMap->get($this->extension);
		$arr = $ext->load($data)->toArray();

		$this->paramBag = new ParamBag($arr);

		return true;
	}
952290
public function prepend($data) {
        if ($this->exist()) {
            return $this->write($data.$this->read());
        }
        return $this->write($data);
    }
28164
public function updateWhereData($data) {
        $this->performed = false;
        $this->whereData = array_merge($this->whereData, $data);

        return $this;
    }
869192
public function addMetadata($data)
    {
        if (is_array($data)) {
            foreach ($data as $k => $v) {
                $this->metadata[$k] = $v;
            }
        }
        else {
            $this->metadata[] = $data;
        }

        return $this;
    }
1207895
public function add($data = [])
    {
        $this->connection();
        $db = DB::table($this->table);
        $id = $db->insertGetId($data);
        $this->debug->debug(__FUNCTION__, 'SQL Queries: ' . $db->toSql());
        $this->debug->debug(__FUNCTION__, 'Result Insert ID: ' . $id);

        return $id;
    }
32400
public function appendData(string $data): self
    {
        if (empty($this->nodes)) {
            $prevHash = $this->firstPrevHash;
        } else {
            $last = $this->getLastNode();
            $prevHash = $last->getHash(true);
        }
        $newNode = new Node($data, $prevHash);
        $this->nodes[] = $newNode;

        SodiumCompat::crypto_generichash_update(
            $this->summaryHashState,
            $newNode->getHash(true)
        );
        return $this;
    }
139619
public function add_data(array $data)
	{
		$ar = \func_get_args();
		foreach ( $ar as $d ){
			if ( \is_array($d) ){
				$this->data = $this->has_data() ? array_merge($this->data,$d) : $d;
			}
		}
		return $this;
	}
327302
public function put($data)
    {
        file_put_contents($this->path, $data);
        clearstatcache(true, $this->path);

        return $this->getETag();
    }
295421
public function add(array $data)
    {
        $result = null;
        $this->hook->attach('user.add.before', $data, $result, $this);

        if (isset($result)) {
            return (int) $result;
        }

        if (empty($data['name'])) {
            $data['name'] = strtok($data['email'], '@');
        }

        $data['created'] = $data['modified'] = GC_TIME;
        $data['hash'] = gplcart_string_hash($data['password']);
        $result = $data['user_id'] = $this->db->insert('user', $data);

        $this->setAddress($data);

        $this->hook->attach('user.add.after', $data, $result, $this);
        return (int) $result;
    }
1303963
public function add(array $data)
    {
        $data = $this->resolverFactory->createNewDeviceResolver()->resolve($data);

        return $this->api->request('POST', '/players', [], json_encode($data));
    }
1114379
public function add(array $data)
    {
        $data = &$this->loadFilterData($data);
        if ( $data == false ) {
            return false;
        }
        if ( !isset($data[$this->primaryKey]) && $this->autoPrimary ) {
            $data[$this->primaryKey] = StringUtils::genGlobalUid();
        }

        $result = $this->db->insert($this->table, $data);
        if ( $result === true ) { //非自增ID
            $result = $data[$this->primaryKey];
        }

        return $result;
    }
1074577
public function addDataSql(string $data)
    {
        $this->sql_data = true;
        $this->sql_params = [];

        $args_count = \func_num_args();
        $args = \func_get_args();

        for ($i = 1; $i < $args_count; $i++) {
            $this->sql_params[] = $args[$i];
        }

        $this->data = $data;

        return $this;
    }
1364782
public function append($data)
	{
		$bites = file_put_contents($this->path, $data, FILE_APPEND | LOCK_EX);

		return $bites !== false;
	}
565529
public function stream_write($data)
    {
        if ($this->_upload === null) {
            return false;
        }
        $this->_upload->addContent($data);
        $result = StringHelper::byteLength($data);
        $this->_pointerOffset += $result;
        return $result;
    }