Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
/ netrc Public archive
forked from fduch/netrc

Simple netrc file manager

License

Notifications You must be signed in to change notification settings

acquia/netrc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

netrc

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;
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
}

About

Simple netrc file manager

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%