amga-php
[ class tree: amga-php ] [ index: amga-php ] [ all elements ]

Class: MDClient

Source Location: /mdclient.php

Class Overview


This is the main class to access AMGA through PHP


Variables

Methods



Class Details

[line 12]
This is the main class to access AMGA through PHP



[ Top ]


Class Variables

$buffer =

[line 61]

Buffer which contains the messages received from the server.



Tags:

access:  private

Type:   string


[ Top ]

$certFile =

[line 117]

Path of the user's certificate.



Tags:

access:  private

Type:   string


[ Top ]

$connected =

[line 19]

Status of the connection.



Tags:

access:  private

Type:   integer


[ Top ]

$currentCommand =

[line 103]

String of the command to execute.



Tags:

access:  private

Type:   string


[ Top ]

$debug =

[line 131]

Debug mode.



Tags:

access:  private

Type:   boolean


[ Top ]

$EOT =

[line 138]

End Of Transmission.



Tags:

access:  private

Type:   integer


[ Top ]

$greetings =

[line 89]

Greetings message.



Tags:

access:  private

Type:   string


[ Top ]

$host =

[line 26]

Hostname of the AMGA server.



Tags:

access:  private

Type:   string


[ Top ]

$keepalive =

[line 54]

Whether we want to keep the connection persistent.



Tags:

access:  private

Type:   integer


[ Top ]

$keyFile =

[line 110]

Path of the user's key.



Tags:

access:  private

Type:   string


[ Top ]

$login =

[line 40]

Username used to access the server.



Tags:

access:  private

Type:   string


[ Top ]

$nattrs =

[line 145]

Number of attributes.



Tags:

access:  private

Type:   integer


[ Top ]

$password =

[line 47]

Password used to access the server.



Tags:

access:  private

Type:   string


[ Top ]

$port =

[line 33]

Port on which the AMGA server listens for connection.



Tags:

access:  private

Type:   integer


[ Top ]

$protocolVersion =

[line 96]

Version of the protocol.



Tags:

access:  private

Type:   integer


[ Top ]

$reqSSL =

[line 68]

Whether we want to require SSL.



Tags:

access:  private

Type:   boolean


[ Top ]

$session =

[line 82]

Name of the session.



Tags:

access:  private

Type:   integer


[ Top ]

$sessionID =

[line 75]

Identifier of the session.



Tags:

access:  private

Type:   integer


[ Top ]

$socket =

[line 124]

Socket used to talk to the AMGA server.



Tags:

access:  private

Type:   resource


[ Top ]



Class Methods


constructor __construct [line 158]

void __construct( string $host, integer $port, [string $login = "anonymous"], [string $password = ""], [boolean $keepalive = true])

Constructor method.

It is used to initialize the class members




Tags:

access:  public


Parameters:

string   $host   AMGA server hostname
integer   $port   AMGA server port
string   $login   username used to access AMGA
string   $password   password used to access AMGA
boolean   $keepalive   whether we want to keep the connection persistent

[ Top ]

method abort [line 957]

void abort( )

Aborts an upload.



Tags:

access:  public


[ Top ]

method addAttr [line 720]

void addAttr( string $file, string $name, string $t)

Adds one attribute to a file.



Tags:

access:  public


Parameters:

string   $file   the file name of the entry
string   $name   the name of the attribute
string   $t   type of the attribute

[ Top ]

method addEntries [line 702]

void addEntries( array $entries)

Adds some entries to amga.



Tags:

access:  public


Parameters:

array   $entries   array of entries to be added

[ Top ]

method addEntry [line 684]

void addEntry( string $file, string $keys, string $values)

Adds one entry to amga.



Tags:

access:  public


Parameters:

string   $file   the file name of the entry
string   $keys   a list of keys
string   $values   the list of values which are assigned to the keys

[ Top ]

method cd [line 1021]

void cd( string $dir)

Changes current directory.



Tags:

access:  public


Parameters:

string   $dir   name of new directory

[ Top ]

method clearAttr [line 746]

void clearAttr( string $file, string $name)

Resets the value of a given attribute of a file.



Tags:

access:  public


Parameters:

string   $file   the file name of the entry
string   $name   the name of the attribute

[ Top ]

method commit [line 968]

void commit( )

Commits an upload



Tags:

access:  public


