https://github.com/evilfreelancer/xl2tp-php
XL2TP configuration manager written on PHP
https://github.com/evilfreelancer/xl2tp-php
configuration-management ini ini-parser l2tp l2tpd php xl2tp xl2tpd
Last synced: 2 months ago
JSON representation
XL2TP configuration manager written on PHP
- Host: GitHub
- URL: https://github.com/evilfreelancer/xl2tp-php
- Owner: EvilFreelancer
- License: mit
- Created: 2020-04-06T18:27:03.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-10T23:36:13.000Z (almost 5 years ago)
- Last Synced: 2025-03-10T02:45:18.578Z (3 months ago)
- Topics: configuration-management, ini, ini-parser, l2tp, l2tpd, php, xl2tp, xl2tpd
- Language: PHP
- Homepage:
- Size: 46.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://packagist.org/packages/evilfreelancer/xl2tp-php)
[](https://travis-ci.org/EvilFreelancer/xl2tp-php)
[](https://packagist.org/packages/evilfreelancer/xl2tp-php)
[](https://packagist.org/packages/evilfreelancer/xl2tp-php)
[](https://scrutinizer-ci.com/g/EvilFreelancer/xl2tp-php/?branch=master)
[](https://scrutinizer-ci.com/g/evilfreelancer/xl2tp-php/)# 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
```php
$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
```ini
[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"
```## Links
* https://linux.die.net/man/5/xl2tpd.conf
* https://linux.die.net/man/8/xl2tpd
* https://github.com/xelerance/xl2tpd/blob/master/examples/xl2tpd.conf