OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
Xpress_backup
/
vendor
/
mtdowling
/
jmespath.php
/
src
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
01/06/2025 08:24:39 AM
rwxr-xr-x
📄
AstRuntime.php
1.47 KB
05/19/2025 10:07:18 AM
rw-r--r--
📄
CompilerRuntime.php
2.64 KB
05/19/2025 10:07:18 AM
rw-r--r--
📄
DebugRuntime.php
3.22 KB
05/19/2025 10:07:18 AM
rw-r--r--
📄
Env.php
2.51 KB
05/19/2025 10:07:18 AM
rw-r--r--
📄
FnDispatcher.php
12.58 KB
05/19/2025 10:07:18 AM
rw-r--r--
📄
JmesPath.php
390 bytes
05/19/2025 10:07:18 AM
rw-r--r--
📄
Lexer.php
15.34 KB
05/19/2025 10:07:18 AM
rw-r--r--
📄
Parser.php
14.4 KB
05/19/2025 10:07:18 AM
rw-r--r--
📄
SyntaxErrorException.php
1.16 KB
05/19/2025 10:07:18 AM
rw-r--r--
📄
TreeCompiler.php
13.2 KB
05/19/2025 10:07:18 AM
rw-r--r--
📄
TreeInterpreter.php
7.89 KB
05/19/2025 10:07:18 AM
rw-r--r--
📄
Utils.php
7.52 KB
05/19/2025 10:07:18 AM
rw-r--r--
Editing: AstRuntime.php
Close
<?php namespace JmesPath; /** * Uses an external tree visitor to interpret an AST. */ class AstRuntime { private $parser; private $interpreter; private $cache = []; private $cachedCount = 0; public function __construct( Parser $parser = null, callable $fnDispatcher = null ) { $fnDispatcher = $fnDispatcher ?: FnDispatcher::getInstance(); $this->interpreter = new TreeInterpreter($fnDispatcher); $this->parser = $parser ?: new Parser(); } /** * Returns data from the provided input that matches a given JMESPath * expression. * * @param string $expression JMESPath expression to evaluate * @param mixed $data Data to search. This data should be data that * is similar to data returned from json_decode * using associative arrays rather than objects. * * @return mixed Returns the matching data or null */ public function __invoke($expression, $data) { if (!isset($this->cache[$expression])) { // Clear the AST cache when it hits 1024 entries if (++$this->cachedCount > 1024) { $this->cache = []; $this->cachedCount = 0; } $this->cache[$expression] = $this->parser->parse($expression); } return $this->interpreter->visit($this->cache[$expression], $data); } }