PHP Class HippoPHP\Hippo\File

显示文件 Open project: hippophp/hippo Class Usage Examples

Protected Properties

Property Type Description
$encoding string Encoding of the file.
$filename string Filename.
$lines array Lines of the file.
$source string Source code within the file.

Public Methods

Method Description
__construct ( string $filename = null, string $source = null, string $encoding = 'UTF-8' ) : File Create a new file representation.
getEncoding ( ) : string Return the file encoding.
getFilename ( ) : string Return the filename.
getLines ( ) : array Return the individual array of lines.
getSource ( ) : string Return the source of the file.

Private Methods

Method Description
buildLinesFromSource ( string $source ) : array
extractNextLine ( string $source, array $eols, string &$eolUsed ) : string

Method Details

__construct() public method

Create a new file representation.
public __construct ( string $filename = null, string $source = null, string $encoding = 'UTF-8' ) : File
$filename string
$source string
$encoding string
return File

getEncoding() public method

Return the file encoding.
public getEncoding ( ) : string
return string

getFilename() public method

Return the filename.
public getFilename ( ) : string
return string

getLines() public method

Return the individual array of lines.
public getLines ( ) : array
return array

getSource() public method

Return the source of the file.
public getSource ( ) : string
return string

Property Details

$encoding protected_oe property

Encoding of the file.
protected string $encoding
return string

$filename protected_oe property

Filename.
protected string $filename
return string

$lines protected_oe property

Lines of the file.
protected array $lines
return array

$source protected_oe property

Source code within the file.
protected string $source
return string