*/
private $mLimitReportData = [];
+ /** @var array Parser limit report data for JSON */
+ private $mLimitReportJSData = [];
+
/**
* @var array $mParseStartTime Timestamps for getTimeSinceStart().
*/
return $this->mLimitReportData;
}
+ public function getLimitReportJSData() {
+ return $this->mLimitReportJSData;
+ }
+
public function getTOCEnabled() {
return $this->mTOCEnabled;
}
*/
public function setLimitReportData( $key, $value ) {
$this->mLimitReportData[$key] = $value;
+
+ if ( is_array( $value ) ) {
+ if ( array_keys( $value ) === [ 0, 1 ]
+ && is_numeric( $value[0] )
+ && is_numeric( $value[1] )
+ ) {
+ $data = [ 'value' => $value[0], 'limit' => $value[1] ];
+ } else {
+ $data = $value;
+ }
+ } else {
+ $data = $value;
+ }
+
+ if ( strpos( $key, '-' ) ) {
+ list( $ns, $name ) = explode( '-', $key, 2 );
+ $this->mLimitReportJSData[$ns][$name] = $data;
+ } else {
+ $this->mLimitReportJSData[$key] = $data;
+ }
}
/**