Skip to content

Commit 1cf1cd0

Browse files
committed
Docker up supports enabling xhprof in the container
1 parent 6f34bd2 commit 1cf1cd0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

mdk/commands/docker.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def setup_args(self, parser):
6161
)
6262
upparser.add_argument('-N', '--no-create', action='store_true', help='do not create the container if it does not exist')
6363
upparser.add_argument('--xdebug', action='store_true', help='enable the Xdebug extension in the container')
64+
upparser.add_argument('--xhprof', action='store_true', help='enable the Xhprof extension in the container')
6465

6566
downparser = subparser.add_parser('down', parents=[parent], help='stop and remove the Moodle container')
6667
rmparser = subparser.add_parser('rm', parents=[parent], help='remove the Moodle container')
@@ -202,6 +203,9 @@ def open_instance_in_browser_if_needed():
202203
envvars['PHP_INI-xdebug.client_host'] = 'host.docker.internal'
203204
envvars['PHP_INI-xdebug.mode'] = 'develop,debug'
204205
envvars['PHP_INI-xdebug.start_with_request'] = 'yes'
206+
if args.xhprof:
207+
envvars['PHP_EXTENSION_xhprof'] = '1'
208+
envvars['PHP_INI-xhprof.output_dir'] = '/var/www/moodledata/xhprof'
205209

206210
r, _, _ = process(
207211
[

0 commit comments

Comments
 (0)