Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
label_help
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
label_help
Merge requests
!17
Issue
#3495673
by jwilson3: Fix GitLab CI failures
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3495673
by jwilson3: Fix GitLab CI failures
issue/label_help-3495673:3495673-pass-ci-tests
into
2.0.x
Overview
0
Commits
6
Pipelines
2
Changes
4
Merged
James Wilson
requested to merge
issue/label_help-3495673:3495673-pass-ci-tests
into
2.0.x
4 months ago
Overview
0
Commits
6
Pipelines
2
Changes
4
Expand
Closes
#3495673
0
0
Merge request reports
Compare
2.0.x
2.0.x (base)
and
latest version
latest version
e6ea23e8
6 commits,
4 months ago
4 files
+
13
−
58
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
.ddev/xhprof/xhprof_prepend.php deleted
100755 → 0
+
0
−
55
Options
<?php
/**
* @file
* Ddev-generated.
*/
// If you want to take over and customize this file, remove the line above
// And check this file in.
// This file is used by `ddev xhprof on` and determines the behavior
// of xhprof when it is enabled. It is mounted into the ddev-webserver container
// as /usr/local/bin/xhprof/xhprof_prepend.php.
// It can be customized for particular sites or for particular CMS versions.
// Some suggestions and examples are provided below.
$uri
=
"none"
;
if
(
!
empty
(
$_SERVER
)
&&
array_key_exists
(
'REQUEST_URI'
,
$_SERVER
))
{
$uri
=
$_SERVER
[
'REQUEST_URI'
];
}
// Enable xhprof profiling if we're not on an xhprof page.
if
(
extension_loaded
(
'xhprof'
)
&&
strpos
(
$uri
,
'/xhprof'
)
===
FALSE
)
{
// If this is too much information, just use xhprof_enable(), which shows CPU only.
xhprof_enable
(
XHPROF_FLAGS_MEMORY
);
register_shutdown_function
(
'xhprof_completion'
);
}
/**
* Write to the xhprof_html output and latest on completion.
*/
function
xhprof_completion
()
{
$xhprof_link_dir
=
"/var/xhprof/xhprof_html/latest/"
;
$xhprof_data
=
xhprof_disable
();
$appNamespace
=
"ddev"
;
include_once
'/var/xhprof/xhprof_lib/utils/xhprof_lib.php'
;
include_once
'/var/xhprof/xhprof_lib/utils/xhprof_runs.php'
;
$xhprof_runs
=
new
XHProfRuns_Default
();
$run_id
=
$xhprof_runs
->
save_run
(
$xhprof_data
,
$appNamespace
);
// Uncomment to append profile link to the page (and remove the ddev generated first line)
// append_profile_link($run_id, $appNamespace);.
}
/**
* If invoked, this will append a profile link to the output HTML
* This works on some CMSs, like Drupal 7. It does not work on Drupal8/9
* and can have unwanted side-effects on TYPO3.
*/
function
append_profile_link
(
$run_id
,
$appNamespace
)
{
$base_link
=
(
isset
(
$_SERVER
[
'HTTPS'
])
&&
$_SERVER
[
'HTTPS'
]
===
'on'
?
"https"
:
"http"
)
.
"://
$_SERVER[HTTP_HOST]
/xhprof/"
;
$profiler_url
=
sprintf
(
'%sindex.php?run=%s&source=%s'
,
$base_link
,
$run_id
,
$appNamespace
);
echo
'<div id="xhprof"><a href="'
.
$profiler_url
.
'" target="_blank">xhprof profiler output</a></div>'
;
}
Loading