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

Class: Net_Dict

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

Class Overview


The main Net_Dict class


Author(s):

Version:

  • CVS: $Revision: 286432 $

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 47]
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 335]

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   — 
string   $auth   — 

[ Top ]

client   [line 270]

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   — 

[ Top ]

connect   [line 372]

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   — 
integer   $port   — 

[ 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   — 
string   $database   — 

[ Top ]

disconnect   [line 418]

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 297]

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 555]

boolean isOK( array $resp)

Checks if a response code is positive

Parameters:

array   $resp   — 

[ Top ]

match   [line 157]

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   — 
string   $strategy   — 
string   $database   — 

[ Top ]

optionMIME   [line 320]

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 308]

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 523]

void readLine( )

Alias to Net_Socket::readLine();
  • See: Net_Socket::readLine();

[ Top ]

SASLAuth   [line 349]

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   — 
string   $initial_response   — 

[ Top ]

SASLResp   [line 361]

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   — 

[ Top ]

setCache   [line 450]

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

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

Parameters:

boolean   $cache   — 
string   $container   — 
array   $container_options   — 
   $flag   — 

[ Top ]

setServer   [line 433]

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

Sets the server and port of dict server

Parameters:

string   $server   — 
int   $port   — 

[ Top ]

showDatabases   [line 184]

mixed showDatabases( )

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

[ Top ]

showInfo   [line 241]

mixed showInfo( string $database)

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

Parameters:

string   $database   — 

[ Top ]

showServer   [line 254]

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 211]

mixed showStrategies( )

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

[ Top ]

simpleQuery   [line 534]

mixed simpleQuery( string $query)

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

Parameters:

string   $query   — 

[ Top ]

status   [line 283]

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:32:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.