Writes data to the MPD socket
@param string $data The data to be written
@return bool
9990
private function write( $data ) {

		if( !$this->connection->established ) {

			Log::info('LxMPD connection is NOT established', array($data));

                        $this->connection->establish();
                }

		if( !fputs( $this->connection->socket, "$data\n" ) ) {

			Log::info('LxMPD write fputs seems to have failed writing to socket', array($data));

			throw new MPDException( 'Failed to write to MPD socket', self::MPD_WRITE_FAILED );
                }

                return true;
        }
35298
public function _write($pId, $pData)
    {
        Agl::validateParams(array(
            'String' => $pData
        ));

        $access = time();

        if (! isset($this->_items[$pId])) {
            $this->_items[$pId] = Agl::getModel(self::DB_COLLECTION);
            $this->_items[$pId]->loadByRealid($pId);
        }

        $this->_items[$pId]
            ->setRealid($pId)
            ->setAccess($access)
            ->setData($pData);

        if (! $this->_items[$pId]->getId()) {
            $this->_items[$pId]->insert();
        } else {
            $this->_items[$pId]->save();
        }

        return true;
    }
773966
public function write($action, $data)
    {
        $message = http_build_query($data);

        $resource = $this->getResource();
        $length = strlen($message);
        $sent = 0;

        $content = $this->getHeader($action, $length) . $message;

        while ($this->isConnected() && $sent < $length) {
            $chunk = fwrite($resource, substr($content, $sent));

            if (false === $chunk) {
                throw new \RuntimeException('Could not write to socket');
            }

            $sent += $chunk;
        }
    }
1205135
public function write($data)
    {

        if (is_resource($data)) {
            return (bool)stream_copy_to_stream($data, $this->resource());
        }

        $isStream = $data instanceof Stream;

        if (!$isStream && Type::isStringable($data)) {
            return (bool)fwrite($this->resource(), $data);
        }

        if (!$isStream) {
            throw new TypeException('Unsupported data type in write(): ' . Type::of($data));
        }

        $dataResource = $data->resource();

        if (is_resource($dataResource)) {
            return $this->write($dataResource);
        }

        $resource = $this->resource();

        $bytes = 0;

        foreach ($data as $chunk) {
            $bytes += fwrite($resource, $chunk);
        }

        return (bool)$bytes;

    }
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;
  }
632373
public function sendData($data)
    {
        if ($this->isConnected()) {
            if (socket_write($this->socket, $data, strlen($data)) === false) {
                $this->eventManager()->fire('onClose',
                   [
                        $this->phoneNumber,
                        'Connection closed!',
                    ]
              );
            }
        }
    }
729640
public function write($buffer)
    {
        if ($this->driver === self::DRIVER_SOCKET) {
            return socket_write($this->sock, $buffer, \strlen($buffer));
        } else {
            // $buffer = str_replace(chr(255), chr(255) . chr(255), $buffer);
            return fwrite($this->sock, $buffer);
        }
    }
1281255
public function writeln($data)
    {
        if (!$this->alive) {
            Daemon::log('Attempt to write to dead IOStream (' . get_class($this) . ')');
            return false;
        }
        if (!isset($this->bevWrite)) {
            return false;
        }
        if (!mb_orig_strlen($data) && !mb_orig_strlen($this->EOL)) {
            return true;
        }
        $this->writing = true;
        $this->bevWrite->write($data);
        $this->bevWrite->write($this->EOL);
        return true;
    }
260454
protected function _write($data)
    {
        if (!$this->connected) {
            $message = 'No connecting found while writing data to socket.';
            throw new RuntimeException($message);
        }

        $data .= "\r\n";

        $length = strlen($data);
        $fwrited = fwrite($this->_connection, $data, $length);

        if ($fwrited === false) {
            throw new SocketException('Socket is broken, write failed: '.substr($data, 0, 100));
        } elseif ($fwrited < $length) {
            throw new SocketException("Socket is broken, only write {$fwrited} bytes of {$length} bytes: ".substr($data, 0, 100));
        }

        return $fwrited;
    }
1117736
public function write($data)
    {
        if ($this->closed) {
            return;
        }

        $all = $this->tail . $data;
        $messages = $this->getParser()->consumeAll($all);
        $this->tail = $all;

        foreach ($messages as $message) {
            if (isset($message['message'])) {
                $this->emit('data', array($message['message']));
                $this->emit('irc.received', array($message));
            } elseif (isset($message['invalid'])) {
                $this->emit('invalid', array($message['invalid']));
            }
        }
    }
726820
public function stream_write($data)
    {
        $tmp = &$this->_data[$this->_datapos];

        $oldlen = $tmp['l'];
        $res = fwrite($tmp['fp'], $data);
        if ($res === false) {
            return false;
        }

        $tmp['p'] = ftell($tmp['fp']);
        if ($tmp['p'] > $oldlen) {
            $tmp['l'] = $tmp['p'];
            $this->_length += ($tmp['l'] - $oldlen);
        }

        return $res;
    }
363560
protected function _write($data) {
		if (!$this->connected && !$this->connect()) {
			return false;
		}

		$data .= "\r\n";
		return fwrite($this->_connection, $data, strlen($data));
	}
970600
public function write($data = null) {
		if (!is_resource($this->_resource)) {
			return false;
		}
		if (!is_object($data)) {
			$data = $this->_instance($this->_classes['request'], (array) $data + $this->_config);
		}
		return stream_context_set_option(
			$this->_resource, $data->to('context', ['timeout' => $this->_timeout])
		);
	}
406332
public function stream_write($data)
    {
        if (! $this->temporaryFileHandle) {
            return 0;
        }
        
        $len = strlen($data);
        fwrite($this->temporaryFileHandle, $data, $len);
        return $len;
    }
37047
public function write($data) : bool
    {
        $success = false;

        if ($this->isFile() && $this->isWriteable()) {
            $success = file_put_contents($this->realPath, $data) !== false;
        }

        return $success;
    }
140165
public function stream_write($data) {
    assert(isset($this->client));
    return $this->client->write($data);
  }
205261
public function sendData( $data )
    {
        if ( is_resource( $this->connection ) )
        {
            if ( fwrite( $this->connection, $data . self::CRLF,
                        strlen( $data ) + strlen( self::CRLF  ) ) === false )
            {
                throw new ezcMailTransportException( 'Could not write to the stream. It was probably terminated by the host.' );
            }
        }
    }