Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • components
        • events
          • default
      • controllers
      • models
    • components
      • auth
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • exchange
        • rates
          • foxrate
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
      • json
      • modules
      • net
        • http
        • net
          • amazon
            • s3
          • geo
            • ip
      • plugins
      • recaptcha
      • security
      • session
        • cart
      • settingscollection
      • upgrades
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
  • com
    • tecnick
      • tcpdf
        • blesta
          • components
            • invoice
              • templates
                • quickbooks
                  • invoice
                • templates
                  • default
  • Crypt
    • AES
    • DES
    • Hash
    • Random
    • RC4
    • Rijndael
    • RSA
    • TerraDES
  • File
    • ANSI
    • ASN1
    • X509
  • Math
    • BigInteger
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • html
      • xml
    • lib
  • Net
    • SFTP
    • SSH1
    • SSH2
  • None
  • PHP
  • PHPMailer
  • Services
    • JSON
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Download

Class Download

Download component

Simplifies the file download/stream process by setting the appropriate headers

Package: blesta\components\download
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at components/download/download.php

Methods summary

public
# __construct( mixed $encoding = "binary" )

Initializes the Download object, sets the default encoding

Initializes the Download object, sets the default encoding

public
# setEncoding( string $encoding )

Overrides the currently set file encoding

Overrides the currently set file encoding

Parameters

$encoding
string
$encoding The file encoding to set for all subsequent streams or downloads
public
# setContentType( mixed $content_type )

Overrides the currently set Content Type for this file

Overrides the currently set Content Type for this file

Parameters

$content_type
mixed
$content_type A numerically indexed array of content types to set, or a string containing the content type to set
public
# streamFile( string $file, string $file_name = null, string $send_mode = "file" )

Streams a file out to the standard output stream (e.g. a browser)

Streams a file out to the standard output stream (e.g. a browser)

Parameters

$file
string
$file The full path to the file name to be streamed
$file_name
string
$file_name The name to give the file being streamed (defaults to the real file name)
$send_mode
string
$send_mode The send mode for the file (file to send normally, xsendfile to send through mod_xsendfile)
public
# streamData( string $file_name, string $data )

Streams the given data to the standard output stream (e.g. a browser)

Streams the given data to the standard output stream (e.g. a browser)

Parameters

$file_name
string
$file_name The name of the file to be streamed
$data
string
$data The data to be streamed
public
# downloadFile( string $file, string $file_name = null, string $send_mode = "file" )

Forces download of a file

Forces download of a file

Parameters

$file
string
$file The full path to the file name to be downloaded
$file_name
string
$file_name The name to give the file being downloaded (defaults to the real file name)
$send_mode
string
$send_mode The send mode for the file (file to send normally, xsendfile to send through mod_xsendfile)
public
# downloadData( string $file_name, string $data )

Forces download of the given data

Forces download of the given data

Parameters

$file_name
string
$file_name The name of the file to be downloaded
$data
string
$data The data to be downloaded
private
# setHeader( string $field, string $value )

Sets a header

Sets a header

Parameters

$field
string
$field The name of the header to set
$value
string
$value The value of the header to set
private
# output( string $file, string $type )

Sends the file to the output stream and ends the request

Sends the file to the output stream and ends the request

Parameters

$file
string
$file The file path or data to output
$type
string
$type The type of $file (data, file, or xsendfile)

Magic methods summary

Properties summary

private string $encoding
#

The encoding used to deliver the file

The encoding used to deliver the file

private array $content_type
#

An array of content types to set when deliverying the file

An array of content types to set when deliverying the file

Blesta API documentation generated by ApiGen 2.8.0