MediaWiki  1.33.0
EasyDeflate Class Reference

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. More...

Static Public Member Functions

static inflate ( $data)
 For content that has been compressed with deflate in the client, try to uncompress it with inflate. More...
 
static isDeflated ( $data)
 Whether the content is deflated. More...
 

Detailed Description

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Server-side helper for the easy-deflate library

Since
1.32

Definition at line 24 of file EasyDeflate.php.

Member Function Documentation

◆ inflate()

static EasyDeflate::inflate (   $data)
static

For content that has been compressed with deflate in the client, try to uncompress it with inflate.

If data is not prefixed with 'rawdeflate,' it will be returned unmodified.

Data can be compressed in the client using the 'easy-deflate.deflate' module:

mw.loader.using( 'easy-deflate.deflate' ).then( function () {
var deflated = EasyDeflate.deflate( myContent );
} );
Parameters
string$dataDeflated data
Returns
StatusValue Inflated data will be set as the value
Exceptions
InvalidArgumentExceptionIf the data wasn't deflated

Definition at line 56 of file EasyDeflate.php.

References $data, StatusValue\newFatal(), and StatusValue\newGood().

Referenced by EasyDeflateTest\testInflate().

◆ isDeflated()

static EasyDeflate::isDeflated (   $data)
static

Whether the content is deflated.

Parameters
string$data
Returns
bool

Definition at line 33 of file EasyDeflate.php.

References $data.

Referenced by EasyDeflateTest\testIsDeflated().


The documentation for this class was generated from the following file:
EasyDeflate
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Ge...
Definition: EasyDeflate.php:24