FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
core-debug-fileloc.php
1 <?php
2 /***********************************************************
3  Copyright (C) 2008-2013 Hewlett-Packard Development Company, L.P.
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  version 2 as published by the Free Software Foundation.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 ***********************************************************/
18 
19 define("TITLE_core_debug_fileloc", _("Global Variables"));
20 
26 {
27  function __construct()
28  {
29  $this->Name = "debug-fileloc";
30  $this->Title = TITLE_core_debug_fileloc;
31  $this->MenuList = "Help::Debug::Global Variables";
32  $this->DBaccess = PLUGIN_DB_ADMIN;
33  parent::__construct();
34  }
35 
42  function PostInitialize()
43  {
44  if ($this->State != PLUGIN_STATE_VALID) {
45  return(0);
46  } // don't re-run
47 
48  // It worked, so mark this plugin as ready.
49  $this->State = PLUGIN_STATE_READY;
50  // Add this plugin to the menu
51  if ($this->MenuList !== "")
52  {
53  menu_insert("Main::" . $this->MenuList,$this->MenuOrder,$this->Name,$this->MenuTarget);
54  }
55  return(1);
56  } // PostInitialize()
57 
58 
63  public function Output()
64  {
65  global $BINDIR, $LIBDIR, $LIBEXECDIR, $INCLUDEDIR, $LOGDIR,
66  $SYSCONFDIR, $PROJECTSTATEDIR, $PROJECT, $VERSION, $COMMIT_HASH;
67  $varray = array("BINDIR", "LIBDIR", "LIBEXECDIR", "INCLUDEDIR", "LOGDIR",
68  "SYSCONFDIR", "PROJECTSTATEDIR", "PROJECT", "VERSION", "COMMIT_HASH");
69  global $MenuList;
70  $V = "";
71  $text = _(" Variable");
72  $var1 = _("memory_limit");
73  $val1 = ini_get('memory_limit');
74  $var2 = _("post_max_size");
75  $val2 = ini_get('post_max_size');
76  $var3 = _("upload_max_filesize");
77  $val3 = ini_get('upload_max_filesize');
78 
79  $V .= "<table cellpadding=3><tr><th align=left>$text</th><th>&nbsp";
80  foreach ($varray as $var)
81  {
82  $V .= "<tr><td>$var</td><td>&nbsp;</td><td>" . $$var . "</td></tr>";
83  }
84  $V .= "<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
85  $V .= "<tr><td>$var1</td><td>&nbsp;</td><td>$val1</td></tr>";
86  $V .= "<tr><td>$var2</td><td>&nbsp;</td><td>$val2</td></tr>";
87  $V .= "<tr><td>$var3</td><td>&nbsp;</td><td>$val3</td></tr>";
88 
89  $V .= "</table>";
90  return $V;
91  }
92 
93 }
94 $NewPlugin = new core_debug_fileloc;
95 $NewPlugin->Initialize();
#define PLUGIN_DB_ADMIN
Plugin requires admin level permission on DB.
Definition: libfossology.h:51
PostInitialize()
This is where we check for changes to the full-debug setting.
Definition: state.hpp:26
This is the Plugin class. All plugins should:
Definition: FO_Plugin.php:67
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...
Plugin to display global variables.
Output()
This function is called when user output is requested. This function is responsible for content...