mirasvit / module-profiler

Magento 2 Profiler
https://mirasvit.com/
Open Software License 3.0
133 stars 36 forks source link

:bug: Fix `phpinfo()` call crash #15

Closed mimarcel closed 7 years ago

mimarcel commented 7 years ago

Steps to Replicate:

  1. Install Magento
  2. Add mirasvit/module-profiler
  3. Call from a controller:
    phpinfo()

Expected: php information is returned

Actual: application crashes

Reason: phpinfo() displays all information in $_SERVER, including the value added by this module in registration.php, but the instance of class \Magento\Framework\Profiler\Driver\Standard\Stat can not be represented as a string because the class does not have __toString() method implemented.

This PR does save this object in $GLOBALS instead of $_SERVER because that's the PHP-recommended place to save global variables.

mimarcel commented 7 years ago

@adrok what's the reason for closing this PR?