PHPCap Docs | PHPCap API
Overview

Namespaces

  • IU
    • PHPCap
  • PHP

Classes

  • ErrorHandler
  • FileUtil
  • RedCap
  • RedCapApiConnection
  • RedCapProject

Interfaces

  • ErrorHandlerInterface
  • RedCapApiConnectionInterface

Exceptions

  • PhpCapException
  • Overview
  • Namespace
  • Class

Class FileUtil

File utility class for dealing with files.

Namespace: IU\PHPCap
Located at FileUtil.php
Methods summary
public static string
+/- fileToString( string $filename )

Reads the contents of the specified file and returns it as a string.

Reads the contents of the specified file and returns it as a string.

Parameters

$filename
the name of the file that is to be read.

Returns

string
the contents of the specified file.

Throws

IU\PHPCap\PhpCapException
if an error occurs while trying to read the file.
public static mixed
+/- writeStringToFile( string $string, string $filename, boolean $append = false )

Writes the specified string to the specified file.

Writes the specified string to the specified file.

Parameters

$string
the string to write to the file.
$filename
the name of the file to write the string.
$append

if true, the file is appended if it already exists. If false, the file is created if it doesn't exist, and overwritten if it does.

Returns

mixed
false on failure, and the number of bytes written on success.

Throws

IU\PHPCap\PhpCapException
if an error occurs.
public static mixed
+/- appendStringToFile( string $string, string $filename )

Appends the specified string to the specified file.

Appends the specified string to the specified file.

Parameters

$string
the string to append.
$filename
the name of the file that is appended.

Returns

mixed
false on failure, and the number of bytes appended on success.

Throws

IU\PHPCap\PhpCapException
if an error occurs.
public static IU\PHPCap\ErrorHandlerInterface
+/- getErrorHandler( )

Gets the error handler for the class.

Gets the error handler for the class.

Returns

IU\PHPCap\ErrorHandlerInterface
the error handler for the class.
public static
+/- setErrorHandler( IU\PHPCap\ErrorHandlerInterface $errorHandler )

Sets the error handler used for methods in this class.

Sets the error handler used for methods in this class.

Parameters

$errorHandler
PHPCap API documentation generated by ApiGen