-
Notifications
You must be signed in to change notification settings - Fork 747
Closed
Description
The string is currently terminated after the third quote in "foo \"$bar\" baz" instead of at the end.
Source:
<?php
if ( extension_loaded( 'excimer' ) && isset( $_GET['forceflame'] ) ) {
$prof = new ExcimerProfiler();
$prof->setPeriod( 0.1 / 1000 ); // Every 0.1ms
$prof->setEventType( EXCIMER_REAL );
$prof->start();
register_shutdown_function( function () use ( $prof ) {
$prof->stop();
$title = MW_ENTRY_POINT . '.php ' . gmdate( 'Y-m-d H:i:s' ) . ' UTC';
$pipe = popen( "/usr/local/bin/flamegraph.pl --title=\"$title\" > /var/www/html/w/docs/flamegraph.svg", 'w' );
fwrite( $pipe, $prof->getLog()->formatCollapsed() );
} );
}Pygments:
Downstream: https://www.mediawiki.org/w/index.php?title=MediaWiki-Docker/Configuration_recipes/Profiling&oldid=5148799
Minimal demo:
<?php
$title = 'UTC';
$pipe = popen( "flamegraph.pl --title=\"$title\" > /var/www/html/w/docs/flamegraph.svg", 'w' );
fwrite( $pipe, $prof->getLog()->formatCollapsed() );
Metadata
Metadata
Assignees
Labels
No labels

