ZenMagick 0.9.1


org.zenmagick.ZMRuntime

Class ZMRuntime

ZMObject
|
+--ZMRuntime

public class ZMRuntime
extends ZMObject

A central place for all runtime stuff.

This is kind of the application context.

Author:
mano
Version:
$Id: ZMRuntime.php 1145 2008-06-03 21:40:48Z DerManoMann $

Method Summary
static void

finish()

Finish execution.

static string

getContext()

The application context.

static ZMCurrency

getCurrency()

Get the current currency.

static queryFactory

getDB()

Get the database dao.

static ZMDatabase

getDatabase()

Get the database (provider).

static ZMLanguage

getDefaultLanguage()

Get the default language.

static long

getExecutionTime(string time)

Get the currently elapsed page execution time.

static ZMLanguage

getLanguage()

Get the language.

static string

getPluginsDir()

Return the directory containing all plugins.

static string

getScope()

Get the application scope.

static ZMTheme

getTheme()

Get the current theme.

static string

getThemeId()

Get the effective theme id.

static string

getThemesDir()

Return the directory containing all themes.

static string

getThemesPathPrefix()

Return the base path for theme URIs.

static string

getZMRootPath()

Get the full ZenMagick installation path.

static void

instance()

Get instance.

static void

setTheme(ZMTheme theme)

Set the current theme.

static void

setThemeId(string themeId)

Set the theme id.

Methods inherited from org.zenmagick.ZMObject
backtrace, create, log, singleton

Method Detail

finish

public static void finish()

Finish execution.

Calling this function will end all request handling in an ordered manner.

/


getContext

public static string getContext()

The application context.

Returns:
The application context.

getCurrency

public static ZMCurrency getCurrency()

Get the current currency.

Returns:
The current currency.

getDB

public static queryFactory getDB()

Get the database dao.

Returns:
*The* zen-cart queryFactory instance.

getDatabase

public static ZMDatabase getDatabase()

Get the database (provider).

Returns:
A ZMDatabase implementation.

getDefaultLanguage

public static ZMLanguage getDefaultLanguage()

Get the default language.

Returns:
The default language.

getExecutionTime

public static long getExecutionTime(string time)

Get the currently elapsed page execution time.

Parameters:
time - Optional execution timestamp to be used instead of the current time.
Returns:
The execution time in milliseconds.

getLanguage

public static ZMLanguage getLanguage()

Get the language.

Returns:
The current language.

getPluginsDir

public static string getPluginsDir()

Return the directory containing all plugins.

Returns:
The base directory for plugins.

getScope

public static string getScope()

Get the application scope.

Returns:
Either ZM_SCOPE_STORE or ZM_SCOPE_ADMIN.

getTheme

public static ZMTheme getTheme()

Get the current theme.

Returns:
The current theme.

getThemeId

public static string getThemeId()

Get the effective theme id.

Returns:
The currently effective theme id.

getThemesDir

public static string getThemesDir()

Return the directory containing all themes.

Returns:
The base directory for themes.

getThemesPathPrefix

public static string getThemesPathPrefix()

Return the base path for theme URIs.

Returns:
The URL path prefix for all themes.

getZMRootPath

public static string getZMRootPath()

Get the full ZenMagick installation path.

Returns:
The ZenMagick installation folder.

instance

public static void instance()

Get instance. /


setTheme

public static void setTheme(ZMTheme theme)

Set the current theme.

Parameters:
theme - The theme.

setThemeId

public static void setThemeId(string themeId)

Set the theme id.

This will overwrite the configured theme id.

Calling this method is quite expensive, as all theme specific stuff needs to be updated - this is not completely implemented yet.

Parameters:
themeId - The new theme id.

ZenMagick 0.9.1