Perforce Chronicle 2012.2/486814
API Documentation
|
Provide a common interface for Asset Handlers. More...
Public Member Functions | |
exists ($id) | |
Check if the given ID exists in storage. | |
isOffsite () | |
Used to determine if the asset handler will be storing assets offsite or not. | |
put ($id, $data) | |
Store the passed data using indicated ID. | |
uri ($id) | |
Provide a URI for the indicated asset ID. |
Provide a common interface for Asset Handlers.
In a single server configuration assets can simply be stored under the resources folder. When running multiple web servers the assets need to be put into a shared data store (such as S3) to allow all webservers access.
P4Cms_AssetHandlerInterface::exists | ( | $ | id | ) |
Check if the given ID exists in storage.
string | $id | The ID to test |
Implemented in P4Cms_AssetHandler_File, and P4Cms_AssetHandler_S3.
P4Cms_AssetHandlerInterface::isOffsite | ( | ) |
Used to determine if the asset handler will be storing assets offsite or not.
Assets such as CSS need to know this so they can decide if they need to include the site's url when referencing images.
Implemented in P4Cms_AssetHandler_File, and P4Cms_AssetHandler_S3.
P4Cms_AssetHandlerInterface::put | ( | $ | id, |
$ | data | ||
) |
Store the passed data using indicated ID.
Will clobber any existing entry with the same ID.
string | $id | The ID to store under |
string | $data | The data to store |
Implemented in P4Cms_AssetHandler_File, and P4Cms_AssetHandler_S3.
P4Cms_AssetHandlerInterface::uri | ( | $ | id | ) |
Provide a URI for the indicated asset ID.
string | $id | The ID to get a URI for |
Implemented in P4Cms_AssetHandler_File, and P4Cms_AssetHandler_S3.