BlueShoes Application Framework made with PHP http://www.blueshoes.org/


Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: C:/usr/local/lib/php/blueshoes-4.2/core/file/Bs_FileUtil.class.php
BlueShoes Application Framework - file

Bs_FileUtil

Bs_Object
   |
  +-- Bs_FileUtil

file helper class. not sure if i should start another class or if i should

 

private class Bs_FileUtil extends Bs_Object

file helper class. not sure if i should start another class or if i should
throw this into bs_file.dependencies: Bs_System, Bs_Dir (in countLinesDir()),

Authors
Version4.0.$id$
Copyrightblueshoes.org

 

Methods inherited from Bs_Object

isex, isexception, tostring, tohtml, persist, unpersist, bs_object, bbsetoutput, bbawake, bbisawake, bbxmsg, bbxfunctionstart, bbxfunctionend, bbxecho, bbxvar, bbxvardump, bbforcetrace, bbbufferstart, bbbufferget, bbbufferendflush, bbbufferendclean

Public Method Summary

void

Bs_FileUtil()

Constructor.
bool

removeEmptyLines(string $fullPath)

removes all empty lines of the given file.
int

countLinesFile(string $fullPath)

counts the lines in the file specified.
int

countLinesDir(string $fullPath, [ string $regExp, string $recursive ])

counts the lines in all files in a directory, even recursive if you want.
string

getMimeType(string $param)

returns the mime type for a file type.

Private Constant Summary

BS_FILEUTIL_VERSION >>4.0.$x$<< Warning: documentation is missing.

Public Method Details

Bs_FileUtil

public void Bs_FileUtil( )

  Constructor.

Returns void


removeEmptyLines

public bool removeEmptyLines( string $fullPath )

  removes all empty lines of the given file.

Parameter
string $fullPath
Returns bool

TRUE on success

Throws bool FALSE.

countLinesFile

public int countLinesFile( string $fullPath )

  counts the lines in the file specified.

Parameter
string $fullPath
Returns int


countLinesDir

public int countLinesDir( string $fullPath, [ string $regExp, string $recursive ] )

  counts the lines in all files in a directory, even recursive if you want.

Parameter
string $fullPath
string $regExp = >>NULL,<<
(a regexp the file has to pass, eg to only use some file types. default is NULL.)
string $recursive = >>FALSE<<
(if you want to do it recursively, default is FALSE.)
Returns int


getMimeType

public string getMimeType( string $param )

  returns the mime type for a file type.
example:Bs_FileUtil->getMimeType('doc') => 'application/msword'the function only knows the 'official' ones, see the apache conf filenamed mime.types.default and it's comment. extract:For more information about Internet media types, please read RFC 2045,2046, 2047, 2048, and 2077. The Internet media type registry is atftp://ftp.iana.org/in-notes/iana/assignments/media-types/.

Parameter
string $param
(file extension without the dot, eg 'zip')
Returns string

Throws bool FALSE

Private Constant Details

BS_FILEUTIL_VERSION

define( BS_FILEUTIL_VERSION, >>4.0.$x$<< )
Case: default: case sensitive




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta