Forums / Addon Admin Tools / Superglobals Plus

Superglobals Plus

Views: 22,681

Results 1 to 20 of 107
7 Sep 2007, 3:01 PM
#1
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Superglobals Plus

From the included readme:

Superglobals Plus is a developers tool that makes evaluating variables easy. It produces a clear overview of the contents of strings, arrays, constants, objects, arrays within object, objects within arrays or whatever...

Features:

  • Show all GLOBALS, or just the Superglobals you need to evaluate.

  • Show all defined constants (v1.2).

  • Show a list of included files (v1.22).

  • Optionally hide HTTP_ variables when showing all globals.

  • Show the whole content of each variable, including all objects and arrays etc!

  • Recursion protection (optional: recursion level/off)

  • Show the variable type (array, string, object, integer, NULL, boolean, resource).

  • Converts strings into their htmlentities before output (v1.0)

  • Clear output (see included superglobals.png).

  • Easy install on Zen Cart (1.3.x instructions included).

  • Easy install on most (other) PHP scripts (no instructions included).

  • Optional IP address protection.

  • Admin switches for all options.

Attached screenshot of an example output to this post (or actually a small part of a screenshot).

7 Sep 2007, 4:11 PM
#2
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Superglobals Plus

Thanks paulm, will be handy.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

16 Oct 2007, 8:02 AM
#3
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Superglobals Plus

Download (version 1.24):
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=747

