| 1 |
<?php |
| 2 |
namespace Imagify\Webp; |
| 3 |
|
| 4 |
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' ); |
| 5 |
|
| 6 |
/** |
| 7 |
* Add and remove contents to the web.config file to display webp images on the site. |
| 8 |
* |
| 9 |
* @since 1.9 |
| 10 |
* @author Grégory Viguier |
| 11 |
*/ |
| 12 |
class IIS extends \Imagify\WriteFile\AbstractIISDirConfFile { |
| 13 |
|
| 14 |
/** |
| 15 |
* Name of the tag used as block delemiter. |
| 16 |
* |
| 17 |
* @var string |
| 18 |
* @since 1.9 |
| 19 |
* @author Grégory Viguier |
| 20 |
*/ |
| 21 |
const TAG_NAME = 'Imagify: webp file type'; |
| 22 |
|
| 23 |
/** |
| 24 |
* Get unfiltered new contents to write into the file. |
| 25 |
* |
| 26 |
* @since 1.9 |
| 27 |
* @access protected |
| 28 |
* @author Grégory Viguier |
| 29 |
* |
| 30 |
* @return array |
| 31 |
*/ |
| 32 |
protected function get_raw_new_contents() { |
| 33 |
return trim( ' |
| 34 |
<!-- @parent /configuration/system.webServer --> |
| 35 |
<staticContent name="' . esc_attr( static::TAG_NAME ) . ' 1"> |
| 36 |
<mimeMap fileExtension=".webp" mimeType="image/webp" /> |
| 37 |
</staticContent>' ); |
| 38 |
} |
| 39 |
} |
| 40 |
|