| 1 |
<?php |
| 2 |
/** |
| 3 |
* Represents our nginx.conf file. |
| 4 |
* |
| 5 |
* @package SolidWP\Performance |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
namespace SolidWP\Performance\Cache_Delivery\Nginx; |
| 11 |
|
| 12 |
use RuntimeException; |
| 13 |
use SolidWP\Performance\Cache_Delivery\Contracts\Config_File; |
| 14 |
|
| 15 |
/** |
| 16 |
* Represents our nginx.conf file. |
| 17 |
* |
| 18 |
* @package SolidWP\Performance |
| 19 |
*/ |
| 20 |
class Nginx_Conf_File extends Config_File { |
| 21 |
|
| 22 |
/** |
| 23 |
* Get the server path to the nginx.conf file. |
| 24 |
* |
| 25 |
* @throws RuntimeException If we can't find the document root. |
| 26 |
* |
| 27 |
* @return string |
| 28 |
*/ |
| 29 |
public function get_file_path(): string { |
| 30 |
if ( $this->filepath !== null ) { |
| 31 |
return $this->filepath; |
| 32 |
} |
| 33 |
|
| 34 |
$home_path = swpsp_get_document_root(); |
| 35 |
|
| 36 |
$this->filepath = $home_path . 'swpsp-nginx.conf'; |
| 37 |
|
| 38 |
return $this->filepath; |
| 39 |
} |
| 40 |
} |
| 41 |
|