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

Class: downloader

Source Location: /system/classes/downloader.class.php

Class Overview


This class allows you to download a file from outside the web tree. Many hooks around security and file types have been added for customization within any app.


Author(s):

  • Tony Bibbs

Methods



Class Details

[line 39]
This class allows you to download a file from outside the web tree. Many hooks around security and file types have been added for customization within any app.



Tags:

author:  Tony Bibbs


[ Top ]


Class Methods


constructor __construct [line 91]

downloader __construct( )

Constructor



Tags:

access:  public


[ Top ]

method areErrors [line 375]

boolean areErrors( )

Returns if any errors have been encountered thus far



Tags:

return:  True if errors occurred otherwise false


[ Top ]

method checkExtension [line 420]

boolean checkExtension( string $extension)

Checks to see that mime type for current file is allowed for upload



Tags:

return:  true if allowed otherwise false


Parameters:

string   $extension   Verifies file extension is allowed for download

[ Top ]

method downloadFile [line 472]

boolean downloadFile( string $fileName)

Attempts to dowload a file



Tags:

return:  true on success otherwise false


Parameters:

string   $fileName   file to download without path

[ Top ]

method getAllowedExtensions [line 409]

array getAllowedExtensions( )

Gets allowed mime types for this instance



Tags:

return:  array of allowed mime types/file extensions


[ Top ]

method getPath [line 461]

string getPath( )

Returns directory to upload to



Tags:

return:  returns directory where files for downloading reside


[ Top ]

method limitByIP [line 235]

boolean limitByIP( [array $validIPS = array('127.0.0.1')])

Extra security option that forces all attempts to download a file to be done so from a set of VERY specific IP's. This is only good for those who are paranoid



Tags:

return:  returns true on success otherwise false


Parameters:

array   $validIPS   Array of valid IP addresses to allow file uploads from

[ Top ]

method loggingEnabled [line 291]

boolean loggingEnabled( )

Returns whether or not logging is enabled



Tags:

return:  true if logging is enabled otherwise false


[ Top ]

method printDebugMsgs [line 358]

void printDebugMsgs( )

This function will print any debug messages out.



[ Top ]

method printErrors [line 319]

boolean printErrors( [boolean $verbose = true])

This function will print any errors out. This is useful in debugging



Tags:

return:  string of all errors


Parameters:

boolean   $verbose   will print errors to web browser if true

[ Top ]

method printWarnings [line 342]

void printWarnings( )

This function will print any warnings out. This is useful in debugging



[ Top ]

method setAllowedExtensions [line 389]

void setAllowedExtensions( [array $validExtensions = array()])

Sets allowed mime types for this instance



Parameters:

array   $validExtensions   Array of allowed extensions and mime types

[ Top ]

method setDebug [line 302]

void setDebug( boolean $switch)

Will force the debug messages in this class to be printed



Parameters:

boolean   $switch   flag, true or false

[ Top ]

method setLogFile [line 255]

boolean setLogFile( [string $logFile = ''])

Sets log file



Tags:

return:  true on success otherwise false


Parameters:

string   $logFile   fully qualified path to log files

[ Top ]

method setLogging [line 274]

void setLogging( boolean $switch)

Enables/disables logging of errors and warnings



Parameters:

boolean   $switch   flag, true or false

[ Top ]

method setPath [line 437]

boolean setPath( string $uploadDir)

Sets file upload path



Tags:

return:  true on success otherwise false


Parameters:

string   $uploadDir   Directory on server to store uploaded files

[ Top ]

method _setAvailableExtensions [line 185]

void _setAvailableExtensions( [array $extensions = array()])

Defines superset of available Mime types.



Parameters:

array   $extensions   string array of valid mime types this object will accept

[ Top ]


Documentation generated on Sun, 02 Oct 2016 07:47:48 +0000 by phpDocumentor 1.4.3