Lines Matching refs:parser
19 * @var array maps extensions to parsers. A parser may be a local cli tool (file is passed as argument)
41 * Load the parser setup
49 'Cannot process media, the parser configuration in ' . self::CONFFILE . ' is missing.'
84 throw new RuntimeException('No parser configured for files of type ' . $ext);
89 throw new RuntimeException('No response from parser');
102 // add what we got from the parser
112 * Execute the parser on the given file
114 * The parser can be an URL accepting a PUT request or a local command
117 * @param string $parser
120 protected function runParser($file, $parser)
122 if (preg_match('/^https?:\/\//', $parser)) {
125 $ok = $http->sendRequest($parser, io_readFile($file, false), 'PUT');
130 } elseif (is_executable(strtok($parser, ' '))) {
133 exec(str_replace('%in%', escapeshellarg($file), $parser), $output, $ok);
144 * @param string $result The string returned by the parser, might be json