本文整理汇总了PHP中plugin::treatPluginTable方法的典型用法代码示例。如果您正苦于以下问题:PHP plugin::treatPluginTable方法的具体用法?PHP plugin::treatPluginTable怎么用?PHP plugin::treatPluginTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plugin
的用法示例。
在下文中一共展示了plugin::treatPluginTable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createPluginTable
function createPluginTable($pluginName) {
requireComponent('LZ.PHP.XMLStruct');
$xmls = new XMLStruct;
if (!$xmls->openFile(ROOT . '/plugins/'. $pluginName .'/index.xml'))
return '';
if ($xmls->doesExist('/plugin/storage')) {
foreach ($xmls->selectNodes('/plugin/storage/table') as $table) {
$storageMappings = array();
$storageKeymappings = array();
if(empty($table['name'][0]['.value'])) continue;
$tableName = htmlspecialchars($table['name'][0]['.value']);
if (!empty($table['fields'][0]['field'])) {
foreach($table['fields'][0]['field'] as $field)
{
if (!isset($field['name']))
continue; // Error? maybe loading fail, so skipping is needed.
$fieldName = $field['name'][0]['.value'];
if (!isset($field['attribute']))
continue; // Error? maybe loading fail, so skipping is needed.
$fieldAttribute = $field['attribute'][0]['.value'];
$fieldLength = isset($field['length']) ? $field['length'][0]['.value'] : -1;
$fieldIsNull = isset($field['isnull']) ? $field['isnull'][0]['.value'] : 1;
$fieldDefault = isset($field['default']) ? $field['default'][0]['.value'] : null;
$fieldAutoIncrement = isset($field['autoincrement']) ? $field['autoincrement'][0]['.value'] : 0;
array_push($storageMappings, array('name' => $fieldName, 'attribute' => $fieldAttribute, 'length' => $fieldLength, 'isnull' => $fieldIsNull, 'default' => $fieldDefault, 'autoincrement' => $fieldAutoIncrement));
}
}
if (!empty($table['key'][0]['.value'])) {
foreach($table['key'] as $key) {
array_push($storageKeymappings, $key['.value']);
}
}
plugin::treatPluginTable($pluginName, $tableName,$storageMappings,$storageKeymappings, $version);
unset($tableName);
unset($storageMappings);
unset($storageKeymappings);
}
}
}