-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ritvars Zvejnieks
committed
Jul 21, 2023
1 parent
ed59ded
commit 8a1e730
Showing
3 changed files
with
51 additions
and
5 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,20 @@ | ||
<?php | ||
|
||
namespace Ritvarsz\LaravelXhgui\Traits; | ||
|
||
use Ritvarsz\LaravelXhgui\XHGuiMiddleware; | ||
|
||
trait Profilable | ||
{ | ||
public function initXhprof() | ||
{ | ||
// Should only run in console | ||
// HTTP requests are handled by XHGuiMiddleware | ||
// Though, havent seen any issues with starting the profiler multiple times. | ||
if (!app()->runningInConsole()) { | ||
return; | ||
} | ||
|
||
XHGuiMiddleware::enableProfiler(); | ||
} | ||
} |
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