src/Dcarrith/LxMPD/LxMPD.php
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;
        }
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;
        }
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 ; }
Writes data to the MPD socket
@param string $data The data to be written
@return bool
Writes data to the MPD socket