preinheimer / xhprof

XHGUI is a GUI for the XHProf PHP extension, using a database backend, and pretty graphs to make it easy to use and interpret.
Other
833 stars 185 forks source link

Allow defining custom locations for xhprof_lib and config.php #118

Closed MarkRose closed 5 years ago

MarkRose commented 5 years ago

The current code requires that config.php be located under the repository tree in a fixed location. We would like to manage it in another location.

Additionally, fix callgraph.php to load config.php from a custom xhprof_lib location.

aik099 commented 5 years ago

I like the idea, but there is much code duplication.

Maybe we can define all the constants fallbacks in xhprof_lib/defaults.php file, that is then required in all 3 files, that you've changed?

MarkRose commented 5 years ago

@aik099 I've updated my PR as requested.

aik099 commented 5 years ago
  1. Ah, I though inclusion of config.php would stay in it's place. Now it's in defaults.php which needs to be renamed into something else to indicate, that it includes config.
  2. What is your use case, where at the same time you can't put your config.php file into the xhprof folder, but can include externals/header.php from it?
MarkRose commented 5 years ago
  1. What would you like it to be named? Or, would you like me to move the code back into the three files?
  2. We're including xhprof as a git submodule. Also, as part of our workflow, we regularly blow away our code directory and deploy it into different environments with different configurations. We keep our configuration values outside of the code directory so it's simple to deploy new code.
aik099 commented 5 years ago
  1. What would you like it to be named? Or, would you like me to move the code back into the three files?

Place is ok, just filename needs to be changed. Even though that might look like a step back, but please do this:

  1. keep filename as-is
  2. move out actual require ... XHPROF_CONFIG; line after the include of defaults.php happens
  1. We're including xhprof as a git submodule. Also, as part of our workflow, we regularly blow away our code directory and deploy it into different environments with different configurations. We keep our configuration values outside of the code directory so it's simple to deploy new code.

Sounds reasonable.

MarkRose commented 5 years ago

Changes made as requested.

aik099 commented 5 years ago

Merging, thanks @MarkRose .