evilfreelancer / xl2tp-php
XL2TP configuration manager gives you the ability to work with configuration of your services in OOP style
1.0.1
2020-07-10 22:58 UTC
Requires
- php: ^7.2
- ext-json: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- larapack/dd: ^1.1
- limedeck/phpunit-detailed-printer: ^5.0
- orchestra/testbench: ^4.0|^5.0
- phpunit/phpunit: ^8.0
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2024-12-11 17:59:29 UTC
README
XL2TP configuration manager on PHP
XL2TP configuration manager gives you ability to work with a configuration of your services in OOP style.
composer require evilfreelancer/xl2tp-php
How to use
Script below
$obj = new \XL2TP\Config(); $obj->global->port = 123; $obj->global->authFile = '/etc/auth/file'; $obj->global->accessControl = 'yes'; $obj->lns->exclusive = 'yes'; $obj->lns->lac = 'awesome'; $obj->lns->assignIp = '192.168.1.1'; // Another way for setting section parameters $obj->lns()->callRws = 'yes'; $obj->lns()->challenge = 'no'; $obj->lns('test')->exclusive = 'yes'; $obj->lns('test')->lac = 'awesome'; $obj->lns('test')->assignIp = '192.168.1.1'; $obj->lac->redial = 123; $obj->lac->maxRedial = 1; $obj->lac->lns = 'test'; $obj->lac('awesome')->redial = 123; $obj->lac('awesome')->maxRedial = 1; $obj->lac('awesome')->lns = 'test'; echo $obj->generate();
Will generate following INI configuration
[global] port = 123 auth file = "/etc/auth/file" access control = "yes" [lns default] exclusive = "yes" lac = "awesome" assign ip = "192.168.1.1" call rws = "yes" challenge = "no" [lns test] exclusive = "yes" lac = "awesome" assign ip = "192.168.1.1" [lac default] redial = 123 max redial = 1 lns = "test" [lac awesome] redial = 123 max redial = 1 lns = "test"