mirror of
https://github.com/friendica/friendica
synced 2025-04-22 09:10:10 +00:00
Pad the header
This commit is contained in:
parent
4095e6c9be
commit
fd30df7300
73 changed files with 921 additions and 898 deletions
|
@ -166,8 +166,33 @@ class DBStructure
|
|||
|
||||
$tables = [];
|
||||
foreach (self::definition(null) as $name => $definition) {
|
||||
$fields = [];
|
||||
$lengths = [];
|
||||
$fields = [[
|
||||
'name' => 'Field',
|
||||
'comment' => 'Description',
|
||||
'type' => 'Type',
|
||||
'null' => 'Null',
|
||||
'primary' => 'Key',
|
||||
'default' => 'Default',
|
||||
'extra' => 'Extra',
|
||||
],
|
||||
[
|
||||
'name' => '-',
|
||||
'comment' => '-',
|
||||
'type' => '-',
|
||||
'null' => '-',
|
||||
'primary' => '-',
|
||||
'default' => '-',
|
||||
'extra' => '-',
|
||||
]];
|
||||
$lengths = [
|
||||
'name' => 5,
|
||||
'comment' => 11,
|
||||
'type' => 4,
|
||||
'null' => 4,
|
||||
'primary' => 3,
|
||||
'default' => 7,
|
||||
'extra' => 5,
|
||||
];
|
||||
foreach ($definition['fields'] as $key => $value) {
|
||||
$field = [];
|
||||
$field['name'] = $key;
|
||||
|
@ -186,9 +211,9 @@ class DBStructure
|
|||
|
||||
array_walk_recursive($fields, function(&$value, $key) use ($lengths)
|
||||
{
|
||||
$value = str_pad($value, $lengths[$key]);
|
||||
$value = str_pad($value, $lengths[$key], $value === '-' ? '-' : ' ');
|
||||
});
|
||||
|
||||
|
||||
$tables[] = ['name' => $name, 'comment' => $definition['comment']];
|
||||
$content = Renderer::replaceMacros(Renderer::getMarkupTemplate('structure.tpl'), [
|
||||
'$name' => $name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue