Forums / Contribution-Writing Guidelines / Debugging of Classes?

Debugging of Classes?

Locked

Started by icecold on 17 Apr 2010, 12:15 AM · Views: 3,129

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
17 Apr 2010, 12:15 AM
#1
icecold avatar

icecold

Zen Follower

Join Date:
Jul 2008
Posts:
360
Plugin Contributions:
0

Debugging of Classes?

When I try to debug my payment class using a debugger I get an error 403. That happens with every class inside module payments, so my question is, where in the store tree, can the payment class be placed during testing, to avoid, the permission problems?

I made a test an created a bogus class inside there, and had the same permission error.

Something like

<?php class foo { } ?> <?php $classes = get_declared_classes(); foreach ($classes as $class) { echo $class . "<br />";?>
  }

?>

That simple code, had the same problem ...
so to debug any recommendations as to where place the code?

17 Apr 2010, 9:39 PM
#2
icecold avatar

icecold

Zen Follower

Join Date:
Jul 2008
Posts:
360
Plugin Contributions:
0

Re: Debugging of Classes?

I moved my class outside the store subfolder to test it in a sandbox and there I am getting some feedback, the problem is how can I check $_SESSION['cart'] to check if the session is still there, as the class is outside ZC tree, and is returning an error? ... when I put it back, I got a blank screen and nothing else, no errors of any kind!

17 Apr 2010, 9:51 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Debugging of Classes?

If you're getting blank screens when writing your own custom code, turn on error-reporting in PHP so you can see your PHP errors.

If you're getting blank screens inside Zen Cart, you can turn on error reporting to log errors to files by using the utility mentioned in this FAQ on Blank Pages: https://www.zen-cart.com/tutorials/index.php?article=82

Or look up error_reporting on https://www.php.net

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Apr 2010, 10:27 PM
#4
icecold avatar

icecold

Zen Follower

Join Date:
Jul 2008
Posts:
360
Plugin Contributions:
0

Re: Debugging of Classes?

DrByte:

If you're getting blank screens when writing your own custom code, turn on error-reporting in PHP so you can see your PHP errors.

If you're getting blank screens inside Zen Cart, you can turn on error reporting to log errors to files by using the utility mentioned in this FAQ on Blank Pages: https://www.zen-cart.com/tutorials/index.php?article=82

Or look up error_reporting on https://www.php.net

Thanks Dr. Byte! I will try it out, my php.ini is set to E_ALL so .. it should display something, but when I tried to debug it using a php ide debugger, inside ZC , I also got an error with permissions ...

I hope this tool helps troubleshooting it better ...

24 Apr 2010, 5:18 PM
#5
lat9 avatar

lat9

Administrator

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

Re: Debugging of Classes?

icecold:

I ... the problem is how can I check $_SESSION['cart'] to check if the session is still there ...

The Super Globals Plus add-on allows you to view the contents of most everything, including the $_SESSION variables.

11 May 2010, 12:15 AM
#7
lat9 avatar

lat9

Administrator

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

Re: Debugging of Classes?

icecold:

This is interesting but does it work with 1.3.8a?
Yes, and 1.3.9b as well.