本文整理汇总了PHP中CommonFunctions::getPlugins方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonFunctions::getPlugins方法的具体用法?PHP CommonFunctions::getPlugins怎么用?PHP CommonFunctions::getPlugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonFunctions
的用法示例。
在下文中一共展示了CommonFunctions::getPlugins方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* set parameters for the generation process
*
* @param boolean $completeXML switch for complete xml with all plugins
* @param string $plugin name of the plugin
*
* @return void
*/
public function __construct($completeXML, $plugin = null)
{
parent::__construct();
if ($completeXML) {
$this->_plugins = CommonFunctions::getPlugins();
}
if ($plugin !== null) {
if (!is_array($plugin)) {
$plugin = array($plugin);
}
foreach ($plugin as $p) {
if (in_array(strtolower($p), CommonFunctions::getPlugins())) {
$this->_plugins[] = $p;
}
$this->_pluginRequest = true;
}
}
$this->_prepare();
}
示例2: run
/**
* render the page
*
* @return void
*/
public function run()
{
$this->_checkTemplateLanguage();
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n";
echo " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
echo " <head>\n";
echo " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n";
echo " <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n";
echo " <meta http-equiv=\"Content-Script-Type\" content=\"text/javascript\" />\n";
echo " <meta name=\"Description\" content=\"PHPSysInfo is a customizable PHP Script that parses /proc, and formats information nicely.";
echo " It will display information about system facts like Uptime, CPU, Memory, PCI devices, SCSI devices, IDE devices, Network adapters, Disk usage, and more.\" />\n";
echo " <link type=\"text/css\" rel=\"stylesheet\" href=\"./templates/" . $this->_template . ".css\" title=\"PSI_Template\"/>\n";
echo " <link type=\"text/css\" rel=\"stylesheet\" href=\"./templates/plugin/nyroModal.full.css\" />\n";
echo " <link type=\"text/css\" rel=\"stylesheet\" href=\"./templates/plugin/jquery.jgrowl.css\" />\n";
echo " <link type=\"text/css\" rel=\"stylesheet\" href=\"./templates/plugin/jquery.dataTables.css\" />\n";
echo " <link type=\"text/css\" rel=\"stylesheet\" href=\"./templates/plugin/jquery.treeTable.css\" />\n";
echo " <script type=\"text/JavaScript\" src=\"./js.php?name=jquery\"></script>\n";
echo " <script type=\"text/JavaScript\" src=\"./js.php?name=jquery.dataTables\"></script>\n";
echo " <script type=\"text/JavaScript\" src=\"./js.php?name=jquery.nyroModal\"></script>\n";
echo " <script type=\"text/JavaScript\" src=\"./js.php?name=jquery.jgrowl\"></script>\n";
echo " <script type=\"text/JavaScript\" src=\"./js.php?name=jquery.timers\"></script>\n";
echo " <script type=\"text/JavaScript\" src=\"./js.php?name=jquery.treeTable\"></script>\n";
echo " <script type=\"text/JavaScript\" src=\"./js.php?name=phpsysinfo\"></script>\n";
foreach (CommonFunctions::getPlugins() as $plugin) {
echo " <script type=\"text/JavaScript\" src=\"./js.php?plugin=" . trim($plugin) . "\"></script>\n";
}
echo " <title>PhpSysInfo " . CommonFunctions::PSI_VERSION . "</title>\n";
echo " </head>\n";
echo " <body>\n";
echo " <div id=\"loader\">\n";
echo " <img width=\"16\" align=\"absmiddle\" src=\"../vulnmeter/images/loading.gif\" border=\"0\" alt=\"" . _("Loading") . "\" title=\"" . _("Loading") . "\"> " . _("Loading... please wait!") . "\n";
echo " </div>\n";
echo " <div id=\"errors\" style=\"display: none; width: 940px\">\n";
echo " <div id=\"errorlist\">\n";
echo " <h2>Oh, I'm sorry. Something seems to be wrong.</h2>\n";
echo " </div>\n";
echo " </div>\n";
echo " <div id=\"container\">\n";
echo " <h1>\n";
echo " <a href=\"#errors\" class=\"nyroModal\">\n";
echo " <img id=\"warn\" style=\"vertical-align: middle; display:none; border:0px;\" src=\"./gfx/attention.png\" alt=\"warning\" />\n";
echo " </a>\n";
echo " <span id=\"title\">\n";
echo " <span id=\"lang_001\">System information</span>\n";
echo " : <span id=\"s_hostname_title\"></span>\n";
echo " <span id=\"s_ip_title\"></span> <a href='/munin/localdomain/localhost.localdomain.html#Processes' style='text-decoration:none;text-transform:none;color:black'><img src='../pixmaps/chart_bar.png' border='0' align='absmiddle'> Resources</a> \n";
/*$tz =( isset($_SESSION["_timezone"]) ) ? intval($_SESSION["_timezone"]) : intval(date("O"))/100;
$timetz = gmdate("U")+(3600*$tz);
echo " <span id=\"s_ip_title\"></span> <a target='main' href='/ossim/report/host_report.php?hmenu=Sysinfo&smenu=Sysinfo&host=any&star_date=".gmdate("Y-m-d",$timetz-604800)."&end_date=".gmdate("Y-m-d",$timetz)."' style='text-decoration:none;text-transform:none;color:black'><img src='../pixmaps/chart_bar.png' border='0' align='absmiddle'> Resources</a> \n";*/
echo " </span>\n";
echo " </h1>\n";
/*echo " <div id=\"select\">\n";
echo " <span id=\"lang_044\">Template</span>\n";
echo " <select id=\"template\" name=\"template\">\n";
foreach ($this->_templates as $template) {
$selected = "";
if ($this->_template === $template) {
$selected = " selected=\"selected\"";
}
echo " <option value=\"".$template."\"".$selected.">".$template."</option>\n";
}
echo " </select>\n";
echo " <span id=\"lang_045\">Language</span>\n";
echo " <select id=\"lang\" name=\"lang\">\n";
foreach ($this->_languages as $language) {
$selected = "";
if ($this->_language === $language) {
$selected = " selected=\"selected\"";
}
echo " <option value=\"".$language."\"".$selected.">".$language."</option>\n";
}
echo " </select>\n";
echo " </div>\n";*/
echo " <div id=\"vitals\">\n";
echo " <h2><span id=\"lang_002\">System vitals</span></h2>\n";
echo " <table class=\"stripeMe\" id=\"vitalsTable\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td style=\"width:160px;\"><span id=\"lang_003\">Hostname</span></td>\n";
echo " <td><span id=\"s_hostname\"></span></td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td style=\"width:160px;\"><span id=\"lang_004\">Listening IP</span></td>\n";
echo " <td><span id=\"s_ip\"></span></td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td style=\"width:160px;\"><span id=\"lang_005\">Kernel Version</span></td>\n";
echo " <td><span id=\"s_kernel\"></span></td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td style=\"width:160px;\"><span id=\"lang_006\">Distro Name</span></td>\n";
echo " <td><span id=\"s_distro\"></span></td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td style=\"width:160px;\"><span id=\"lang_007\">Uptime</span></td>\n";
//.........这里部分代码省略.........
示例3: define
* external is needed when running in static mode
*
* @var boolean
*/
define('PSI_INTERNAL_XML', false);
if (version_compare("5.2", PHP_VERSION, ">")) {
die("PHP 5.2 or greater is required!!!");
}
if (!extension_loaded("pcre")) {
die("phpSysInfo requires the pcre extension to php in order to work properly.");
}
require_once APP_ROOT . '/includes/autoloader.inc.php';
// Load configuration and perform system check
try {
require_once APP_ROOT . '/read_config.php';
} catch (Exception $e) {
}
require_once APP_ROOT . '/systemcheck.php';
if (Error::singleton()->errorsExist()) {
$tpl = new Template("/views/errors.html");
$tpl->set('errors', Error::singleton()->getErrors());
echo $tpl->fetch();
exit(-1);
}
$tpl = new Template("/views/index.html");
$tpl->set('plugins', CommonFunctions::getPlugins());
require_once '../includes/config.php';
include '../templates/' . $CONF['template'] . '/header.php';
echo $tpl->fetch();
set_page_title('Teknik Server Stats');
include '../templates/' . $CONF['template'] . '/footer.php';
示例4: __construct
/**
* set parameters for the XML generation process
*
* @param boolean $completeXML switch for complete xml with all plugins
* @param string $plugin name of the plugin
*
* @return void
*/
public function __construct($completeXML, $plugin = null)
{
parent::__construct();
if ($completeXML) {
$this->_completeXML = true;
}
if ($plugin) {
if (in_array($plugin, CommonFunctions::getPlugins())) {
$this->_pluginName = $plugin;
$this->_pluginRequest = true;
}
}
$this->_prepare();
}
示例5: __construct
/**
* doing some initial tasks
* - generate the xml structure with the right header elements
* - get the error object for error output
* - get a instance of the sysinfo object
*
* @param boolean $complete generate xml with all plugins or not
* @param string $pluginname name of the plugin
*
* @return void
*/
public function __construct($complete = false, $pluginname = "")
{
$this->_errors = Error::singleton();
if ($pluginname == "") {
$this->_plugin_request = false;
$this->_plugin = '';
} else {
$this->_plugin_request = true;
$this->_plugin = $pluginname;
}
if ($complete) {
$this->_complete_request = true;
} else {
$this->_complete_request = false;
}
$os = PSI_OS;
$this->_sysinfo = new $os();
$this->_plugins = CommonFunctions::getPlugins();
$this->_xmlbody();
}