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


Classes:
CodeGen_Command
CodeGen_Dependency_Header
CodeGen_Dependency_Lib
CodeGen_Element
CodeGen_Extension
CodeGen_ExtensionParser
CodeGen_License
CodeGen_License_BSD
CodeGen_License_GPL
CodeGen_License_LGPL
CodeGen_License_PHP
CodeGen_Maintainer
CodeGen_Release
CodeGen_Tools_Code
CodeGen_Tools_FileReplacer
CodeGen_Tools_Getopt
CodeGen_Tools_Indent
CodeGen_Tools_IndentC
CodeGen_Tools_Outbuf
CodeGen_Tools_Platform
CodeGen_Tools_Tokenizer
CodeGen_XmlParser
Files:
BSD.php
Code.php
Command.php
Element.php
Extension.php
ExtensionParser.php
FileReplacer.php
Getopt.php
GPL.php
Header.php
Indent.php
IndentC.php
LGPL.php
Lib.php
License.php
Maintainer.php
Outbuf.php
PHP.php
Platform.php
Release.php
Tokenizer.php
XmlParser.php

Class: CodeGen_Tools_FileReplacer

Source Location: /CodeGen-1.0.3/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 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 2019年3月11日 15:00:14 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.

AltStyle によって変換されたページ (->オリジナル) /