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 |
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.
static Snap2::basename | ( | $ | path | ) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
$path | [TYPE]: DESCRIPTION |
static Snap2::dirname | ( | $ | path | ) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
$path | [TYPE]: DESCRIPTION |
static Snap2::getCurrentUser | ( | ) | [static] |
Convenience method that retrieves UID of current user.
static Snap2::getDeletedDirectory | ( | ) | [static] |
Retrieves SnapDirectory object for DELETED (trash) directory.
Prefer this method to Snap2::lookup('/DELETED/') or SnapDirectory::retrieve(2)
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.
static Snap2::getRootDirectory | ( | ) | [static] |
Retrieves SnapDirectory object for root directory.
Prefer this method to Snap2::lookup('//') or SnapDirectory::retrieve(1)
static Snap2::isAdmin | ( | ) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
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.
$path | [string]: path to directory/resource/version |
static Snap2::pathParts | ( | $ | path | ) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
$path | [TYPE]: DESCRIPTION |
static Snap2::pathType | ( | $ | path | ) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
$path | [TYPE]: DESCRIPTION |
static Snap2::reinit | ( | $ | user = false , |
|
$ | server = false | |||
) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
$user | [TYPE]: DESCRIPTION | |
$server | [TYPE]: 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.
$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.
$enable | [boolean]: whether or not to enable the cache | |
$clear | [boolean]: whether to clear the cache if it has been (temporarily) disabled |
const Snap2::DELETED_DIR_ID |
Directory ID of DELETED directory
const Snap2::ROOT_DIR_ID |
Directory ID of root directory