FOSSology  4.4.0
Open Source License Compliance by Open Source Software
core-debug-fileloc.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2008-2013 Hewlett-Packard Development Company, L.P.
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
8 define("TITLE_core_debug_fileloc", _("Global Variables"));
9 
15 {
16  function __construct()
17  {
18  $this->Name = "debug-fileloc";
19  $this->Title = TITLE_core_debug_fileloc;
20  $this->MenuList = "Help::Debug::Global Variables";
21  $this->DBaccess = PLUGIN_DB_ADMIN;
22  parent::__construct();
23  }
24 
31  function PostInitialize()
32  {
33  if ($this->State != PLUGIN_STATE_VALID) {
34  return(0);
35  } // don't re-run
36 
37  // It worked, so mark this plugin as ready.
38  $this->State = PLUGIN_STATE_READY;
39  // Add this plugin to the menu
40  if ($this->MenuList !== "")
41  {
42  menu_insert("Main::" . $this->MenuList,$this->MenuOrder,$this->Name,$this->MenuTarget);
43  }
44  return(1);
45  } // PostInitialize()
46 
47 
52  public function Output()
53  {
54  global $BINDIR, $LIBDIR, $LIBEXECDIR, $INCLUDEDIR, $LOGDIR,
55  $SYSCONFDIR, $PROJECTSTATEDIR, $PROJECT, $VERSION, $COMMIT_HASH;
56  $varray = array("BINDIR", "LIBDIR", "LIBEXECDIR", "INCLUDEDIR", "LOGDIR",
57  "SYSCONFDIR", "PROJECTSTATEDIR", "PROJECT", "VERSION", "COMMIT_HASH");
58  global $MenuList;
59  $V = "";
60  $text = _(" Variable");
61  $var1 = _("memory_limit");
62  $val1 = ini_get('memory_limit');
63  $var2 = _("post_max_size");
64  $val2 = ini_get('post_max_size');
65  $var3 = _("upload_max_filesize");
66  $val3 = ini_get('upload_max_filesize');
67 
68  $V .= "<table cellpadding=3><tr><th align=left>$text</th><th>&nbsp";
69  foreach ($varray as $var)
70  {
71  $V .= "<tr><td>$var</td><td>&nbsp;</td><td>" . $$var . "</td></tr>";
72  }
73  $V .= "<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
74  $V .= "<tr><td>$var1</td><td>&nbsp;</td><td>$val1</td></tr>";
75  $V .= "<tr><td>$var2</td><td>&nbsp;</td><td>$val2</td></tr>";
76  $V .= "<tr><td>$var3</td><td>&nbsp;</td><td>$val3</td></tr>";
77 
78  $V .= "</table>";
79  return $V;
80  }
81 
82 }
83 $NewPlugin = new core_debug_fileloc;
84 $NewPlugin->Initialize();
This is the Plugin class. All plugins should:
Definition: FO_Plugin.php:57
Definition: state.hpp:16
Plugin to display global variables.
Output()
This function is called when user output is requested. This function is responsible for content....
__construct()
base constructor. Most plugins will just use this
PostInitialize()
This is where we check for changes to the full-debug setting.
menu_insert($Path, $LastOrder=0, $URI=NULL, $Title=NULL, $Target=NULL, $HTML=NULL)
Given a Path, order level for the last item, and optional plugin name, insert the menu item.
#define PLUGIN_DB_ADMIN
Plugin requires admin level permission on DB.
Definition: libfossology.h:39