Net_Dict
[ class tree: Net_Dict ] [ index: Net_Dict ] [ all elements ]

Class: Net_Dict

Source Location: /Net_Dict-1.0.7/Net/Dict.php

Class Overview


The main Net_Dict class


Author(s):

Version:

  • Release: @package_version@

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 46]
The main Net_Dict class

Net_Dict is a PHP interface for talking to dictd servers.



[ Top ]


Class Variables

$cache =

[line 88]

PEAR Cache

Type:   object


[ Top ]

$caching =  false

[line 81]

if caching is on or off

Type:   boolean


[ Top ]

$port =  NET_DICT_PORT

[line 60]

Default DICT Port

Type:   int


[ Top ]

$server =  NET_DICT_SERVER

[line 53]

Default DICT server name

Type:   string


[ Top ]

$servinfo =

[line 74]

Server Information

Type:   string


[ Top ]



Method Detail

auth   [line 338]

mixed auth( string $user, string $auth)

The client can authenticate itself to the server using a username and password. The authentication-string will be computed as in the APOP protocol discussed in [RFC1939].
  • Todo: Implement this method.

Parameters:

string   $user   —  username
string   $auth   —  password

[ Top ]

client   [line 273]

mixed client( [string $text = 'cnb'])

Allows the client to provide information about itself

for possible logging and statistical purposes. All clients SHOULD send this command after connecting to the server. All DICT servers MUST implement this command (note, though, that the server doesn't have to do anything with the information provided by the client).

  • Return: string if successful, else PEAR_Error

Parameters:

string   $text   —  defaults to 'cnb'

[ Top ]

connect   [line 379]

mixed connect( [string $server = ''], [integer $port = 0])

Connects to a dict server and sets up a socket
  • Return: true on success, else PEAR_Error

Parameters:

string   $server   —  dict server
integer   $port   —  port to connect to

[ Top ]

define   [line 99]

mixed define( string $word, [string $database = '*'])

Gets definitions for the specified word in the specified database.
  • Return: Array of definitions if sucessful, else PEAR_Error

Parameters:

string   $word   —  specified word
string   $database   —  specified database

[ Top ]

disconnect   [line 425]

mixed disconnect( )

Disconnect from the dict server
  • Return: Net_Socket::disconnect()'s return value
  • Author: Ian Eure <ieure@php.net>
  • See: Net_Socket::disconnect()

[ Top ]

help   [line 300]

mixed help( )

Provides a short summary of commands that are understood by this implementation of the DICT server. The help text will be presented as a textual response, terminated by a single period on a line by itself. All DICT servers MUST implement this command.
  • Return: string on success, else PEAR_Error

[ Top ]

isOK   [line 571]

boolean isOK( array $resp)

Checks if a response code is positive

Parameters:

array   $resp   —  response code

[ Top ]

match   [line 160]

mixed match( string $word, [string $strategy = 'substring'], [string $database = '*'])

Searches an index for the dictionary, and reports words which were found using a particular strategy.
  • Return: Array of matches if successful, else PEAR_Error

Parameters:

string   $word   —  word to search for
string   $strategy   —  strategy used, defaults to 'substring'
string   $database   —  database to search, all if not specified.

[ Top ]

optionMIME   [line 323]

mixed optionMIME( )

Requests that all text responses be prefaced by a MIME header [RFC2045] followed by a single blank line (CRLF).
  • Todo: Implement this method

[ Top ]

quit   [line 311]

mixed quit( )

This command is used by the client to cleanly exit the server.

All DICT servers MUST implement this command.

  • Return: string on success, else PEAR_Error

[ Top ]

readLine   [line 537]

All readLine( )

Alias to Net_Socket::readLine();
  • Return: available data up to a newline, without that newline, or until the end of the socket, or a PEAR_Error if not connected.
  • See: Net_Socket::readLine();

[ Top ]

SASLAuth   [line 354]

mixed SASLAuth( string $mechanism, string $initial_response)

The Simple Authentication and Security Layer (SASL) is currently being developed [RFC2222]. The DICT protocol reserves the SASLAUTH and SASLRESP commands for this method of authentication.
  • Todo: Implement this method.

Parameters:

string   $mechanism   —  mechanism used
string   $initial_response   —  initial response

[ Top ]

SASLResp   [line 367]

mixed SASLResp( string $response)

The client will send all responses using the SASLRESP command and a BASE64-encoded parameter.
  • Todo: Implement this method.

Parameters:

string   $response   —  the response

[ Top ]

setCache   [line 459]

void setCache( [boolean $flag = false], [string $container = ''], [array $container_options = ''])

Sets caching on or off and provides the cache type and parameters

Parameters:

boolean   $flag   —  true if caching is required
string   $container   —  name of container
array   $container_options   —  options

[ Top ]

setServer   [line 441]

void setServer( string $server, [int $port = 0])

Sets the server and port of dict server

Parameters:

string   $server   —  server address
int   $port   —  port number to use

[ Top ]

showDatabases   [line 187]

mixed showDatabases( )

Gets list of available databases
  • Return: Array of databases if successful, else PEAR_Error

[ Top ]

showInfo   [line 244]

mixed showInfo( string $database)

Gets source, copyright, and licensing information about the specified database.
  • Return: string if successful, else PEAR_Error

Parameters:

string   $database   —  database name

[ Top ]

showServer   [line 257]

mixed showServer( )

Gets local server information written by the local administrator.

This could include information about local databases or strategies, or administrative information such as who to contact for access to databases requiring authentication.

  • Return: string if sucessful, else PEAR_Error

[ Top ]

showStrategies   [line 214]

mixed showStrategies( )

Gets a list of available strategies
  • Return: Array of strategies if successful, else PEAR_Error

[ Top ]

simpleQuery   [line 549]

mixed simpleQuery( string $query)

Runs a generic dict query
  • Return: string on success, else PEAR_Error

Parameters:

string   $query   —  dict query

[ Top ]

status   [line 286]

mixed status( )

Display some server-specific timing or debugging information. This information may be useful in debugging or tuning a DICT server. All DICT servers MUST implement this command (note, though, that the text part of the response is not specified and may be omitted).
  • Return: string if successful, else PEAR_Error

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:41:17 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.