void addShutdownAction(
callback
$callback, array
$parameters
)
|
|
Add an action to be performed at the end of the request.
Parameters:
callback |
$callback: |
|
array |
$parameters: |
|
Clear any buffered debug output
void debug(
string
$msg
)
|
|
Output a debug message
Parameters:
void debug_r(
mixed
$object, [boolean
$escapeHtmlEntities = false]
)
|
|
Output a print_r style debug message
Parameters:
mixed |
$object: |
any object or value |
boolean |
$escapeHtmlEntities: |
true if the output should be run through htmlentities() |
boolean fastDownload(
string
$relativePath, string
$filename, string
$lastModified, string
$mimeType, int
$contentLength
)
|
|
Send a data file out to the browser as quickly as possible.
Parameters:
string |
$relativePath: |
the relative path to the file from the g2data/ directory |
string |
$filename: |
logical name of the file (used for the Content-Disposition header) |
string |
$lastModified: |
the last modified date string (used for the Last-Modified header) |
string |
$mimeType: |
the mime type (used for the Content-type header) |
int |
$contentLength: |
the size of the file (used for the Content-length header) |
API Tags:
Return: | true if we transferred the file successfully |
array getActiveLanguageCode(
)
|
|
Get the active language code.
API Tags:
Return: | GalleryStatus a status code string language code |
Get the active user.
Cache the results of the first call and return that same value each time.
API Tags:
Get the Id of the active user.
The active user is the user who is logged on in this session.
API Tags:
Return: | the id of the current user |
Get a value from the Gallery configuration settings
Parameters:
API Tags:
Return: | an arbitrary value |
Get the current view
API Tags:
Return: | the current view name |
Get the debug state
API Tags:
Get any buffered debug output
API Tags:
string getHttpDate(
[int
$time = '']
)
|
|
Return a date and time string that is conformant to RFC 2616
Parameters:
int |
$time: |
the unix timestamp of the date we want to return, empty if we want the current time |
API Tags:
Return: | a date-string conformant to the RFC 2616 |
See: | sec3.3 |
array &getLockSystem(
[boolean
$canInit = true]
)
|
|
Return the active lock system.
Parameters:
boolean |
$canInit: |
(optional) if false and lockSystem isn't yet initialized, return null |
API Tags:
Return: | GalleryStatus a status code GalleryLockSystem the lock implementation (reference) |
Return our PHP virtual machine abstraction
Get the Gallery platform object.
Return a reference to the unique Gallery platform object.
API Tags:
Return: | the Gallery platform object |
Get the Gallery session object.
Return a reference to the unique Gallery session object. Any changes made to this object will be saved in the session.
API Tags:
Return: | a session instance |
Return an instance of the GalleryStorage class
API Tags:
Return: | a storage instance |
Return the template adapter. There is only ever one in the system.
Return a reference to our GalleryTranslator instance
void guaranteeTimeLimit(
int
$limit
)
|
|
Guarantee that we have at least this many more seconds to work
After this function completes, we will be guaranteed of at least this much more time to work.
Parameters:
int |
$limit: |
a time interval in seconds, must be greater than 0 |
string i18n(
mixed
$value
)
|
|
Mark a string as being internationalized. This is a semaphore method; it does nothing but it allows us to easily identify strings that require translation. Generally this is used to mark strings that will be stored in the database (like module names and descriptions).
Consider this case: $message_to_be_localized = 'TEST to be displayed in different languages'; print $this->translate($message_to_be_localized);
The translate() method is called in the right place for runtime handling, but there is no message at gettext preprocessing time to be given to the translation teams, just a variable name. Translation of the variable name would break the code! So all places potentially feeding this variable have to be marked to be given to translation teams, but not translated at runtime!
This method resolves all such cases. Simply mark the candidates: $message_to_be_localized = $gallery->i18n('TEST to be displayed in different languages'); print $this->translate($message_to_be_localized);
Parameters:
mixed |
$value: |
string or array (array must have 'text' key; hint/cFormat keys optional) |
API Tags:
Return: | the text value |
See: | GalleryPlugin::translate |
Register shutdown function to release any hanging locks.
This used to be done in the constructor, but moved here to avoid php4 vs php5 issue ($gallery =& new Gallery() needed for php4, but this is deprecated in php5.3).
Initialize an empty session.
Initialize session.
API Tags:
GalleryStatus initTranslator(
[boolean
$dontUseDatabase = false]
)
|
|
Initialize our GalleryTranslator
Parameters:
boolean |
$dontUseDatabase: |
(optional) true if we should not use the database |
API Tags:
Check if Gallery is in embedded mode
API Tags:
Return: | true if Gallery is in embedded mode, false otherwise |
boolean isProfiling(
string
$type
)
|
|
Get the profiling state
Parameters:
string |
$type: |
profiling type |
boolean isStorageInitialized(
)
|
|
Check if GalleryStorage has been instantiated
void performShutdownActions(
)
|
|
Process registered shutdown actions.
void search(
$query, [
$data = array()], [
$options = array()]
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::search |
Set the active language code for this session.
Parameters:
string |
$language: |
language code |
API Tags:
Set the id of the active user. The active user is the user who is logged on in this session.
Parameters:
void setConfig(
string
$key, mixed
$value
)
|
|
Store a value in the Gallery config table
Parameters:
string |
$key: |
|
mixed |
$value: |
|
void setCurrentView(
string
$view
)
|
|
Set the current view
Parameters:
string |
$view: |
the view name |
void setDebug(
[mixed
$debug = false]
)
|
|
Change the debugging state
Parameters:
mixed |
$debug: |
one of 'buffered', 'logged', 'immediate' or false |
void setDebugLogFile(
string
$debugLogFile
)
|
|
Set the location of debugging output
Parameters:
string |
$debugLogFile: |
a filename |
Set the Gallery platform object.
Parameters:
void setProfile(
[mixed
$profile = array()]
)
|
|
Set the profiling state. Pass in an array containing the different kinds of things that you want to profile. Right now, we only do sql profiling so the only valid values are:
false <-- no profiling array() <-- no profiling array('sql') <-- SQL profiling
Parameters:
mixed |
$profile: |
array of profiling modes or boolean false |
Set the URL generator
Parameters:
void startRecordingDebugSnippet(
)
|
|
Start recording a debug snippet
string stopRecordingDebugSnippet(
)
|
|
Stop recording the debug snippet and return whatever got recorded.
API Tags:
Perform any necessary shutdown tasks.
This should only be invoked as a register_shutdown callback.
API Tags: