#!/usr/bin/php -q 'plugin', 'xml' => 'language', '' => 'language']; function write(...$messages){ global $nchan; if ($nchan) { foreach ($messages as $message) { publish('plugins', $message,1,false); } } else { foreach ($messages as $message) echo $message; } } foreach ($plugins as $plugin) { if (!$plugin || (!$cmd = $call[pathinfo($plugin,PATHINFO_EXTENSION)])) continue; $line = ''; $pluginArg = $method == "update" ? basename($plugin) : $plugin; $run = popen("$cmd $method $pluginArg",'r'); while (!feof($run)) { $line .= fgetc($run); if (!empty($line) && in_array($line[-1],["\r","\n"])) {write($line); $line = '';} } pclose($run); write("\n"); } if ($nchan) write('_DONE_',''); ?>