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

Class: download

Source Location: /download_class.php

Class Overview


Download class.


Methods



Class Details

[line 36]
Download class.

A class used for communication between web based and command line PHP scripts.




[ Top ]


Class Methods


constructor download [line 47]

download download( &$hdb, [session $session = FALSE], [user $user = FALSE], hrdi_db $hdb)

Constructor.

The constructor is responsible for setting internal hrdi_db and session pointers.




Parameters:

hrdi_db   $hdb   Reference to a hrdi_db instance
session   $session   Reference to a session instance. It's optional since the command line PHP cannot access session data.
user   $user   Reference to a user_class instance. Optional since the command line PHP cannot access session data.
   &$hdb  

[ Top ]

method compress [line 97]

void compress( )

Starts file compression.

This function will start file compression by storing the file information in the HRDI_Downloads table and exec()ing the archiving script.




[ Top ]

method get_archive_file_path [line 238]

string get_archive_file_path( )

Gets the archive file path.

This function gets the path to the finished archive file. This is the location where the temporary file will be moved when it is finished being compressed. This function should be used to access the finished archive file.




Tags:

return:  The path to the archive file.


[ Top ]

method get_download_file_path [line 212]

string get_download_file_path( )

Gets the downloadable file path.

This function gets the path of the file which the user is offered to download. This is the web accessible directory where the file resides. This function should be used to access and link to the downloadable file.




Tags:

return:  The path to the downloadable file.


[ Top ]

method get_download_info [line 264]

mixed get_download_info( integer $id)

Retrieves file download information.

This method is called by the command line archive.php script in order to retrieve information about the file that it needs to compress and make available for download.




Tags:

return:  List consisting of the destination file name and an array of files that are to be compressed.


Parameters:

integer   $id   Download ID

[ Top ]

method get_error [line 137]

string get_error( )

Returns the archive creation error.

This function returns the contents of the error file that the archive process generated, and then deletes the error file.




Tags:

return:  The archive creation error.


[ Top ]

method get_error_file_path [line 250]

string get_error_file_path( )

Gets the error file path.

This function gets the path to the archive script error file. This is the file that will be created if the archive script generates an error. This function should be used to access the error file.




Tags:

return:  The path to the error file.


[ Top ]

method get_file_size [line 173]

string get_file_size( )

Gets the size of the downloadable file.

This function gets the size of the file which the user is offered to download. It converts the number of bytes into a human readable form.




Tags:

return:  The human readable size of the downloadable file.


[ Top ]

method get_md5_sum [line 198]

string get_md5_sum( )

Gets the md5 sum of the downloadable file.

This function computes the md5 sum of the file which the user is offered to download.




Tags:

return:  md5 sum of the file.


[ Top ]

method get_temp_file_path [line 225]

string get_temp_file_path( )

Gets the temporary file path.

This function gets the path to the temporary archive which is being created by the archiving script. This is the archive that will continue to grow in size, and eventually it will be moved to the download directory. This function should be used to access the temporary file.




Tags:

return:  The path to the temporary file.


[ Top ]

method get_temp_file_size [line 186]

string get_temp_file_size( )

Gets the current size of the archive being created.

This function gets the current size of the archive which is being created by the archive script. It returns converts the number of bytes of the archive into a human readable form.




Tags:

return:  The human readable size of the archive being created.


[ Top ]

method is_available [line 163]

TRUE|FALSE is_available( )

Check if file is available for download.

This function checks the file system to see if the file that was being compressed is ready for downloading.




[ Top ]

method is_compressing [line 153]

TRUE|FALSE is_compressing( )

Check file compression status.

This function is called to check if the file requested is already being compressed.




[ Top ]

method is_error [line 127]

TRUE|FALSE is_error( )

Checks for an archive creation error.

This function checks for a file which contains errors from the archive script. If there is an error file, it returns TRUE.




[ Top ]

method prepare [line 62]

TRUE|FALSE prepare( integer $number, integer $days_per_file)

Prepares the download object instance.

The prepare method needs to be called before any other methods are called in order to set up the download class instance. The function will return FALSE if it can't find the files or the types array.




Parameters:

integer   $number   The file number
integer   $days_per_file   Number of days in each file

[ Top ]


Documentation generated on Tue, 23 Jan 2007 22:57:47 -0500 by phpDocumentor 1.3.0RC6