ZenMagick 0.9.6


org.zenmagick.database.ZMDbUtils

Class ZMDbUtils

ZMDbUtils

public class ZMDbUtils

SQL/database utils.

Author:
DerManoMann
Version:
$Id: ZMDbUtils.php 2165 2009-04-17 03:07:43Z dermanomann $

Method Summary
static boolean

executePatch(string sql, mixed messages, mixed debug, array Result, boolean Debug)

Execute a SQL patch.

private static array

processPatchResults(mixed results, array The)

Process SQL patch messages.

static string

resolveSQLFilename(string filename)

Resolve a given SQL file name.

Method Detail

executePatch

public static boolean executePatch(string sql, mixed messages, mixed debug, array Result, boolean Debug)

Execute a SQL patch.

NOTE: This functionallity is only available in the context of the ZenMagick installation or plugins page.

Parameters:
sql - The sql.
Result - message list.
Debug - flag.
Returns:
true for success, false if the execution fails.

processPatchResults

private static array processPatchResults(mixed results, array The)

Process SQL patch messages.

Parameters:
The - execution results.
Returns:
The results converted to messages.

resolveSQLFilename

public static string resolveSQLFilename(string filename)

Resolve a given SQL file name.

This will try to find the most specific available file for the configured database type.

Filenames are expected in the format [name]-[driver].sql if driver specific SQL is required. If no specific file is found, the default [name].sql will is tried. If that is also not found, null will be returned.

Parameters:
filename - The filename.
Returns:
The most specific filename or null.

ZenMagick 0.9.6