static array parseSqlTemplate(
array
$sqlData, string
$dbType
)
|
|
Parse the SQL template file and break it down by database and sql file type and return the results in an array. The best way to see how this is supposed to work is to look in the unit test.
Parameters:
array |
$sqlData: |
the raw template data |
string |
$dbType: |
the database type |
API Tags:
Return: | the parsed results |
GalleryStorageExtras GalleryStorageExtras(
&$galleryStorage, GalleryStorage
$galleryStorage
)
|
|
Parameters:
GalleryStorage |
$galleryStorage: |
the database storage instance |
|
&$galleryStorage: |
|
void acquireReadLock(
$entityIds,
$timeout
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::acquireReadLock |
void acquireWriteLock(
$entityIds,
$timeout
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::acquireWriteLock |
void addMapEntry(
$mapName,
$entry, [
$useNonTransactionalConnection = false]
)
|
|
Parameters:
|
$mapName: |
|
|
$entry: |
|
|
$useNonTransactionalConnection: |
|
API Tags:
See: | GalleryStorage::addMapEntry |
API Tags:
See: | GalleryStorage::cleanStore |
void configureStore(
$moduleId, [
$upgradeInfo = array()]
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::configureStore |
void configureStoreCleanup(
$moduleId
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::configureStoreCleanup |
GalleryStatus createSequence(
string
$sequenceId, [integer
$startId = 1]
)
|
|
Create a sequence.
Parameters:
string |
$sequenceId: |
Name of the sequence to create. |
integer |
$startId: |
(optional) The number to initialize the sequence to. (default 1) |
void deleteEntity(
&$entity
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::deleteEntity |
array describeEntity(
string
$entityName, [boolean
$tryAllModules = false]
)
|
|
Describe the members, modules and parent of an entity
Parameters:
string |
$entityName: |
a class name |
boolean |
$tryAllModules: |
true if we should scan all modules, not just the active ones |
API Tags:
Return: | GalleryStatus a status code entity associative array |
Access: | protected |
Drop a sequence.
Parameters:
string |
$sequenceId: |
Name of the sequence to drop. |
void execute(
$statement, [
$data = array()]
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::execute |
void executeSqlFile(
$fileName
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::executeSqlFile |
void getAffectedRows(
$useNonTransactionalConnection
)
|
|
Parameters:
|
$useNonTransactionalConnection: |
|
API Tags:
See: | GalleryStorage::getAffectedRows |
array getModuleSql(
string
$moduleId
)
|
|
Load up the table creation and alteration SQL files for the given module
Parameters:
string |
$moduleId: |
The id of the module of interest. |
API Tags:
Return: | ('table' => array(), 'alter' => array(), 'remove' => array(), 'test' => array()) |
API Tags:
See: | GalleryStorage::getProfilingHtml |
void getUniqueId(
[
$sequence = DATABASE_SEQUENCE_ID]
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::getUniqueId |
API Tags:
See: | GalleryStorage::isInstalled |
void loadEntities(
$ids
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::loadEntities |
void moveIdsBetweenLocks(
$relock,
$newLockId,
$lockType
)
|
|
Parameters:
|
$relock: |
|
|
$newLockId: |
|
|
$lockType: |
|
API Tags:
See: | GalleryStorage::moveIdsBetweenLocks |
void newEntity(
&$entity
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::newEntity |
API Tags:
See: | GalleryStorage::newLockId |
void optimize(
[
$tableNames = null]
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::optimize |
void refreshEntity(
$entity
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::refreshEntity |
void refreshLocks(
$lockIds,
$freshUntil
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::refreshLocks |
void releaseLocks(
$lockIds
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::releaseLocks |
void removeAllMapEntries(
$mapName, [
$useNonTransactionalConnection = false], [
$useTruncate = false]
)
|
|
Parameters:
|
$mapName: |
|
|
$useNonTransactionalConnection: |
|
|
$useTruncate: |
|
API Tags:
See: | GalleryStorage::removeAllMapEntries |
void removeIdsFromLock(
$lock,
$ids
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::removeIdsFromLock |
void removeMapEntry(
$mapName,
$match
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::removeMapEntry |
void saveEntity(
&$entity
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::saveEntity |
void unconfigureStore(
$moduleId
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::unconfigureStore |
void validateConnection(
)
|
|
API Tags:
See: | GalleryStorage::validateConnection |
GalleryStatus _addMapEntries(
array
$mapInfo, string
$tableName, array
$entry, ADOdb
$db
)
|
|
Add new entries to a map. This utility takes the values from entry array e.g., (parm1 => (p1val1, p1val2, p1val3), parm2 => (p2val1, p2val2, p2val3)) and inserts them into the map similar to the following: INSERT INTO ... (PARM1, PARM2) VALUES (p1val1, p2val1), (p1val2, p2val2) ...
Parameters:
array |
$mapInfo: |
map we're working on |
string |
$tableName: |
the translated table name |
array |
$entry: |
an associative array of data about the entry each data element is an array of values |
ADOdb |
$db: |
the database connection to use |
API Tags:
Return: | a status code |
Access: | private |
void _clearEntityAndMapCache(
)
|
|
Clear out the entity and map caches, which we should do any time we add or remove a table.
Connect to database if needed and optionally guarantee db transaction.
Parameters:
API Tags:
Return: | a status code |
Access: | private |
Execute a given SQL against the database. Prefix table and column names as necessary. Split multiple commands in the file into separate Execute() calls.
Parameters:
API Tags:
Return: | a status code |
Access: | protected |
Delete all not-so-fresh locks.
API Tags:
Return: | a status code |
Access: | private |
Internal function to get clearance to acquire locks
Request clearance to acquire locks and then wait until it's our turn.
Parameters:
int |
$cutoffTime: |
the time to stop trying to get clearance |
API Tags:
array _getNonTransactionalDatabaseConnection(
)
|
|
Return a non transactional database connection.
On occasion we'll need a non-transactional connection to do things like locking and sequence handling, since they have to be consistent across may concurrent requests.
API Tags:
Return: | GalleryStatus a status code ADOdb a database connection |
array _getTableInfo(
string
$moduleId, string
$type
)
|
|
Load the Entities or Maps.inc file.
Parameters:
string |
$moduleId: |
The module for which to retrieve the table information for. |
string |
$type: |
String to describe the file to load. ('map' | 'entity') |
API Tags:
Return: | An array describing either the maps or entities for the module |
Access: | private |
void _getUniqueIdWithConnection(
$dbConn, string
$sequence
)
|
|
Internal implementation of GalleryStorage::getUniqueId that additionally takes a database connection.
Parameters:
string |
$sequence: |
A sequence name |
|
$dbConn: |
|
API Tags:
See: | GalleryStorage::getUniqueId |
array _identifyEntities(
mixed
$ids
)
|
|
Identify the type of entity associated with the id provided
Parameters:
mixed |
$ids: |
array of ids or single int id |
API Tags:
Return: | a GalleryStatus and a string class name |
void _loadTableVersions(
[
$ignoreCache = true]
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::getTableVersions |
Get a list of all database tables (not limited to our table-prefix)
API Tags:
Return: | GalleryStatus array of table names in lower-case |
GalleryStatus _updateSchemaTableInfo(
string
$tableNameInSchema, string
$tableSql, string
$moduleId, [string
$type = null], [string
$info = null], [bool
$canStoreTableInfo = true]
)
|
|
Convenience function to update the Schema table with the creation SQL for a table.
Parameters:
string |
$tableNameInSchema: |
The name of the table in the schema. |
string |
$tableSql: |
The sql that is used to create the table. |
string |
$moduleId: |
|
string |
$type: |
(optional) An indicator for table type ('map' | 'entity'). |
string |
$info: |
The serialized description of the map or entity. |
bool |
$canStoreTableInfo: |
(optional) |
void _updateTableInfo(
$moduleId
)
|
|
Parameters:
API Tags:
See: | GalleryStorage::updateTableInfo |