[ Top ]

method connect [line 215]

void connect( )

Function used to connect to the AMGA server.



Tags:

access:  public


[ Top ]

method createDir [line 808]

void createDir( string $dir)

Creates a directory on amga.



Tags:

access:  public


Parameters:

string   $dir   name of the directory we want to create

[ Top ]

method dataArrived [line 571]

boolean dataArrived( )

Function used to check if data has arrived.



Tags:

return:  whether data has arrived
access:  private


[ Top ]

method disconnect [line 297]

void disconnect( [string $saveSession = false])

Function used to disconnect from the AMGA server.



Tags:

access:  public


Parameters:

string   $saveSession   whether to save the session

[ Top ]

method doSSLHandshake [line 197]

void doSSLHandshake( [string $session = ""])

SSL handshake function.



Tags:

access:  public


Parameters:

string   $session   name of the session

[ Top ]

method eot [line 605]

boolean eot( )

Function used to check if it is End Of Transmission.



Tags:

return:  whether it is End Of Transmission
access:  public


[ Top ]

method execute [line 329]

void execute( string $command)

Function used to send a command to the server and wait for a return condition.

If the client is not connected it will also try to connect first.




Tags:

return:  if the command executes successfully, throws an exception otherwise
access:  public


Parameters:

string   $command   text of the command

[ Top ]

method executeNoWait [line 405]

string executeNoWait( $command)

Function used to execute commands without waiting for the answer.

It doesn't wait for any return condition of the remote command.




Tags:

return:  if the command executes successfully, throws an exception otherwise
access:  public


Parameters:

   $command  

[ Top ]

method fetchData [line 474]

integer fetchData( )

Fetches more data from the server until a full line is in the buffer or an EOT is detected.



Tags:

return:  the number of lines fetched
access:  private


[ Top ]

method fetchRow [line 426]

string fetchRow( )

Reads a row from the buffer, if necessary the buffer is first filled by reading from the server.



Tags:

return:  a single row from the output buffer
access:  private


[ Top ]

method find [line 847]

void find( string $pattern, string $query)

Finds entries in the catalogue matching a query.

Returns all files in the catalogue matching a given filename pattern and SQL-like query.




Tags:

access:  public


Parameters:

string   $pattern   the pattern matching possible filenames(entries)
string   $query   the SQL-Like query

[ Top ]

method getattr [line 630]

void getattr( string $file, array $attributes)

Function used to get some attributes of a file.



Tags:

access:  public


Parameters:

string   $file   the name of the target file
array   $attributes   list of attributes we want to get

[ Top ]

method getEntry [line 644]

array(name, getEntry( )

Return name and attributes of an entry.



Tags:

return:  array(attributes))
access:  public


[ Top ]

method getGreetings [line 1105]

string getGreetings( )

Function used to retrieve the greetings message.



Tags:

return:  the greetings message
access:  public


[ Top ]

method getNAttrs [line 1115]

string getNAttrs( )

Function used to retrieve the number of attributes used.



Tags:

return:  the number of attributes set by the previous command
access:  public


[ Top ]

method getProtocolVersion [line 1125]

string getProtocolVersion( )

Function used to retrieve the protocol version.



Tags:

return:  the protocol version
access:  public


[ Top ]

method getSelectAttrEntry [line 880]

array getSelectAttrEntry( )

Returns array of attributes.



Tags:

return:  of attributes
access:  public


[ Top ]

method grp_member [line 1044]

string grp_member( )

Function used to retrieve the groups to which the user belongs.



Tags:

return:  comma separated list of groups
access:  public


[ Top ]

method listAttr [line 785]

array(array(attributes), listAttr( string $file)

Lists the attributes of a file.

For a given file this function returns a list of attributes of a directory and their types. Note that also attributes which are undefined (assigned to NULL) for the entry are listed.




Tags:

return:  array(types))
access:  public


Parameters:

string   $file   name of target file

[ Top ]

method listEntries [line 758]

string listEntries( string $pattern)

List entries according to a specific pattern.



Tags:

return:  list of the entries
access:  public


Parameters:

string   $pattern   the pattern of the entries we want to get

[ Top ]

method put [line 938]

void put( string $file, array $values)

Puts another entry into the collection during an upload().

This call sends data to the server after an upload has been prepared with the upload() call




Tags:

