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

Class: MediaSearch_File_File

Source Location: /MediaSearch/File/File.php

Class Overview

MediaSearch_File_Abstract
   |
   --MediaSearch_File_File

Concrete implementation of a file. Objects of this type are leafes in a file tree. A file can have a type (see class constants). The type of a file is determined by its file name extension.


Author(s):

Copyright:

  • Copyright (c) 2009 Sven Strittmatter

Constants

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: MediaSearch_File_Abstract

MediaSearch_File_Abstract::__construct()
Requires a filename as string or an SplFileInfo object of a file.

Class Details

[line 35]
Concrete implementation of a file. Objects of this type are leafes in a file tree. A file can have a type (see class constants). The type of a file is determined by its file name extension.



Tags:

copyright:  Copyright (c) 2009 Sven Strittmatter


[ Top ]


Class Methods


constructor __construct [line 98]

MediaSearch_File_File __construct( $fileInfo)



Tags:

see:  MediaSearch_File_Abstract Additionaly discovers the type of the file.
access:  public


Overrides MediaSearch_File_Abstract::__construct() (Requires a filename as string or an SplFileInfo object of a file.)

Parameters:

   $fileInfo  

[ Top ]

method acceptVisitor [line 169]

void acceptVisitor( MediaSearch_File_Visitor $visitor)

Implements MediaSearch_Interface_Visitable.



Tags:

access:  public


Parameters:


[ Top ]

method getType [line 133]

int getType( )

Returns the type according to the class constants named by TYPE_*.



Tags:

access:  public


[ Top ]

method isType [line 155]

bool isType( int $type, [string $extension = null])

This mthod provides two functions:

  1. If only the type integer is given this method returns if the actual object is of this type.
  2. If you provide a file name extension like 'jpg' as second parameter this method tells you if files with this extension are from the type you passed as first argument.

Valid integers as type identifier are all class constants named like TYPE_*.




Tags:

access:  public


Parameters:

int   $type  
string   $extension   An optional filename extension like 'jpg'.

[ Top ]


Class Constants

TRACE_LELVEL =  23

[line 36]


[ Top ]

TYPE_DOCUMENT =  5

[line 67]

File type document: All files with the file name extensions: 'txt', 'pdf', 'odt', 'doc'.


[ Top ]

TYPE_IMAGE =  4

[line 62]

File type image: All files with the file name extensions: 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'tif'.


[ Top ]

TYPE_MOVIE =  1

[line 47]

File type movie: All files with the file name extensions: 'avi', 'mov', 'mpg', 'mpeg', 'mp4', 'mkv', 'wmv', 'rm', 'xvid', 'divx', 'mpa', 'm4v', 'ogm', 'sfv'.


[ Top ]

TYPE_MUSIC =  2

[line 52]

File type music: All files with the file name extensions: 'mp3', 'wav', 'ogg', 'm4a'.


[ Top ]

TYPE_SOFTWARE =  3

[line 57]

File type software: All files with the file name extensions: 'exe', 'dmg', 'pkg', 'dpkg', 'xpi'.


[ Top ]

TYPE_UNKNOW =  0

[line 41]

Unknown file type


[ Top ]



Documentation generated on Mon, 17 Aug 2009 14:52:32 +0200 by phpDocumentor 1.4.2