function __construct(&$extr, $params) { parent::__construct($extr, $params['name'], Engine::getCmd($params['cmd']) . ' --vanilla --quiet', new Convert('pdf', 'png'), $params['forbidden'], isset($params['category']) ? 'R' : $params['category']); $pre = $this->dir('@.R'); file_exists($pre) || copy($extr->R_EXT . '@.R', $pre); $output = shell_exec(Engine::getCmd($params['cmd']) . ' --version'); $pos = strpos($output, "\n"); $this->desc = substr($output, 0, $pos); $this->lang = 'rsplus'; }
function __construct(&$extr, $params) { //($name, $cmd, $banfile, $category=null) { parent::__construct($extr, $params['name'], Engine::getCmd($params['cmd']) . ' -qfH --no-window-system', new Convert('pdf', 'png', '-trim'), $params['forbidden'], isset($params['category']) ? 'M' : $params['category']); $pre = $this->dir('@.m'); file_exists($pre) || copy($this->extr->R_EXT . '@.m', $pre); $output = shell_exec(Engine::getCmd($params['cmd']) . ' --version'); $pos = strpos($output, "\n"); $this->desc = substr($output, 0, $pos); $this->lang = 'matlab'; }
function __construct(&$extr, $name, $cmd, $convert, $banfile, $category, $security = null, $sudo = null) { $this->extr =& $extr; $this->name = $name; system("mkdir -p " . R_DIR . $this->name); $this->cmd = $cmd; $this->convert = $convert; $this->category = $category; $this->security = is_null($security) ? 1 : $security; $extr->extension_log($this->extr->R_EXT . $banfile); if (!file_exists($this->extr->R_EXT . $banfile)) { throw new Exception("Engine.php: file \"" . $banfile . "\" not found"); } $this->banned = unserialize(file_get_contents($extr->R_EXT . $banfile)); $this->sudo = is_null($sudo) ? Engine::getCmd('sudo') . ' -u rd ' : $sudo; $this->lang = 'text'; }