Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
ac1211fc67
@ -51,8 +51,8 @@
|
||||
"phpseclib/phpseclib": "^2.0",
|
||||
"google/recaptcha": "^1.1",
|
||||
"psr/container": "^1.0",
|
||||
"twig/twig": "^1.32",
|
||||
"twig/extensions": "~1.4.1",
|
||||
"twig/twig": "^1.34",
|
||||
"twig/extensions": "~1.5.1",
|
||||
"symfony/expression-language": "^3.2 || ^2.8",
|
||||
"symfony/polyfill-mbstring": "^1.3"
|
||||
},
|
||||
|
||||
@ -23,8 +23,8 @@ use PhpMyAdmin\Twig\TableExtension;
|
||||
use PhpMyAdmin\Twig\TransformationsExtension;
|
||||
use PhpMyAdmin\Twig\UrlExtension;
|
||||
use PhpMyAdmin\Twig\UtilExtension;
|
||||
use Twig_Environment;
|
||||
use Twig_Loader_Filesystem;
|
||||
use Twig\Environment;
|
||||
use Twig\Loader\FilesystemLoader;
|
||||
|
||||
/**
|
||||
* Class Template
|
||||
@ -57,13 +57,13 @@ class Template
|
||||
$this->name = $name;
|
||||
|
||||
if (is_null($this::$twig)) {
|
||||
$loader = new Twig_Loader_Filesystem(static::BASE_PATH);
|
||||
$loader = new FilesystemLoader(static::BASE_PATH);
|
||||
$cache_dir = $GLOBALS['PMA_Config']->getTempDir('twig');
|
||||
/* Twig expects false when cache is not configured */
|
||||
if (is_null($cache_dir)) {
|
||||
$cache_dir = false;
|
||||
}
|
||||
$twig = new Twig_Environment($loader, array(
|
||||
$twig = new Environment($loader, array(
|
||||
'auto_reload' => true,
|
||||
'cache' => $cache_dir,
|
||||
'debug' => false,
|
||||
|
||||
@ -7,34 +7,34 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class CharsetsExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class CharsetsExtension extends Twig_Extension
|
||||
class CharsetsExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Charsets_getCollationDescr',
|
||||
'PhpMyAdmin\Charsets::getCollationDescr'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Charsets_getCharsetDropdownBox',
|
||||
'PhpMyAdmin\Charsets::getCharsetDropdownBox',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Charsets_getCollationDropdownBox',
|
||||
'PhpMyAdmin\Charsets::getCollationDropdownBox',
|
||||
array('is_safe' => array('html'))
|
||||
|
||||
@ -7,25 +7,25 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class CoreExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class CoreExtension extends Twig_Extension
|
||||
class CoreExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Core_mimeDefaultFunction',
|
||||
'PhpMyAdmin\Core::mimeDefaultFunction',
|
||||
array('is_safe' => array('html'))
|
||||
|
||||
@ -7,17 +7,17 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig\I18n;
|
||||
|
||||
use Twig_Compiler;
|
||||
use Twig_Extensions_Node_Trans;
|
||||
use Twig_Node;
|
||||
use Twig_Node_Expression;
|
||||
use Twig\Compiler;
|
||||
use Twig\Extensions\Node\TransNode;
|
||||
use Twig\Node\Node;
|
||||
use Twig\Node\Expression\AbstractExpression;
|
||||
|
||||
/**
|
||||
* Class NodeTrans
|
||||
*
|
||||
* @package PhpMyAdmin\Twig\I18n
|
||||
*/
|
||||
class NodeTrans extends Twig_Extensions_Node_Trans
|
||||
class NodeTrans extends TransNode
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
@ -25,20 +25,20 @@ class NodeTrans extends Twig_Extensions_Node_Trans
|
||||
* The nodes are automatically made available as properties ($this->node).
|
||||
* The attributes are automatically made available as array items ($this['name']).
|
||||
*
|
||||
* @param Twig_Node $body Body of node trans
|
||||
* @param Twig_Node $plural Node plural
|
||||
* @param Twig_Node_Expression $count Node count
|
||||
* @param Twig_Node $context Node context
|
||||
* @param Twig_Node $notes Node notes
|
||||
* @param int $lineno The line number
|
||||
* @param string $tag The tag name associated with the Node
|
||||
* @param Node $body Body of node trans
|
||||
* @param Node $plural Node plural
|
||||
* @param AbstractExpression $count Node count
|
||||
* @param Node $context Node context
|
||||
* @param Node $notes Node notes
|
||||
* @param int $lineno The line number
|
||||
* @param string $tag The tag name associated with the Node
|
||||
*/
|
||||
public function __construct(
|
||||
Twig_Node $body,
|
||||
Twig_Node $plural = null,
|
||||
Twig_Node_Expression $count = null,
|
||||
Twig_Node $context = null,
|
||||
Twig_Node $notes = null,
|
||||
Node $body,
|
||||
Node $plural = null,
|
||||
AbstractExpression $count = null,
|
||||
Node $context = null,
|
||||
Node $notes = null,
|
||||
$lineno,
|
||||
$tag = null
|
||||
) {
|
||||
@ -56,17 +56,17 @@ class NodeTrans extends Twig_Extensions_Node_Trans
|
||||
$nodes['notes'] = $notes;
|
||||
}
|
||||
|
||||
Twig_Node::__construct($nodes, array(), $lineno, $tag);
|
||||
Node::__construct($nodes, array(), $lineno, $tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles the node to PHP.
|
||||
*
|
||||
* @param Twig_Compiler $compiler Node compiler
|
||||
* @param Compiler $compiler Node compiler
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function compile(Twig_Compiler $compiler)
|
||||
public function compile(Compiler $compiler)
|
||||
{
|
||||
$compiler->addDebugInfo($this);
|
||||
|
||||
|
||||
@ -7,26 +7,26 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig\I18n;
|
||||
|
||||
use Twig_Extensions_TokenParser_Trans;
|
||||
use Twig_Token;
|
||||
use Twig\Extensions\TokenParser\TransTokenParser;
|
||||
use Twig\Token;
|
||||
|
||||
/**
|
||||
* Class TokenParserTrans
|
||||
*
|
||||
* @package PhpMyAdmin\Twig\I18n
|
||||
*/
|
||||
class TokenParserTrans extends Twig_Extensions_TokenParser_Trans
|
||||
class TokenParserTrans extends TransTokenParser
|
||||
{
|
||||
/**
|
||||
* Parses a token and returns a node.
|
||||
*
|
||||
* @param Twig_Token $token Twig token to parse
|
||||
* @param Token $token Twig token to parse
|
||||
*
|
||||
* @return Twig_NodeInterface
|
||||
*
|
||||
* @throws Twig_Error_Syntax
|
||||
* @throws \Twig\Error\SyntaxError
|
||||
*/
|
||||
public function parse(Twig_Token $token)
|
||||
public function parse(Token $token)
|
||||
{
|
||||
$lineno = $token->getLine();
|
||||
$stream = $this->parser->getStream();
|
||||
@ -35,32 +35,32 @@ class TokenParserTrans extends Twig_Extensions_TokenParser_Trans
|
||||
$notes = null;
|
||||
$context = null;
|
||||
|
||||
if (!$stream->test(Twig_Token::BLOCK_END_TYPE)) {
|
||||
if (!$stream->test(Token::BLOCK_END_TYPE)) {
|
||||
$body = $this->parser->getExpressionParser()->parseExpression();
|
||||
} else {
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
$body = $this->parser->subparse(array($this, 'decideForFork'));
|
||||
$next = $stream->next()->getValue();
|
||||
|
||||
if ('plural' === $next) {
|
||||
$count = $this->parser->getExpressionParser()->parseExpression();
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
$plural = $this->parser->subparse(array($this, 'decideForFork'));
|
||||
|
||||
if ('notes' === $stream->next()->getValue()) {
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
$notes = $this->parser->subparse(array($this, 'decideForEnd'), true);
|
||||
}
|
||||
} elseif ('context' === $next) {
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
$context = $this->parser->subparse(array($this, 'decideForEnd'), true);
|
||||
} elseif ('notes' === $next) {
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
$notes = $this->parser->subparse(array($this, 'decideForEnd'), true);
|
||||
}
|
||||
}
|
||||
|
||||
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
|
||||
$this->checkTransString($body, $lineno);
|
||||
|
||||
@ -70,11 +70,11 @@ class TokenParserTrans extends Twig_Extensions_TokenParser_Trans
|
||||
/**
|
||||
* Tests the current token for a type.
|
||||
*
|
||||
* @param Twig_Token $token Twig token to test
|
||||
* @param Token $token Twig token to test
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function decideForFork(Twig_Token $token)
|
||||
public function decideForFork(Token $token)
|
||||
{
|
||||
return $token->test(array('plural', 'context', 'notes', 'endtrans'));
|
||||
}
|
||||
|
||||
@ -8,20 +8,20 @@
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use PhpMyAdmin\Twig\I18n\TokenParserTrans;
|
||||
use Twig_Extensions_Extension_I18n;
|
||||
use Twig_SimpleFilter;
|
||||
use Twig\Extensions\I18nExtension as TwigI18nExtension;
|
||||
use Twig\TwigFilter;
|
||||
|
||||
/**
|
||||
* Class I18nExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class I18nExtension extends Twig_Extensions_Extension_I18n
|
||||
class I18nExtension extends TwigI18nExtension
|
||||
{
|
||||
/**
|
||||
* Returns the token parser instances to add to the existing list.
|
||||
*
|
||||
* @return Twig_TokenParserInterface[]
|
||||
* @return \Twig\TokenParser\TokenParserInterface[]
|
||||
*/
|
||||
public function getTokenParsers()
|
||||
{
|
||||
@ -31,12 +31,12 @@ class I18nExtension extends Twig_Extensions_Extension_I18n
|
||||
/**
|
||||
* Returns a list of filters to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFilter[]
|
||||
* @return TwigFilter[]
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFilter('trans', '_gettext'),
|
||||
new TwigFilter('trans', '_gettext'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,25 +7,25 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class IndexExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class IndexExtension extends Twig_Extension
|
||||
class IndexExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Index_getHtmlForDisplayIndexes',
|
||||
'PhpMyAdmin\Index::getHtmlForDisplayIndexes',
|
||||
array('is_safe' => array('html'))
|
||||
|
||||
@ -7,33 +7,33 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use PhpMyAdmin\Message;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class MessageExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class MessageExtension extends Twig_Extension
|
||||
class MessageExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Message_notice',
|
||||
function ($string) {
|
||||
return Message::notice($string)->getDisplay();
|
||||
},
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Message_error',
|
||||
function ($string) {
|
||||
return Message::error($string)->getDisplay();
|
||||
|
||||
@ -7,25 +7,25 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class PartitionExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class PartitionExtension extends Twig_Extension
|
||||
class PartitionExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Partition_getPartitions',
|
||||
'PhpMyAdmin\Partition::getPartitions',
|
||||
array('is_safe' => array('html'))
|
||||
|
||||
@ -7,33 +7,33 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class PhpFunctionsExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class PhpFunctionsExtension extends Twig_Extension
|
||||
class PhpFunctionsExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction('array_search', 'array_search'),
|
||||
new Twig_SimpleFunction('bin2hex', 'bin2hex'),
|
||||
new Twig_SimpleFunction('htmlentities', 'htmlentities'),
|
||||
new Twig_SimpleFunction('md5', 'md5'),
|
||||
new Twig_SimpleFunction('preg_quote', 'preg_quote'),
|
||||
new Twig_SimpleFunction('preg_replace', 'preg_replace'),
|
||||
new Twig_SimpleFunction('strpos', 'strpos'),
|
||||
new Twig_SimpleFunction('strstr', 'strstr'),
|
||||
new Twig_SimpleFunction('strtotime', 'strtotime'),
|
||||
new TwigFunction('array_search', 'array_search'),
|
||||
new TwigFunction('bin2hex', 'bin2hex'),
|
||||
new TwigFunction('htmlentities', 'htmlentities'),
|
||||
new TwigFunction('md5', 'md5'),
|
||||
new TwigFunction('preg_quote', 'preg_quote'),
|
||||
new TwigFunction('preg_replace', 'preg_replace'),
|
||||
new TwigFunction('strpos', 'strpos'),
|
||||
new TwigFunction('strstr', 'strstr'),
|
||||
new TwigFunction('strtotime', 'strtotime'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,40 +7,40 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class PluginsExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class PluginsExtension extends Twig_Extension
|
||||
class PluginsExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Plugins_checkboxCheck',
|
||||
'PhpMyAdmin\Plugins::checkboxCheck',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Plugins_getChoice',
|
||||
'PhpMyAdmin\Plugins::getChoice',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Plugins_getDefault',
|
||||
'PhpMyAdmin\Plugins::getDefault',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Plugins_getOptions',
|
||||
'PhpMyAdmin\Plugins::getOptions',
|
||||
array('is_safe' => array('html'))
|
||||
|
||||
@ -7,43 +7,43 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class RelationExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class RelationExtension extends Twig_Extension
|
||||
class RelationExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Relation_foreignDropdown',
|
||||
'PhpMyAdmin\Relation::foreignDropdown',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Relation_getDisplayField',
|
||||
'PhpMyAdmin\Relation::getDisplayField',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Relation_getForeignData',
|
||||
'PhpMyAdmin\Relation::getForeignData'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Relation_getTables',
|
||||
'PhpMyAdmin\Relation::getTables'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Relation_searchColumnInForeigners',
|
||||
'PhpMyAdmin\Relation::searchColumnInForeigners'
|
||||
),
|
||||
|
||||
@ -7,35 +7,35 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class SanitizeExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class SanitizeExtension extends Twig_Extension
|
||||
class SanitizeExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Sanitize_escapeJsString',
|
||||
'PhpMyAdmin\Sanitize::escapeJsString',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Sanitize_jsFormat',
|
||||
'PhpMyAdmin\Sanitize::jsFormat',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Sanitize_sanitize',
|
||||
'PhpMyAdmin\Sanitize::sanitize',
|
||||
array('is_safe' => array('html'))
|
||||
|
||||
@ -7,25 +7,25 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class ServerPrivilegesExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class ServerPrivilegesExtension extends Twig_Extension
|
||||
class ServerPrivilegesExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'ServerPrivileges_formatPrivilege',
|
||||
'PhpMyAdmin\Server\Privileges::formatPrivilege',
|
||||
array('is_safe' => array('html'))
|
||||
|
||||
@ -7,25 +7,25 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class StorageEngineExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class StorageEngineExtension extends Twig_Extension
|
||||
class StorageEngineExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'StorageEngine_getHtmlSelect',
|
||||
'PhpMyAdmin\StorageEngine::getHtmlSelect',
|
||||
array('is_safe' => array('html'))
|
||||
|
||||
@ -7,25 +7,25 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class TableExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class TableExtension extends Twig_Extension
|
||||
class TableExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Table_get',
|
||||
'PhpMyAdmin\Table::get'
|
||||
),
|
||||
|
||||
@ -7,29 +7,29 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class TransformationsExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class TransformationsExtension extends Twig_Extension
|
||||
class TransformationsExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Transformations_getDescription',
|
||||
'PhpMyAdmin\Transformations::getDescription'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Transformations_getName',
|
||||
'PhpMyAdmin\Transformations::getName'
|
||||
),
|
||||
|
||||
@ -7,45 +7,45 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class UrlExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class UrlExtension extends Twig_Extension
|
||||
class UrlExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Url_getHiddenInputs',
|
||||
'PhpMyAdmin\Url::getHiddenInputs',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Url_getHiddenFields',
|
||||
'PhpMyAdmin\Url::getHiddenFields',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Url_getCommon',
|
||||
'PhpMyAdmin\Url::getCommon',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Url_getCommonRaw',
|
||||
'PhpMyAdmin\Url::getCommonRaw',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Url_link',
|
||||
'PhpMyAdmin\Core::linkURL'
|
||||
),
|
||||
|
||||
@ -7,179 +7,179 @@
|
||||
*/
|
||||
namespace PhpMyAdmin\Twig;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Class UtilExtension
|
||||
*
|
||||
* @package PhpMyAdmin\Twig
|
||||
*/
|
||||
class UtilExtension extends Twig_Extension
|
||||
class UtilExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return Twig_SimpleFunction[]
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_backquote',
|
||||
'PhpMyAdmin\Util::backquote'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getBrowseUploadFileBlock',
|
||||
'PhpMyAdmin\Util::getBrowseUploadFileBlock',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_convertBitDefaultValue',
|
||||
'PhpMyAdmin\Util::convertBitDefaultValue'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_escapeMysqlWildcards',
|
||||
'PhpMyAdmin\Util::escapeMysqlWildcards'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_extractColumnSpec',
|
||||
'PhpMyAdmin\Util::extractColumnSpec'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_formatByteDown',
|
||||
'PhpMyAdmin\Util::formatByteDown'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_formatNumber',
|
||||
'PhpMyAdmin\Util::formatNumber'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_formatSql',
|
||||
'PhpMyAdmin\Util::formatSql',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getButtonOrImage',
|
||||
'PhpMyAdmin\Util::getButtonOrImage',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getClassForType',
|
||||
'PhpMyAdmin\Util::getClassForType',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getDivForSliderEffect',
|
||||
'PhpMyAdmin\Util::getDivForSliderEffect',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getDocuLink',
|
||||
'PhpMyAdmin\Util::getDocuLink',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getListNavigator',
|
||||
'PhpMyAdmin\Util::getListNavigator',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_showDocu',
|
||||
'PhpMyAdmin\Util::showDocu',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getDropdown',
|
||||
'PhpMyAdmin\Util::getDropdown',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getFKCheckbox',
|
||||
'PhpMyAdmin\Util::getFKCheckbox',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getGISDatatypes',
|
||||
'PhpMyAdmin\Util::getGISDatatypes'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getGISFunctions',
|
||||
'PhpMyAdmin\Util::getGISFunctions'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getHtmlTab',
|
||||
'PhpMyAdmin\Util::getHtmlTab',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getIcon',
|
||||
'PhpMyAdmin\Util::getIcon',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getImage',
|
||||
'PhpMyAdmin\Util::getImage',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getRadioFields',
|
||||
'PhpMyAdmin\Util::getRadioFields',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getSelectUploadFileBlock',
|
||||
'PhpMyAdmin\Util::getSelectUploadFileBlock',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getScriptNameForOption',
|
||||
'PhpMyAdmin\Util::getScriptNameForOption',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getStartAndNumberOfRowsPanel',
|
||||
'PhpMyAdmin\Util::getStartAndNumberOfRowsPanel',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_getSupportedDatatypes',
|
||||
'PhpMyAdmin\Util::getSupportedDatatypes',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_isForeignKeySupported',
|
||||
'PhpMyAdmin\Util::isForeignKeySupported'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_linkOrButton',
|
||||
'PhpMyAdmin\Util::linkOrButton',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_localisedDate',
|
||||
'PhpMyAdmin\Util::localisedDate'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_showHint',
|
||||
'PhpMyAdmin\Util::showHint',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_showDocu',
|
||||
'PhpMyAdmin\Util::showDocu',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_showIcons',
|
||||
'PhpMyAdmin\Util::showIcons'
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_showMySQLDocu',
|
||||
'PhpMyAdmin\Util::showMySQLDocu',
|
||||
array('is_safe' => array('html'))
|
||||
),
|
||||
new Twig_SimpleFunction(
|
||||
new TwigFunction(
|
||||
'Util_sortableTableHeader',
|
||||
'PhpMyAdmin\Util::sortableTableHeader',
|
||||
array('is_safe' => array('html'))
|
||||
|
||||
@ -23,10 +23,10 @@ use PhpMyAdmin\Twig\UtilExtension;
|
||||
|
||||
$tplDir = dirname(__FILE__) . '/../templates';
|
||||
$tmpDir = dirname(__FILE__) . '/../twig-templates';
|
||||
$loader = new Twig_Loader_Filesystem($tplDir);
|
||||
$loader = new Twig\Loader\FilesystemLoader($tplDir);
|
||||
|
||||
// force auto-reload to always have the latest version of the template
|
||||
$twig = new Twig_Environment($loader, array(
|
||||
$twig = new Twig\Environment($loader, array(
|
||||
'cache' => $tmpDir,
|
||||
'auto_reload' => true
|
||||
));
|
||||
|
||||
@ -89,7 +89,7 @@ class TemplateTest extends PmaTestCase
|
||||
*/
|
||||
public function testRenderTemplateNotFound()
|
||||
{
|
||||
$this->setExpectedException('Twig_Error_Loader');
|
||||
$this->setExpectedException('Twig\Error\LoaderError');
|
||||
Template::get('template not found')->render();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user