fduch / netrc
netrc manager
Installs: 71 981
Dependents: 3
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 6
Open Issues: 1
Requires
- php: ^7.1
Requires (Dev)
- phpunit/phpunit: ^7|^8
This package is not auto-updated.
Last update: 2024-11-09 15:56:33 UTC
README
Simple netrc files manager
Installation
To install netrc manager into your project please use composer:
php composer.phar require fduch/netrc
Usage
Parsing system-wide or custom netrc is quite simple:
<?php use Fduch\Netrc\Netrc; use Fduch\Netrc\Exception\ParseException; use Fduch\Netrc\Exception\FileNotFoundException; try { // you can specify path to netrc file as an argument of Netrc::parse() method $parsed = Netrc::parse(); // dumps key-value array corresponding to machine.one entry var_dump($parsed['machine.one']); } catch (FileNotFoundException $e) { // cannot locate readable netrc file } catch (ParseException $e) { // something is wrong with your netrc file }