Update website
This commit is contained in:
parent
4413528994
commit
1d90fbf296
6865 changed files with 1091082 additions and 0 deletions
33
admin/phpMyAdmin/libraries/classes/Twig/AssetExtension.php
Normal file
33
admin/phpMyAdmin/libraries/classes/Twig/AssetExtension.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\Theme;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
final class AssetExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new TwigFunction('image', [$this, 'getImagePath']),
|
||||
];
|
||||
}
|
||||
|
||||
public function getImagePath(?string $filename = null, ?string $fallback = null): string
|
||||
{
|
||||
global $theme;
|
||||
|
||||
if (! $theme instanceof Theme) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $theme->getImgPath($filename, $fallback);
|
||||
}
|
||||
}
|
27
admin/phpMyAdmin/libraries/classes/Twig/CoreExtension.php
Normal file
27
admin/phpMyAdmin/libraries/classes/Twig/CoreExtension.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\Core;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFilter;
|
||||
|
||||
class CoreExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of filters to add to the existing list.
|
||||
*
|
||||
* @return TwigFilter[]
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
return [
|
||||
new TwigFilter(
|
||||
'link',
|
||||
[Core::class, 'linkURL']
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\FlashMessages;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
final class FlashMessagesExtension extends AbstractExtension
|
||||
{
|
||||
/** @return TwigFunction[] */
|
||||
public function getFunctions(): array
|
||||
{
|
||||
return [new TwigFunction('flash', [FlashMessages::class, 'getMessages'])];
|
||||
}
|
||||
}
|
31
admin/phpMyAdmin/libraries/classes/Twig/I18nExtension.php
Normal file
31
admin/phpMyAdmin/libraries/classes/Twig/I18nExtension.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\Twig\Extensions\I18nExtension as TwigI18nExtension;
|
||||
use PhpMyAdmin\Twig\Extensions\Node\TransNode;
|
||||
use Twig\TwigFilter;
|
||||
|
||||
class I18nExtension extends TwigI18nExtension
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
TransNode::$notesLabel = '// l10n: ';
|
||||
TransNode::$enableMoTranslator = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of filters to add to the existing list.
|
||||
*
|
||||
* @return TwigFilter[]
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
return [
|
||||
// This is just a performance override
|
||||
new TwigFilter('trans', '_gettext'),
|
||||
];
|
||||
}
|
||||
}
|
44
admin/phpMyAdmin/libraries/classes/Twig/MessageExtension.php
Normal file
44
admin/phpMyAdmin/libraries/classes/Twig/MessageExtension.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\Message;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFilter;
|
||||
|
||||
class MessageExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of filters to add to the existing list.
|
||||
*
|
||||
* @return TwigFilter[]
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
return [
|
||||
new TwigFilter(
|
||||
'notice',
|
||||
static function (string $string) {
|
||||
return Message::notice($string)->getDisplay();
|
||||
},
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFilter(
|
||||
'error',
|
||||
static function (string $string) {
|
||||
return Message::error($string)->getDisplay();
|
||||
},
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFilter(
|
||||
'raw_success',
|
||||
static function (string $string) {
|
||||
return Message::rawSuccess($string)->getDisplay();
|
||||
},
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\ConfigStorage\Relation;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
class RelationExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
global $dbi;
|
||||
|
||||
$relation = new Relation($dbi);
|
||||
|
||||
return [
|
||||
new TwigFunction(
|
||||
'foreign_dropdown',
|
||||
[$relation, 'foreignDropdown'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_display_field',
|
||||
[$relation, 'getDisplayField'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_foreign_data',
|
||||
[$relation, 'getForeignData']
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_tables',
|
||||
[$relation, 'getTables']
|
||||
),
|
||||
new TwigFunction(
|
||||
'search_column_in_foreigners',
|
||||
[$relation, 'searchColumnInForeigners']
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\Sanitize;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFilter;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
class SanitizeExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of filters to add to the existing list.
|
||||
*
|
||||
* @return TwigFilter[]
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
return [
|
||||
new TwigFilter(
|
||||
'escape_js_string',
|
||||
[Sanitize::class, 'escapeJsString'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFilter(
|
||||
'js_format',
|
||||
[Sanitize::class, 'jsFormat'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFilter(
|
||||
'sanitize',
|
||||
[Sanitize::class, 'sanitizeMessage'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new TwigFunction(
|
||||
'get_js_value',
|
||||
[Sanitize::class, 'getJsValue'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
27
admin/phpMyAdmin/libraries/classes/Twig/TableExtension.php
Normal file
27
admin/phpMyAdmin/libraries/classes/Twig/TableExtension.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\Table;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
class TableExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new TwigFunction(
|
||||
'table_get',
|
||||
[Table::class, 'get']
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
27
admin/phpMyAdmin/libraries/classes/Twig/TrackerExtension.php
Normal file
27
admin/phpMyAdmin/libraries/classes/Twig/TrackerExtension.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\Tracker;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
class TrackerExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new TwigFunction(
|
||||
'get_tracker_version',
|
||||
[Tracker::class, 'getVersion']
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\Transformations;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
class TransformationsExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
$transformations = new Transformations();
|
||||
|
||||
return [
|
||||
new TwigFunction(
|
||||
'get_description',
|
||||
[$transformations, 'getDescription']
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_name',
|
||||
[$transformations, 'getName']
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
48
admin/phpMyAdmin/libraries/classes/Twig/UrlExtension.php
Normal file
48
admin/phpMyAdmin/libraries/classes/Twig/UrlExtension.php
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\Url;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
class UrlExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new TwigFunction(
|
||||
'get_hidden_inputs',
|
||||
[Url::class, 'getHiddenInputs'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_hidden_fields',
|
||||
[Url::class, 'getHiddenFields'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_common',
|
||||
[Url::class, 'getCommon'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_common_raw',
|
||||
[Url::class, 'getCommonRaw'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'url',
|
||||
[Url::class, 'getFromRoute'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
171
admin/phpMyAdmin/libraries/classes/Twig/UtilExtension.php
Normal file
171
admin/phpMyAdmin/libraries/classes/Twig/UtilExtension.php
Normal file
|
@ -0,0 +1,171 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\Html\Generator;
|
||||
use PhpMyAdmin\Html\MySQLDocumentation;
|
||||
use PhpMyAdmin\Util;
|
||||
use PhpMyAdmin\Utils\ForeignKey;
|
||||
use PhpMyAdmin\Utils\Gis;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFilter;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
class UtilExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new TwigFunction(
|
||||
'backquote',
|
||||
[Util::class, 'backquote']
|
||||
),
|
||||
new TwigFunction(
|
||||
'extract_column_spec',
|
||||
[Util::class, 'extractColumnSpec']
|
||||
),
|
||||
new TwigFunction(
|
||||
'format_byte_down',
|
||||
[Util::class, 'formatByteDown']
|
||||
),
|
||||
new TwigFunction(
|
||||
'format_number',
|
||||
[Util::class, 'formatNumber']
|
||||
),
|
||||
new TwigFunction(
|
||||
'format_sql',
|
||||
[Generator::class, 'formatSql'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_docu_link',
|
||||
[MySQLDocumentation::class, 'getDocumentationLink'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_list_navigator',
|
||||
[Generator::class, 'getListNavigator'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'show_docu',
|
||||
[MySQLDocumentation::class, 'showDocumentation'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_gis_datatypes',
|
||||
[Gis::class, 'getDataTypes']
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_gis_functions',
|
||||
[Gis::class, 'getFunctions']
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_icon',
|
||||
[Generator::class, 'getIcon'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_image',
|
||||
[Generator::class, 'getImage'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_supported_datatypes',
|
||||
[Util::class, 'getSupportedDatatypes'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'is_uuid_supported',
|
||||
[Util::class, 'isUUIDSupported']
|
||||
),
|
||||
new TwigFunction(
|
||||
'is_foreign_key_supported',
|
||||
[ForeignKey::class, 'isSupported']
|
||||
),
|
||||
new TwigFunction(
|
||||
'link_or_button',
|
||||
[Generator::class, 'linkOrButton'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'link_to_var_documentation',
|
||||
[Generator::class, 'linkToVarDocumentation'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'localised_date',
|
||||
[Util::class, 'localisedDate']
|
||||
),
|
||||
new TwigFunction(
|
||||
'show_hint',
|
||||
[Generator::class, 'showHint'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'show_icons',
|
||||
[Util::class, 'showIcons']
|
||||
),
|
||||
new TwigFunction(
|
||||
'show_text',
|
||||
[Util::class, 'showText']
|
||||
),
|
||||
new TwigFunction(
|
||||
'show_mysql_docu',
|
||||
[MySQLDocumentation::class, 'show'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_mysql_docu_url',
|
||||
[Util::class, 'getMySQLDocuURL'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'get_docu_url',
|
||||
[Util::class, 'getdocuURL'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'show_php_docu',
|
||||
[Generator::class, 'showPHPDocumentation'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'sortable_table_header',
|
||||
[Util::class, 'sortableTableHeader'],
|
||||
['is_safe' => ['html']]
|
||||
),
|
||||
new TwigFunction(
|
||||
'timespan_format',
|
||||
[Util::class, 'timespanFormat']
|
||||
),
|
||||
new TwigFunction('parse_enum_set_values', 'PhpMyAdmin\Util::parseEnumSetValues'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of filters to add to the existing list.
|
||||
*
|
||||
* @return TwigFilter[]
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
return [
|
||||
new TwigFilter(
|
||||
'convert_bit_default_value',
|
||||
[Util::class, 'convertBitDefaultValue']
|
||||
),
|
||||
new TwigFilter(
|
||||
'escape_mysql_wildcards',
|
||||
[Util::class, 'escapeMysqlWildcards']
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue