2017 © Pedro Peláez
 

library nfigurator

NGINX configuration file processing library.

image

joltmode/nfigurator

NGINX configuration file processing library.

  • Wednesday, March 8, 2017
  • by joltmode
  • Repository
  • 1 Watchers
  • 1 Stars
  • 27 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 19 Forks
  • 0 Open issues
  • 11 Versions
  • 4 % Grown

The README.md

Nfigurator

NGINX Configuration Processor

(c) 2017 Toms Seisums
(c) 2014-2016 Roman Piták roman@pitak.net, (*1)

PHP Nginx configuration files processor (parser, creator)., (*2)

Installation

The best way to install is to use the Composer dependency manager., (*3)

php composer.phar require joltmode/nfigurator

Features

Pretty Print

<?php Scope::fromFile('m1.conf')->saveToFile('out.conf');

Config Create

<?php
Scope::create()
    ->addDirective(Directive::create('server')
        ->setChildScope(Scope::create()
            ->addDirective(Directive::create('listen', 8080))
            ->addDirective(Directive::create('server_name', 'example.net'))
            ->addDirective(Directive::create('root', 'C:/www/example_net'))
            ->addDirective(Directive::create('location', '^~ /var/', Scope::create()
                    ->addDirective(Directive::create('deny', 'all'))
                )->setCommentText('Deny access for location /var/')
            )
        )
    )
    ->saveToFile('example.net');

File example.net:, (*4)

server {
    listen 8080;
    server_name example.net;
    root C:/www/example_net;
    location ^~ /var/ { # Deny access for location /var/
        deny all;
    }
}

Comments handling

Simple comments

<?php echo new Comment("This is a simple comment.");

output:, (*5)

# This is a simple comment.

Multi-line comments

<?php
echo new Comment("This \nis \r\na multi
line " . PHP_EOL . "comment.");

output:, (*6)

# This
# is
# a multi
# line
# comment.

Directive with a simple comment

<?php echo Directive::create('deny', 'all')->setCommentText('Directive with a comment');

output:, (*7)

deny all; # Directive with a comment

Directive with a multi-line comment

<?php echo Directive::create('deny', 'all')->setCommentText('Directive
with a multi line comment');

output:, (*8)

# Directive
# with a multi line comment
deny all;

The Versions

08/03 2017

dev-master

9999999-dev https://github.com/joltmode/nfigurator

NGINX configuration file processing library.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Toms Seisums

parser php configuration config manager processor conf nginx create creator conf file config file configuration file

08/03 2017

v0.2.5

0.2.5.0 https://github.com/joltmode/nfigurator

NGINX configuration file processing library.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Toms Seisums

parser php configuration config manager processor conf nginx create creator conf file config file configuration file

07/03 2017

v0.2.4

0.2.4.0 https://github.com/joltmode/nfigurator

NGINX configuration file processing library.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Toms Seisums

parser php configuration config manager processor conf nginx create creator conf file config file configuration file

07/03 2017

v0.2.3

0.2.3.0 https://github.com/joltmode/nfigurator

NGINX configuration file processing library.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Toms Seisums

parser php configuration config manager processor conf nginx create creator conf file config file configuration file

07/03 2017

v0.2.2

0.2.2.0 https://github.com/joltmode/nfigurator

NGINX configuration file processing library.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Toms Seisums

parser php configuration config manager processor conf nginx create creator conf file config file configuration file

31/01 2016

dev-issue/4-follow-include-directive

dev-issue/4-follow-include-directive https://github.com/romanpitak/Nginx-Config-Processor

Nginx configuration files processor.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

parser php configuration config manager processor conf nginx create creator conf file config file configuration file

31/01 2016

v0.2.1

0.2.1.0 https://github.com/romanpitak/Nginx-Config-Processor

Nginx configuration files processor.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

parser php configuration config manager processor conf nginx create creator conf file config file configuration file

31/01 2016

v0.2

0.2.0.0 https://github.com/romanpitak/Nginx-Config-Processor

Nginx configuration files processor.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

parser php configuration config manager processor conf nginx create creator conf file config file configuration file

31/10 2014

dev-develop

dev-develop https://github.com/romanpitak/Nginx-Config-Processor

Nginx configuration files processor.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

parser php configuration config manager processor conf nginx create creator conf file config file configuration file

21/09 2014

v0.1

0.1.0.0 https://github.com/romanpitak/Nginx-Config-Processor

Nginx configuration files processor.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

parser php configuration config manager processor conf nginx create creator conf file config file configuration file

21/09 2014

dev-devel/config-creator

dev-devel/config-creator https://github.com/romanpitak/Nginx-Config-Processor

Nginx configuration files processor.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

parser php configuration config manager processor conf nginx create creator conf file config file configuration file