Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from PostMix/feature/tideways_xhprof
feat(xhprof): Implement tideways xhprof provider
- Loading branch information
Showing
3 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Bavix\XHProf\Providers; | ||
|
||
use XHProfRuns_Default; | ||
|
||
class TidewaysProvider implements ProviderInterface | ||
{ | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function enable() | ||
{ | ||
$path = config('xhprof.path'); | ||
include_once $path . '/xhprof_lib/utils/xhprof_lib.php'; | ||
include_once $path . '/xhprof_lib/utils/xhprof_runs.php'; | ||
tideways_xhprof_enable(config('xhprof.flags', 0)); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function disable() | ||
{ | ||
$data = tideways_xhprof_disable(); | ||
$runs = new XHProfRuns_Default(); | ||
$runs->save_run($data, config('xhprof.name')); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters