PHP Interface PiPHP\GPIO\FileSystem\FileSystemInterface

Show file Open project: piphp/gpio

Public Methods

Method Description
getContents ( string $path ) : string Read the contents of a file.
open ( string $path, string $mode ) : resource Open a file.
putContents ( string $path, string $buffer ) : integer Write a buffer to a file.

Method Details

getContents() public method

Read the contents of a file.
public getContents ( string $path ) : string
$path string The path of the file to read
return string The file contents

open() public method

Open a file.
public open ( string $path, string $mode ) : resource
$path string The path of the file to open
$mode string The mode to open the file in (see fopen())
return resource A stream resource.

putContents() public method

Write a buffer to a file.
public putContents ( string $path, string $buffer ) : integer
$path string The path of the file to write to
$buffer string The buffer to write
return integer The number of bytes written