*/
public function getProfileID() {
if ( $this->profileID === false ) {
- return WikiMap::getCurrentWikiDomain()->getId();
+ return WikiMap::getCurrentWikiDbDomain()->getId();
} else {
return $this->profileID;
}
}
}
- // Kept BC for now, remove when possible
public function profileIn( $functionname ) {
+ wfDeprecated( __METHOD__, '1.33' );
}
public function profileOut( $functionname ) {
+ wfDeprecated( __METHOD__, '1.33' );
}
/**
}
/**
- * Log the data to some store or even the page output
+ * Log the data to the backing store for all ProfilerOutput instances that have one
*
* @since 1.25
*/
return;
}
- $outputs = $this->getOutputs();
- if ( !$outputs ) {
- return;
+ $outputs = [];
+ foreach ( $this->getOutputs() as $output ) {
+ if ( !$output->logsToOutput() ) {
+ $outputs[] = $output;
+ }
}
- $stats = $this->getFunctionStats();
- foreach ( $outputs as $output ) {
- $output->log( $stats );
+ if ( $outputs ) {
+ $stats = $this->getFunctionStats();
+ foreach ( $outputs as $output ) {
+ $output->log( $stats );
+ }
}
}
/**
- * Output current data to the page output if configured to do so
+ * Log the data to the script/request output for all ProfilerOutput instances that do so
*
* @throws MWException
* @since 1.26
*/
public function logDataPageOutputOnly() {
+ $outputs = [];
foreach ( $this->getOutputs() as $output ) {
- if ( $output instanceof ProfilerOutputText ) {
- $stats = $this->getFunctionStats();
+ if ( $output->logsToOutput() ) {
+ $outputs[] = $output;
+ }
+ }
+
+ if ( $outputs ) {
+ $stats = $this->getFunctionStats();
+ foreach ( $outputs as $output ) {
$output->log( $stats );
}
}