fduch/netrc

netrc manager

Installs: 95

Dependents: 1

Stars: 1

Watchers: 1

Language: PHP

1.0.0 2015-06-12 08:09 UTC

README

Simple netrc files manager

Build Status

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;

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 (ParseException $e) {
    //something is wrong with your netrc file
}