original_string: public function escape($value)
  	{
  		// Make sure the database is connected
  		$this->_connection or $this->connect();
  
  		$result = $this->_connection->quote($value);
  		// poor-mans workaround for the fact that not all drivers implement quote()
  		if (empty($result))
  		{
  			$result = "'".str_replace("'", "''", $value)."'";
  		}
  		return $result;
  	}
code: public function escape($value)
  	{
  		// Make sure the database is connected
  		$this->_connection or $this->connect();
  
  		$result = $this->_connection->quote($value);
  		// poor-mans workaround for the fact that not all drivers implement quote()
  		if (empty($result))
  		{
  			$result = "'".str_replace("'", "''", $value)."'";
  		}
  		return $result;
  	}
code_tokens: public function escape ( $ value ) { // Make sure the database is connected $ this -> _connection or $ this -> connect ( ) ; $ result = $ this -> _connection -> quote ( $ value ) ; // poor-mans workaround for the fact that not all drivers implement quote() if ( empty ( $ result ) ) { $ result = "'" . str_replace ( "'" , "''" , $ value ) . "'" ; } return $ result ; }
docstring: Escape a value
  
  @param mixed $value
  
  @return string
docstring_tokens: Escape a value