access:  public


Parameters:

string   $file   name of the file
array   $values   array of values to set for the entry

[ Top ]

method pwd [line 770]

string pwd( )

Returns current working directory.



Tags:

return:  name of the current working directory
access:  public


[ Top ]

method quoteValue [line 591]

string quoteValue( string $value)

Function used to quote a string.



Tags:

return:  the quoted string
access:  private


Parameters:

string   $value   the string to quote

[ Top ]

method removeAttr [line 733]

void removeAttr( string $file, string $name)

Removes one attribute from a file.



Tags:

access:  public


Parameters:

string   $file   the file name of the entry
string   $name   the name of the attribute

[ Top ]

method removeDir [line 820]

void removeDir( string $dir)

Removes a directory from amga.



Tags:

access:  public


Parameters:

string   $dir   name of the directory we want to remove

[ Top ]

method requireSSL [line 183]

void requireSSL( string $key, string $cert, [ $capath = "certificates"])

Function used to enable SSL connection.



Tags:

access:  public


Parameters:

string   $key   path of the user's key
string   $cert   path of the user's certificate
   $capath  

[ Top ]

method retrieveResult [line 355]

string retrieveResult( )

Retrieves the result of the remote call. The result is the first line sent by the server. If an error occurred, the rest of the data sent by the server is read until EOT is found.



Tags:

return:  if the command executes successfully, throws an exception otherwise
access:  public


[ Top ]

method rm [line 832]

void rm( string $path)

Removes a file from amga.



Tags:

access:  public


Parameters:

string   $path   name of the file to remove

[ Top ]

method selectAttr [line 862]

void selectAttr( array $attributes, string $query)

Returns given attributes of entries that match a SQL-like query.



Tags:

access:  public


Parameters:

array   $attributes   array of the attributes we want to get
string   $query   the SQL-Like query

[ Top ]

method sendCommand [line 317]

void sendCommand( string $command)

Function used to send a command to the AMGA server.



Tags:

access:  private


Parameters:

string   $command   text of the command

[ Top ]

method sequenceCreate [line 983]

void sequenceCreate( string $name, string $directory, [string $increment = 1], [string $start = 1])

Creates a sequence.



Tags:

access:  public


Parameters:

string   $name   name of the sequence
string   $directory   name of the directory
string   $increment   step of the sequence
string   $start   first value of the sequence

[ Top ]

method sequenceNext [line 996]

$string sequenceNext( string $name)

Returns next element in the sequence.



Tags:

return:  next element in the sequence
access:  public


Parameters:

string   $name   name of the sequence

[ Top ]

method sequenceRemove [line 1009]

void sequenceRemove( string $name)

Removes a sequence.



Tags:

access:  public


Parameters:

string   $name   name of the sequence

[ Top ]

method setAttr [line 664]

void setAttr( string $file, string $keys, string $values)

Sets one ore more attributes of a file.



Tags:

access:  public


Parameters:

string   $file   the file name of the entry
string   $keys   a list of keys
string   $values   the list of values which are assigned to the keys

[ Top ]

method setDebugMode [line 1135]

void setDebugMode( [ $mode = false])

Function used to set the debug mode on/off.



Tags:

access:  public


Parameters:

   $mode  

[ Top ]

method splitUpdateClause [line 1058]

void splitUpdateClause( string $clause)

Function used to split the update clause in order to build a valid command for updateAttr.



Tags:

access:  public


Parameters:

string   $clause   the update clause to be split

[ Top ]

method updateAttr [line 899]

void updateAttr( string $pattern, array $updateExpr, string $condition)

Updates attributes of entries depending on a condition.



Tags:

access:  public


Parameters:

string   $pattern   entries to be updated
array   $updateExpr   expression used for the update
string   $condition   condition to be matched by the entries to be updated

[ Top ]

method upload [line 918]

void upload( string $collection, array $attributes)

Uploads a file to a given collection.



Tags:

access:  public


Parameters:

string   $collection   name of the collection
array   $attributes   array of the attributes

[ Top ]

method whoami [line 1032]

string whoami( )

Function used to retrieve the login of the user.



Tags:

return:  the login name of the user connected
access:  public


[ Top ]


Documentation generated on Fri, 19 Jan 2007 15:37:16 +0100 by phpDocumentor 1.3.1