2017 © Pedro Peláez
 

library nginx-config-processor

Nginx configuration files processor.

image

romanpitak/nginx-config-processor

Nginx configuration files processor.

  • Sunday, January 31, 2016
  • by romanpitak
  • Repository
  • 10 Watchers
  • 45 Stars
  • 3,297 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 19 Forks
  • 8 Open issues
  • 7 Versions
  • 31 % Grown

The README.md

Nginx Configuration Processor

Latest Stable Version Total Downloads License Build Status Code Climate Test Coverage Codacy Badge Codacy Badge, (*1)

(c) 2014-2016 Roman Piták roman@pitak.net, (*2)

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

Installation

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

php composer.phar require romanpitak/nginx-config-processor

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:, (*5)

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:, (*6)

# This is a simple comment.

Multi-line comments

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

output:, (*7)

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

Directive with a simple comment

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

output:, (*8)

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:, (*9)

# Directive
# with a multi line comment
deny all;

The Versions

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

dev-master

9999999-dev 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