Closed MarkRose closed 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?
@aik099 I've updated my PR as requested.
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.config.php
file into the xhprof
folder, but can include externals/header.php
from it?
- 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:
require ... XHPROF_CONFIG;
line after the include of defaults.php
happens
- 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.
Changes made as requested.
Merging, thanks @MarkRose .
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.