CodeGen
[ class tree: CodeGen ] [ index: CodeGen ] [ all elements ]

Class: CodeGen_Tools_FileReplacer

Source Location: /CodeGen-1.0.7/CodeGen/Tools/FileReplacer.php

Class Overview


A file output class that only overwrites files on content changes


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005-2008 Hartmut Holzgraefe

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 41]
A file output class that only overwrites files on content changes

File output is first collected in a temporary file, after the output is finished the temporary file is compared to the previous file (by size and md5 checksum), only when changes are detected the file is replaced, else the old version is kept and the temporary file removed. This way unchanged files keep their old modification date which improves "make" build times



[ Top ]


Class Variables

$fileName =

[line 48]

output filename
  • Access: protected

Type:   string


[ Top ]

$fp =

[line 62]

temporary file handle
  • Access: protected

Type:   resource


[ Top ]

$tempName =

[line 55]

temporary filename
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 69]

CodeGen_Tools_FileReplacer __construct( string $fileName)

Constructor

Parameters:

string   $fileName   —  target filename

[ Top ]

close   [line 94]

bool close( )

Do final output, replace original file on changes
  • Return: success status

[ Top ]

puts   [line 84]

int puts( string $string)

Write text to file
  • Return: number of characters written

Parameters:

string   $string   —  output text

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:39:06 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.