noalyss  Version-6.7.2
Public Member Functions | Data Fields | Private Member Functions
FileToSend Class Reference

file to add to a message More...

Public Member Functions

 __construct ($p_filename, $p_type="")
 compute_name ($p_filename)
 Compute properly the filename.

Data Fields

 $filename
 name of the file without path
 $full_name
 Path to filename + filename.
 $path
 path
 $type
 mimetype of the file

Private Member Functions

 guess_type ()
 set the $this->type to the mimetype, called from __construct

Detailed Description

file to add to a message

See also:
Sendmail
Author:
dany

Definition at line 26 of file class_filetosend.php.


Constructor & Destructor Documentation

FileToSend::__construct ( p_filename,
p_type = "" 
)

Definition at line 44 of file class_filetosend.php.

References guess_type().

    {
        $this->full_name=$p_filename;
        if (strpos($p_filename,'/') != false)
        {
            $this->path=dirname($p_filename);
        }
        $this->filename=basename ($p_filename);
        if ( $p_type=="")
        {
            $this->guess_type();
            
        }
    }

Member Function Documentation

FileToSend::compute_name ( p_filename)

Compute properly the filename.

Todo:
compute a filename

Definition at line 91 of file class_filetosend.php.

    {
        /**
         * @todo compute a filename
         */
    }
FileToSend::guess_type ( ) [private]

set the $this->type to the mimetype, called from __construct

Definition at line 61 of file class_filetosend.php.

References $ext, and type.

Referenced by __construct().

    {
        $ext_pos=  strrpos($this->filename,'.');
        if ( $ext_pos == false ) {
            $this->type="application/octect";
            return;
        }
        $ext=  substr($this->filename, $ext_pos+1, 3);
        switch ($ext)
        {
            case 'odt':
                $this->type='application/vnd.oasis.opendocument.text';
                break;
            case 'ods':
                $this->type='application/vnd.oasis.opendocument.spreadsheet';
                break;
            case 'pdf':
                $this->type="application/pdf";
                break;
            case 'zip':
                $this->type="application/zip";
                break;
            default:
                $this->type="application/octet";
        }
        
    }

Field Documentation

FileToSend::$filename

name of the file without path

Definition at line 31 of file class_filetosend.php.

FileToSend::$full_name

Path to filename + filename.

Definition at line 43 of file class_filetosend.php.

FileToSend::$path

path

Definition at line 39 of file class_filetosend.php.

FileToSend::$type

mimetype of the file

Definition at line 35 of file class_filetosend.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations