Perforce Chronicle 2012.2/486814
API Documentation

P4Cms_AssetHandlerInterface Interface Reference

Provide a common interface for Asset Handlers. More...

Inheritance diagram for P4Cms_AssetHandlerInterface:
P4Cms_AssetHandler_File P4Cms_AssetHandler_S3

List of all members.

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.

Detailed Description

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.

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Member Function Documentation

P4Cms_AssetHandlerInterface::exists ( id)

Check if the given ID exists in storage.

Parameters:
string$idThe ID to test
Returns:
bool true if exists, false otherwise

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.

Returns:
bool true if assets stored offsite, false otherwise

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.

Parameters:
string$idThe ID to store under
string$dataThe data to store
Returns:
bool True if put was successful, false otherwise

Implemented in P4Cms_AssetHandler_File, and P4Cms_AssetHandler_S3.

P4Cms_AssetHandlerInterface::uri ( id)

Provide a URI for the indicated asset ID.

Parameters:
string$idThe ID to get a URI for
Returns:
string|bool The uri used for the specified asset or false

Implemented in P4Cms_AssetHandler_File, and P4Cms_AssetHandler_S3.


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