| 1 |
<?php |
| 2 |
declare(strict_types=1); |
| 3 |
|
| 4 |
namespace Imagify\Webp; |
| 5 |
|
| 6 |
use Imagify\WriteFile\AbstractApacheDirConfFile; |
| 7 |
|
| 8 |
/** |
| 9 |
* Add and remove contents to the .htaccess file to display WebP images on the site. |
| 10 |
* |
| 11 |
* @since 1.9 |
| 12 |
*/ |
| 13 |
class Apache extends AbstractApacheDirConfFile { |
| 14 |
|
| 15 |
/** |
| 16 |
* Name of the tag used as block delemiter. |
| 17 |
* |
| 18 |
* @var string |
| 19 |
* @since 1.9 |
| 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 |
* |
| 28 |
* @return string |
| 29 |
*/ |
| 30 |
protected function get_raw_new_contents() { |
| 31 |
return trim( ' |
| 32 |
<IfModule mod_mime.c> |
| 33 |
AddType image/webp .webp |
| 34 |
</IfModule>' ); |
| 35 |
} |
| 36 |
} |
| 37 |
|