Shellbox
Library and server for containerized shell execution
Loading...
Searching...
No Matches
Shellbox\FileUtils Class Reference

Throwing wrappers for file functions. More...

Static Public Member Functions

static copy ( $source, $dest)
 Copy file.
 
static getContents ( $path)
 Get contents.
 
static putContents ( $path, $contents)
 Put contents.
 
static openInputFile ( $path)
 Open a file in read mode.
 
static openOutputFile ( $path)
 Open a file in write mode.
 
static openInputFileStream ( $path)
 Open a file in read mode and convert it to a StreamInterface.
 
static openOutputFileStream ( $path)
 Open a file in write mode and convert it to a StreamInterface.
 
static copyStreamToFile (StreamInterface $stream, string $path)
 Copy a stream to a file.
 
static mkdir ( $path)
 Make a directory with group/other permission bits masked out.
 
static getMwHashes (StreamInterface $stream)
 Get content hash headers for MediaWiki from a stream.
 

Detailed Description

Throwing wrappers for file functions.

Member Function Documentation

◆ copy()

static Shellbox\FileUtils::copy ( $source,
$dest )
static

Copy file.

Parameters
string$source
string$dest
Exceptions
ShellboxError

◆ copyStreamToFile()

static Shellbox\FileUtils::copyStreamToFile ( StreamInterface $stream,
string $path )
static

Copy a stream to a file.

Parameters
StreamInterface$stream
string$path
Exceptions
ShellboxError

◆ getContents()

static Shellbox\FileUtils::getContents ( $path)
static

Get contents.

Parameters
string$path
Returns
string
Exceptions
ShellboxError

◆ getMwHashes()

static Shellbox\FileUtils::getMwHashes ( StreamInterface $stream)
static

Get content hash headers for MediaWiki from a stream.

Parameters
StreamInterface$stream
Returns
array
Exceptions
ShellboxError

◆ mkdir()

static Shellbox\FileUtils::mkdir ( $path)
static

Make a directory with group/other permission bits masked out.

Parameters
string$path
Exceptions
ShellboxError

◆ openInputFile()

static Shellbox\FileUtils::openInputFile ( $path)
static

Open a file in read mode.

Parameters
string$path
Returns
resource
Exceptions
ShellboxError

◆ openInputFileStream()

static Shellbox\FileUtils::openInputFileStream ( $path)
static

Open a file in read mode and convert it to a StreamInterface.

Parameters
string$path
Returns
StreamInterface
Exceptions
ShellboxError

◆ openOutputFile()

static Shellbox\FileUtils::openOutputFile ( $path)
static

Open a file in write mode.

Parameters
string$path
Returns
resource
Exceptions
ShellboxError

◆ openOutputFileStream()

static Shellbox\FileUtils::openOutputFileStream ( $path)
static

Open a file in write mode and convert it to a StreamInterface.

Parameters
string$path
Returns
StreamInterface
Exceptions
ShellboxError

◆ putContents()

static Shellbox\FileUtils::putContents ( $path,
$contents )
static

Put contents.

Parameters
string$path
string$contents
Exceptions
ShellboxError

The documentation for this class was generated from the following file: