Snap2 Class Reference

Management class for Snap2. More...

Inheritance diagram for Snap2:

Inheritance graph
[legend]

List of all members.

Static Public Member Functions

static basename ($path)
 INSERT BRIEF DESCRIPTION HERE.
static dirname ($path)
 INSERT BRIEF DESCRIPTION HERE.
static getCurrentUser ()
 Convenience method that retrieves UID of current user.
static getDeletedDirectory ()
 Retrieves SnapDirectory object for DELETED (trash) directory.
static getLDAP ()
 Retrieves the LDAP authentication module for this session.
static getRootDirectory ()
 Retrieves SnapDirectory object for root directory.
static isAdmin ()
 INSERT BRIEF DESCRIPTION HERE.
static lookup ($path)
 Convenience method that can look up any Snap object.
static pathParts ($path)
 INSERT BRIEF DESCRIPTION HERE.
static pathType ($path)
 INSERT BRIEF DESCRIPTION HERE.
static reinit ($user=false, $server=false)
 INSERT BRIEF DESCRIPTION HERE.
static setEnableAPC ($enable)
 Enables or disables usage of APC for caching.
static setEnableCache ($enable, $clear=false)
 Enables or disables the Snap2 cache.

Public Attributes

const DELETED_DIR_ID
const ROOT_DIR_ID


Detailed Description

Management class for Snap2.

This class contains some methods that deal with Snap2 initialization as well as a few other convenience methods, mostly for use within the API. Some are to be used outside the API and are documented as such.


Member Function Documentation

static Snap2::basename ( path  )  [static]

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$path [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

static Snap2::dirname ( path  )  [static]

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$path [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

static Snap2::getCurrentUser (  )  [static]

Convenience method that retrieves UID of current user.

Returns:
[int]: UID of current user, or false if no logged in user

static Snap2::getDeletedDirectory (  )  [static]

Retrieves SnapDirectory object for DELETED (trash) directory.

Prefer this method to Snap2::lookup('/DELETED/') or SnapDirectory::retrieve(2)

Returns:
[SnapDirectory]: DELETED directory object

static Snap2::getLDAP (  )  [static]

Retrieves the LDAP authentication module for this session.

The module will only be available if the user has logged in using the SWAT mechanisms. This should only be necessary if the project is using Snap2 to modify content or metadata in Snap2. If it is only reading Snap2, there is no need to have a SWAT log in.

Returns:
[SLdapAuthModule]: LDAP authentication module for logged in user, or null if there is no logged in user, or LDAP was not used for authentication

static Snap2::getRootDirectory (  )  [static]

Retrieves SnapDirectory object for root directory.

Prefer this method to Snap2::lookup('//') or SnapDirectory::retrieve(1)

Returns:
[SnapDirectory]: root directory object

static Snap2::isAdmin (  )  [static]

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

static Snap2::lookup ( path  )  [static]

Convenience method that can look up any Snap object.

This method determines, based on the path given, whether the object will be a directory, resource or version, and then calls that object type's lookup() method.

Parameters:
$path [string]: path to directory/resource/version
Returns:
[SnapObject]: Snap object corresponding to path, or null if path is invalid or does not point to a valid or existing object

static Snap2::pathParts ( path  )  [static]

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$path [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

static Snap2::pathType ( path  )  [static]

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$path [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

static Snap2::reinit ( user = false,
server = false 
) [static]

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$user [TYPE]: DESCRIPTION
$server [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

static Snap2::setEnableAPC ( enable  )  [static]

Enables or disables usage of APC for caching.

When APC caching is enabled, objects are also stored in the APC cache and have a lifetime longer than a single run of a script. This can improve performance in some cases, but it is currently somewhat broken and leads to data corruption. It is thus disabled by default. Semantically, the APC cache is write-through. That is, writes to the normal cache are written through to the APC cache synchronously.

Parameters:
$enable [boolean]: whether or not to enable the APC cache

static Snap2::setEnableCache ( enable,
clear = false 
) [static]

Enables or disables the Snap2 cache.

You will almost always want the cache to be on. It is better to set the SConfig default 'snap2.useCache' before using Snap2. This function should only be used to temporarily countermand that default within code that needs it.

Parameters:
$enable [boolean]: whether or not to enable the cache
$clear [boolean]: whether to clear the cache if it has been (temporarily) disabled


Member Data Documentation

Directory ID of DELETED directory

Directory ID of root directory


The documentation for this class was generated from the following file:

Generated on Wed Nov 24 02:03:07 2010 for Common by  doxygen 1.5.6