ZenMagick 0.9.1


Functions


Function Summary
void

zm_backtrace(string msg)

Simple wrapper around debug_backtrace().

boolean

zm_dispatch()

Dispatch the current request.

boolean

zm_ends_with(string s, string end)

Check if the given string ends with the provided string.

void

zm_env()

Helper function to dump the ZenMagick environment.

void

zm_error_handler(int errno, string errstr, string errfile, int errline, array errcontext)

Custom error handler.

void

zm_exit()

Exit execution.

long

zm_get_elapsed_time()

Get the currently elapsed page execution time.

string

zm_globals()

Create a PHP directive for all global ZenMagick objects.

boolean

zm_is_empty(mixed value)

Check if a given value or array is empty.

boolean

zm_is_in_array(string value, mixed array)

Check if the given value exists in the array or comma separated list.

void

zm_log(string msg, int level)

Simple ZenMagick logging function.

boolean

zm_mkdir(string dir, int perms, boolean recursive)

Make dir.

void

zm_redirect(string url)

Redirect to the given url.

void

zm_resolve_zc_class(string clazz)

Resolve the given zen-cart class.

void

zm_rmdir(string dir, boolean recursive)

Remove a directory (tree).

mixed

zm_set_setting(string name, mixed value)

Set configuration value.

mixed

zm_setting(string name, mixed default)

Configuration lookup.

array

zm_settings()

Get all settings.

boolean

zm_starts_with(string s, string start)

Check if the given string starts with the provided string.

Function Detail

zm_backtrace

public void zm_backtrace(string msg)

Simple wrapper around debug_backtrace().

Parameters:
msg - If set, die with the provided message.
Deprecated:
Use ZMObject::backtrace() instead.

zm_dispatch

public boolean zm_dispatch()

Dispatch the current request.

Returns:
Always true.

zm_ends_with

public boolean zm_ends_with(string s, string end)

Check if the given string ends with the provided string.

Parameters:
s - The haystack.
end - The needle.
Returns:
true if $s ends with $start, * false if not.
Deprecated:
use ZMTools instead.

zm_env

public void zm_env()

Helper function to dump the ZenMagick environment.

Deprecated.

zm_error_handler

public void zm_error_handler(int errno, string errstr, string errfile, int errline, array errcontext)

Custom error handler.

Parameters:
errno - The error level.
errstr - The error message.
errfile - The source filename.
errline - The line number.
errcontext - All variables of scope when error triggered.

zm_exit

public void zm_exit()

Exit execution.

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

Deprecated:
use ZMRuntime instead.

zm_get_elapsed_time

public long zm_get_elapsed_time()

Get the currently elapsed page execution time.

Returns:
The execution time in milliseconds.
Deprecated:
Use ZMRuntime::getExecutionTime() instead.

zm_globals

public string zm_globals()

Create a PHP directive for all global ZenMagick objects.

This can be used as argument for eval(..) to make all ZenMagick globals available. Example: eval(zm_globals());.

Returns:
A valid PHP global directive including all ZenMagick globals.
Deprecated:
No replacement as globals are generally deprecated

zm_is_empty

public boolean zm_is_empty(mixed value)

Check if a given value or array is empty.

Parameters:
value - The value or array to check.
Returns:
true if the value is empty or null, false if not.
Deprecated:
use ZMTools instead.

zm_is_in_array

public boolean zm_is_in_array(string value, mixed array)

Check if the given value exists in the array or comma separated list.

Parameters:
value - The value to search for.
array - Either an array or a string containing a comma separated list.
Returns:
true if the given value exists in the array, false if not.
Deprecated:
use ZMTools instead.

zm_log

public void zm_log(string msg, int level)

Simple ZenMagick logging function.

Parameters:
msg - The message to log.
level - Optional level (default: ZM_LOG_INFO).
Deprecated:
Use ZMObject::log() instead.

zm_mkdir

public boolean zm_mkdir(string dir, int perms, boolean recursive)

Make dir.

Parameters:
dir - The folder name.
perms - The file permisssions; (default: 755)
recursive - Optional recursive flag; (default: true)
Returns:
true on success.
Deprecated:
use ZMTools instead.

zm_redirect

public void zm_redirect(string url)

Redirect to the given url.

This function wil also persist existing messages in the session in order to be able to display them after the redirect.

Parameters:
url - A fully qualified url.
Deprecated:
Use ZMRequest instead

zm_resolve_zc_class

public void zm_resolve_zc_class(string clazz)

Resolve the given zen-cart class.

This functuon ensures that the given class is loaded.

Parameters:
clazz - The class name.
Deprecated:
Use ZMLoader::resolveZCClass() instead.

zm_rmdir

public void zm_rmdir(string dir, boolean recursive)

Remove a directory (tree).

Parameters:
dir - The directory name.
recursive - Optional flag to enable/disable recursive deletion; (default is true)
Deprecated:
use ZMTools instead.

zm_set_setting

public mixed zm_set_setting(string name, mixed value)

Set configuration value.

Parameters:
name - The setting to check.
value - (New) value.
Returns:
The old setting value or null.
Deprecated:
Use ZMSettings::set() instead.

zm_setting

public mixed zm_setting(string name, mixed default)

Configuration lookup.

Parameters:
name - The setting to check.
default - Optional default value to be returned if setting not found; default is null.
Returns:
The setting value or null.
Deprecated:
Use ZMSettings::get() instead.

zm_settings

public array zm_settings()

Get all settings.

Returns:
Map of all settings.
Deprecated:
Use ZMSettings::getAll() instead.

zm_starts_with

public boolean zm_starts_with(string s, string start)

Check if the given string starts with the provided string.

Parameters:
s - The haystack.
start - The needle.
Returns:
true if $s starts with $start, * false if not.
Deprecated:
use ZMTools instead.

ZenMagick 0.9.1