seiler/directive

This package is abandoned and no longer maintained. No replacement package was suggested.

A PHP library to manipulate nginx configurations

v1.0.2 2020-12-20 17:10 UTC

This package is auto-updated.

Last update: 2022-09-20 21:12:37 UTC


README

Software License

Directive helps you to manipulate Nginx configurations in PHP with ease.

Requirements

PHP 7.3 > 8.0

Installation

$ composer require seiler/directive
<?php

use Seiler\Directive;

Usage

  1. Load a Nginx configuration:
$config = file_get_contents('/path/to/nginx/config/file.conf');

$directive = Directive::fromString($config);
  1. Add your changes:
$directive->server->serverName->value('example.org');
  1. Save your changes:
file_put_contents('/path/to/nginx/config/file.conf', $directive);

License

The MIT License (MIT). Please see License File for more information.