XOOPS Docs - kernel
[ class tree: kernel ] [ index: kernel ] [ all elements ]

Source for file downloader.php

Documentation is available at downloader.php

  1. <?php
  2. // $Id: downloader.php 887 2007-07-28 08:54:53Z phppp $
  3. //  ------------------------------------------------------------------------ //
  4. //                XOOPS - PHP Content Management System                      //
  5. //                    Copyright (c) 2000 XOOPS.org                           //
  6. //                       <http://www.xoops.org/>                             //
  7. //  ------------------------------------------------------------------------ //
  8. //  This program is free software; you can redistribute it and/or modify     //
  9. //  it under the terms of the GNU General Public License as published by     //
  10. //  the Free Software Foundation; either version 2 of the License, or        //
  11. //  (at your option) any later version.                                      //
  12. //                                                                           //
  13. //  You may not change or alter any portion of this comment or credits       //
  14. //  of supporting developers from this source code or any supporting         //
  15. //  source code which is considered copyrighted (c) material of the          //
  16. //  original comment or credit authors.                                      //
  17. //                                                                           //
  18. //  This program is distributed in the hope that it will be useful,          //
  19. //  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
  20. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
  21. //  GNU General Public License for more details.                             //
  22. //                                                                           //
  23. //  You should have received a copy of the GNU General Public License        //
  24. //  along with this program; if not, write to the Free Software              //
  25. //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
  26. //  ------------------------------------------------------------------------ //
  27. // Author: Kazumi Ono (AKA onokazu)                                          //
  28. // URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
  29. // Project: The XOOPS Project                                                //
  30. // ------------------------------------------------------------------------- //
  31. /**
  32.  * Sends non HTML files through a http socket
  33.  * 
  34.  * @package     kernel
  35.  * @subpackage  core
  36.  * 
  37.  * @author        Kazumi Ono    <onokazu@xoops.org>
  38.  * @copyright    copyright (c) 2000-2003 XOOPS.org
  39.  */
  40. {
  41.  
  42.     /**#@+
  43.      * file information
  44.      */
  45.     var $mimetype;
  46.     var $ext;
  47.     var $archiver;
  48.     /**#@-*/
  49.  
  50.     /**
  51.      * Constructor
  52.      */
  53.     function XoopsDownloader()
  54.     {
  55.         //EMPTY
  56.     }
  57.  
  58.     /**
  59.      * Send the HTTP header
  60.      * 
  61.      * @param    string  $filename 
  62.      * 
  63.      * @access    private
  64.      */
  65.     function _header($filename)
  66.     {
  67.         if (function_exists('mb_http_output')) {
  68.             mb_http_output('pass');
  69.         }
  70.         header('Content-Type: '.$this->mimetype);
  71.         if (preg_match("/MSIE ([0-9]\.[0-9]{1,2})/"$_SERVER['HTTP_USER_AGENT'])) {
  72.             header('Content-Disposition: attachment; filename="'.$filename.'"');
  73.             header('Expires: 0');
  74.             header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  75.             header('Pragma: public');
  76.         else {
  77.             header('Content-Disposition: attachment; filename="'.$filename.'"');
  78.             header('Expires: 0');
  79.             header('Pragma: no-cache');
  80.         }
  81.     }
  82.  
  83.     /**
  84.      * XoopsDownloader::addFile()
  85.      * 
  86.      * @param   string  $filepath 
  87.      * @param   string   $newfilename 
  88.      ***/
  89.     function addFile($filepath$newfilename=null)
  90.     {
  91.         //EMPTY
  92.     }
  93.  
  94.     /**
  95.      * XoopsDownloader::addBinaryFile()
  96.      * 
  97.      * @param   string  $filepath 
  98.      * @param   string  $newfilename 
  99.      ***/
  100.     function addBinaryFile($filepath$newfilename=null)
  101.     {
  102.         //EMPTY
  103.     }
  104.  
  105.     /**
  106.      * XoopsDownloader::addFileData()
  107.      * 
  108.      * @param   mixed     $data 
  109.      * @param   string    $filename 
  110.      * @param   integer   $time 
  111.      ***/
  112.     function addFileData(&$data$filename$time=0)
  113.     {
  114.         //EMPTY
  115.     }
  116.  
  117.     /**
  118.      * XoopsDownloader::addBinaryFileData()
  119.      * 
  120.      * @param   mixed   $data 
  121.      * @param   string  $filename 
  122.      * @param   integer $time 
  123.      ***/
  124.     function addBinaryFileData(&$data$filename$time=0)
  125.     {
  126.         //EMPTY
  127.     }
  128.  
  129.     /**
  130.      * XoopsDownloader::download()
  131.      * 
  132.      * @param   string  $name 
  133.      * @param   boolean $gzip 
  134.      ***/
  135.     function download($name$gzip true)
  136.     {
  137.         //EMPTY
  138.     }
  139. }
  140. ?>

XOOPS Docs generated by phpDocumentor