
Static Public Member Functions | |
| static | basename ($path) |
| INSERT BRIEF DESCRIPTION HERE. | |
| static | checkInit () |
| static | consistencyCheck () |
| 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 | init () |
| 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.
Definition at line 12 of file Snap2.php5.
| static Snap2::basename | ( | $ | path | ) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
| $path | [TYPE]: DESCRIPTION |
Definition at line 351 of file Snap2.php5.
| static Snap2::checkInit | ( | ) | [static] |
For internal use only.
INTERNAL METHOD
This is called from within the API to make sure that Snap2 has been properly initialized. Do not call it directly.
Definition at line 130 of file Snap2.php5.
Referenced by SnapDBI::cancelTransaction(), SnapDBI::commitTransaction(), SnapDBI::firstRow(), SnapDBI::freeResult(), SnapDBI::getInsertId(), SnapDBI::getNumRows(), SnapDBI::getRow(), SnapVersion::lookup(), SnapResource::lookup(), SnapDirectory::lookup(), SnapDBI::query(), SnapVersion::retrieve(), SnapResource::retrieve(), SnapDirectory::retrieve(), and SnapDBI::startTransaction().
| static Snap2::consistencyCheck | ( | ) | [static] |
| static Snap2::dirname | ( | $ | path | ) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
| $path | [TYPE]: DESCRIPTION |
Definition at line 335 of file Snap2.php5.
| static Snap2::getCurrentUser | ( | ) | [static] |
Convenience method that retrieves UID of current user.
Definition at line 205 of file Snap2.php5.
Referenced by SnapResourceUserPermission::__construct(), SnapPermissionCache::__construct(), SnapDirectoryUserPermission::__construct(), SnapPermission::doCommit(), SnapPermission::getCachedAccess(), SnapGroupPermissionObject::getGroupPermissionsForUser_base(), SnapPermission::getGroupsAccess(), SnapPermission::getUserAccess(), SnapPermission::grantPrivilege(), SnapPermission::has(), SnapPermission::hasEx(), SnapPermission::isSpecialUser(), SnapVersion::logAction(), SnapPermission::mayApproveForDev(), SnapPermission::mayApproveForLive(), SnapPermission::mayChangeMetadata(), SnapPermission::mayCreateDirectory(), SnapPermission::mayCreateResource(), SnapPermission::mayCreateVersion(), SnapPermission::mayDefunct(), SnapPermission::mayDelete(), SnapPermission::mayDeny(), SnapPermission::mayDestroy(), SnapPermission::mayDestroyVersion(), SnapPermission::mayLinkTo(), SnapPermission::mayRenameAt(), SnapPermission::mayRenameFiles(), SnapPermission::mayReorderFiles(), SnapPermission::mayReorderIn(), SnapPermission::mayRestore(), SnapPermission::maySetCanonicalParent(), SnapPermission::maySteal(), SnapPermission::maySubmit(), SnapPermission::mayUnlinkFrom(), SnapPermission::mayUpdate(), SnapResourceUserPermission::retrieve(), SnapPermissionCache::retrieve(), SnapDirectoryUserPermission::retrieve(), SnapPermission::revokePrivilege(), SnapPermission::revokeUser(), SnapPermission::setUserAccess(), and SnapPermissionCache::warmCache().
| static Snap2::getDeletedDirectory | ( | ) | [static] |
Retrieves SnapDirectory object for DELETED (trash) directory.
Prefer this method to Snap2::lookup('/DELETED/') or SnapDirectory::retrieve(2)
Definition at line 252 of file Snap2.php5.
References SnapDirectory::retrieve().
| 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.
Definition at line 181 of file Snap2.php5.
Referenced by SnapGroupPermissionObject::getGroupPermissionsForUser_base(), and TSD::setPermission().
| static Snap2::getRootDirectory | ( | ) | [static] |
Retrieves SnapDirectory object for root directory.
Prefer this method to Snap2::lookup('//') or SnapDirectory::retrieve(1)
Definition at line 239 of file Snap2.php5.
References SnapDirectory::retrieve().
| static Snap2::init | ( | ) | [static] |
For internal use only.
INTERNAL METHOD
This method is called by checkInit() if Snap2 has not been initialized yet. You do not need to ever call this method directly.
Definition at line 38 of file Snap2.php5.
References SnapDBI::connect(), dirname(), SConfig::getDefault(), and SnapCache::init().
| static Snap2::isAdmin | ( | ) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
Definition at line 119 of file Snap2.php5.
Referenced by SnapFile::getStylesheets().
| 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 |
Definition at line 268 of file Snap2.php5.
References SnapResource::lookup(), SnapVersion::lookup(), and SnapDirectory::lookup().
| static Snap2::pathParts | ( | $ | path | ) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
| $path | [TYPE]: DESCRIPTION |
Definition at line 285 of file Snap2.php5.
| static Snap2::pathType | ( | $ | path | ) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
| $path | [TYPE]: DESCRIPTION |
Definition at line 367 of file Snap2.php5.
| static Snap2::reinit | ( | $ | user = false, |
|
| $ | server = false | |||
| ) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
| $user | [TYPE]: DESCRIPTION | |
| $server | [TYPE]: DESCRIPTION |
Definition at line 78 of file Snap2.php5.
References SnapDBI::connect(), dirname(), SnapDBI::disconnect(), SConfig::getDefault(), and SnapCache::init().
Referenced by TSDBook::delete(), and TSDBook::uploadCoverImage().
| 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 |
Definition at line 166 of file Snap2.php5.
References SnapCache::setEnableAPC().
| 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 |
Definition at line 151 of file Snap2.php5.
References SnapCache::setEnableCache().
| const Snap2::DELETED_DIR_ID |
Directory ID of DELETED directory
Definition at line 16 of file Snap2.php5.
Referenced by SnapFile::_canMove(), SnapFile::_canSetCanonicalParent(), SnapPermission::canChangePermission(), SnapFile::isChildOf(), and SnapFile::loadCanonicalPath().
| const Snap2::ROOT_DIR_ID |
Directory ID of root directory
Definition at line 14 of file Snap2.php5.
Referenced by SnapFile::_canMove(), SnapFile::_canSetCanonicalParent(), SnapFile::isChildOf(), and SnapFile::loadCanonicalPath().
1.5.6