Code Monkey home page Code Monkey logo

Comments (6)

leeoniya avatar leeoniya commented on August 19, 2024

i don't really want to grow the API, so maybe the easiest thing to do here it to add a global config option that disables dump_r from showing the trace info?

from dump_r.php.

GuyPaddock avatar GuyPaddock commented on August 19, 2024

Actually, yeah, that'd be ideal. Right now, we're relying on some code to search & replace the incorrect trace info with some info we sniff out ourselves (effectively, our code is doing the same thing as dump_r, but with a different blacklist of files to ignore in the stack). So, an option to turn off the built-in support for dump_r to generate this info would be more efficient.

from dump_r.php.

leeoniya avatar leeoniya commented on August 19, 2024

added. try it out.

from dump_r.php.

GuyPaddock avatar GuyPaddock commented on August 19, 2024

Only downside with this approach is that you're still reflecting on the stack backtrace to get the information that may or may not be rendered, no?

I also noticed that Core uses debug_backtrace(), without passing DEBUG_BACKTRACE_IGNORE_ARGS, so it's getting a lot more information about the stack than it needs. I believe if you omit the args, it should reduce memory usage and improve performance of what is normally a decently heavy operation.

from dump_r.php.

leeoniya avatar leeoniya commented on August 19, 2024

i've added DEBUG_BACKTRACE_IGNORE_ARGS and moved the debug_backtrace() call out of Core::dump_r() into the global dump_r() wrapper. feel free to implement your own version of the global dump_r() on top of Core::dump_r().

see b75b5e9

from dump_r.php.

GuyPaddock avatar GuyPaddock commented on August 19, 2024

Thank you!

from dump_r.php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.