The main difference with 1.23 is that the amount of information is less overwhelming after a fresh install, only $_POST and $_SESSION are shown now (of course it's very easy to switch on the other features again whenever needed).

Screenshot (the jpg attachment above was very unclear):

21 Dec 2007, 12:22 AM
#4
banswidthjunkie avatar

banswidthjunkie

Zen Follower

Join Date:
Nov 2007
Posts:
167
Plugin Contributions:
1

Re: Superglobals Plus

Paul, I finally got around to installing your superglobabls script. It's a great bit of work, just what ever ZC coder needs. Thanks a lot for putting this together.

B

By the way if anyone else gets a bit confused like me, you need to copy the CONTENTS of catalogue to the zencart root, not the whole folder.

My ZenCart Mods: Define Pages Generator | Fual Slimbox (Lightbox)
A site I did for a mate: http://richard-moon.co.uk/

21 Dec 2007, 2:28 AM
#5
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Superglobals Plus

Yeah, this will come in handy when I re-write the return authorization mod in the next few days.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

21 Dec 2007, 2:31 AM
#6
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Superglobals Plus

yellow1912:

Yeah, this will come in handy when I re-write the return authorization mod in the next few days.

Does this mean I can stop providing support for the mod?

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

21 Dec 2007, 2:32 AM
#7
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Superglobals Plus

Not until I finish it :p

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

21 Dec 2007, 2:34 AM
#8
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Superglobals Plus

yellow1912:

Not until I finish it :p

Then I assume that after your version is posted in the downloads, you will assume the responsibility for support.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

21 Dec 2007, 2:52 AM
#9
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Superglobals Plus

You sound very happy somehow :p

Yah, I can provide support for those who use the new versions.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

23 Dec 2007, 11:37 AM
#10
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Superglobals Plus

yellow1912:

You sound very happy somehow :pNot sure about that, but I am very happy to hear that this mod helps others :smile:

And usually I am also happy when someone makes improvements to a mod I have worked on. It has not happened very often that somebody jumps in, but the times it did happen I have learned a lot from! I find it always very interesting to see how others solve issues I have worked on, and it often inspires me to work on it some more and make other improvements.

23 Dec 2007, 3:34 PM
#11
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Superglobals Plus

Paulm, we were talking about the Return Auth mod, not this one :D

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

23 Dec 2007, 8:20 PM
#12
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Superglobals Plus

yellow1912:

Paulm, we were talking about the Return Auth mod, not this one :DI know (but reading back, I agree it probably looks like I misunderstood)

15 Aug 2008, 9:55 PM
#13
zcnb avatar

zcnb

Zen Follower

Join Date:
Jun 2008
Posts:
338
Plugin Contributions:
0

Re: Superglobals Plus

paulm, thank you for this excellent tool! I have installed it and it is already helping me learn more about Zen Cart. It works with version 1.3.8.

I would like to suggest some improvement to the readme.txt in the package available for download. I believe that it is slightly clearer and may actually eliminate the need for the second readme.txt in extras subdirectory.

Here goes (only for the Zen Cart catalog section - I haven't tried the admin yet)...

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Installation (Zen Cart catalog):
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  1. Backup your files and the database (as always).

  2. Copy the contents of the superglobals.sql file into the textbox of the sql patch tool in the Zen Cart admin/tools/ section

(do not use the sql upload feature, that usually does not work well).

If the Zen Cart sql tool returns errors, it's usually caused by its bugs. In that case use phpMyAdmin for example (don't forget to add your table prefixes if any!).

  1. Copy the file superglobals.php
    from: superglobals-plus_v1.24\catalog\includes\functions\extra_functions
    to your shop's: \includes\functions\extra_functions\

  2. Copy the file stylesheet_superglobals.css to your catalog template css directory:
    includes\templates<YOUR TEMPLATE>\css\

  3. Copy the file
    from: includes\templates\template_default\common
    to: includes/templates/<YOUR TEMPLATE>/common/
    (if the subdirectory 'common' doesn't exist under <YOUR TEMPLATE>, create it)

TOpen the tpl_main_page.php file and, just before the ending </body> tag, add:

<!--bof- superglobals display --> <?php // BEGIN Superglobals if(SHOW_SUPERGLOBALS == 'true') echo superglobals_echo(); // END Superglobals ?> <!--eof- superglobals display -->
> 
> 6) Open the file admin/includes/footer.php and, just before the ending </body> tag, add:
> 
> ```php
<!--bof- superglobals display -->
<?php
// BEGIN Superglobals
if(SHOW_SUPERGLOBALS_ADMIN == 'true') echo superglobals_echo();
// END Superglobals
?>
<!--eof- superglobals display -->
  1. Ready
    (or ready to install the admin version if you like).
21 Aug 2008, 10:03 PM
#14
zcnb avatar

zcnb

Zen Follower

Join Date:
Jun 2008
Posts:
338
Plugin Contributions:
0

Re: Superglobals Plus

One thing that seems to be missing in this excellent utility (SuperGlobals Plus) is a legend describing the meaning of the text colors. At first, I thought that red/green was referring to the lifetime of the objects, but now I think that the colors simply describe the type of the objects:

GREEN: array, string, integer, boolean, etc. (PHP built-in types).
RED: object (class instance)
BLUE: resource (handle, mysql link, result, etc.)
GREY: superglobals message

Please correct if I am mistaken.

Daniel

22 Aug 2008, 11:07 AM
#15
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Superglobals Plus

Hi Daniel,

thanks for the readme update :smile:

The coloring is probably not very logical. I just quickly added some colors at the time to make it a bit easyer to read.

Not all types have specific colors, and the colors are inherited. So, for example, because $GLOBALS is an array (colored green by the css) all childs of $GLOBALS will become green, unless another color has been assigned to the child. Objects are colored red, and all it's childs (that do not have a specific color assigned) will be red too.

You can see in the stylesheet how it's done:

#superglobals .superglobals_array {
  border-left-color: green;
  color: green;
}
#superglobals .superglobals_object {
  border-left-color: red;
  color: red;
}
#superglobals .superglobals_empty {
  color: gray;
}
.superglobals_resource {
  color: blue;
}
.superglobals_type {
  color: black;
}

A small improvement might be to add a border at the bottom of each list (ul). I think that makes it a bit easier to see to what parent the childs belong.

Change:

#superglobals ul {
  border: 1px solid black;
  border-width: 0 0 0px 1px;
  border-left-color: black;
}

To

#superglobals ul {
  border: 1px solid black;
  border-width: 0 0 [B]1[/B]px 1px;
  border-left-color: black;
}

Or maybe even turn the ul's into boxes, like this:

#superglobals ul {
  border: 1px solid black;
  border-width: [B]1px;[/B]
  border-left-color: black;
}
```(now I look at it I wonder why I have not done it like this in the first place...)
24 Aug 2008, 1:39 PM
#16
zcnb avatar

zcnb

Zen Follower

Join Date:
Jun 2008
Posts:
338
Plugin Contributions:
0

Re: Superglobals Plus

paulm:

Hi Daniel,

thanks for the readme update :smile:
You are very welcome but really, thank YOU for this great contribution. What I did is negligible comparing to your work.

BTW, I discovered a typo in my readme update: I mistakenly omitted the filename in step 5. Instead of: "5) Copy the file ", it should read: "5) Copy the file tpl_main_page.php"

And thank you for the clarification regarding the text coloring.

Daniel

25 Apr 2010, 10:06 AM
#17
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Superglobals Plus

Anyone using this most helpful add-on for ZC 1.38a admin should note that there's another change required for full function. In \YOURADMIN\index.php, make the following change (after saving the file!) near the very end of the file:

</div>
<!--bof- superglobals display -->
<?php
// BEGIN Superglobals
if(SHOW_SUPERGLOBALS_ADMIN == 'true') echo superglobals_echo(); 
// END Superglobals
?>
<!--eof- superglobals display -->
</body>
</html>
8 Aug 2011, 1:50 PM
#18
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Superglobals Plus

I just submitted the update for this great debug tool to the "Free Software Add-ons" so that it is usable under 1.5.0.

17 Aug 2011, 10:54 PM
#19
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Superglobals Plus

lat9:

Anyone using this most helpful add-on for ZC 1.38a admin should note that there's another change required for full function. In \YOURADMIN\index.php, make the following change....Funny, I never really noticed that superglobals did not show on the admin index page :smile:

lat9:

I just submitted the update for this great debug tool to the "Free Software Add-ons" so that it is usable under 1.5.0.Great, I am very happy to see this update! Just installed on 1.5.0BETA :bigups:

18 Aug 2011, 3:35 PM
#20
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Superglobals Plus

The update is now available from the "Free Software Add-ons".

Thanks, paulm, I didn't know you were still "around". This is the first add-on that gets installed on any of my Zen Cart installations!