/** * Get the version string of the Pandoc executable * @return string or false if not available */ function get_pandoc_version() { // fix "pandoc: HOME: getAppUserDataDirectory: does not exist (no environment variable)" on webservers // that don't have $_SERVER['HOME'] set // see also https://github.com/jgm/pandoc-citeproc/issues/35 // not sure if this is also needed for regular "make" invocations @exec('HOME=' . escapeshellarg(get_server_home_dir()) . ' pandoc -v 2>&1', $out, $ret_val); if ($ret_val !== 0) { return false; } else { return trim(substr($out[0], 7)); } }
/** * Return whether the webserver process has a SSH keypair associated with it * @return bool */ function server_has_ssh_key() { if (@is_file(get_server_home_dir() . '/.ssh/id_rsa') && @is_file(get_server_home_dir() . '/.ssh/id_rsa.pub')) { return true; } else { return false; } }