File.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  8. // +----------------------------------------------------------------------+
  9. // | PHP Version 4 |
  10. // +----------------------------------------------------------------------+
  11. // | Copyright (c) 1997-2002 The PHP Group |
  12. // +----------------------------------------------------------------------+
  13. // | This source file is subject to version 2.02 of the PHP license, |
  14. // | that is bundled with this package in the file LICENSE, and is |
  15. // | available at through the world-wide-web at |
  16. // | http://www.php.net/license/2_02.txt. |
  17. // | If you did not receive a copy of the PHP license and are unable to |
  18. // | obtain it through the world-wide-web, please send a note to |
  19. // | license@php.net so we can mail you a copy immediately. |
  20. // +----------------------------------------------------------------------+
  21. // | Author: Xavier Noguer <xnoguer@php.net> |
  22. // | Based on OLE::Storage_Lite by Kawai, Takanori |
  23. // +----------------------------------------------------------------------+
  24. //
  25. // $Id: File.php,v 1.11 2007/02/13 21:00:42 schmidt Exp $
  26. /**
  27. * Class for creating File PPS's for OLE containers
  28. *
  29. * @author Xavier Noguer <xnoguer@php.net>
  30. * @category PHPExcel
  31. * @package PHPExcel_Shared_OLE
  32. */
  33. class PHPExcel_Shared_OLE_PPS_File extends PHPExcel_Shared_OLE_PPS
  34. {
  35. /**
  36. * The constructor
  37. *
  38. * @access public
  39. * @param string $name The name of the file (in Unicode)
  40. * @see OLE::Asc2Ucs()
  41. */
  42. public function __construct($name)
  43. {
  44. parent::__construct(null, $name, PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE, null, null, null, null, null, '', array());
  45. }
  46. /**
  47. * Initialization method. Has to be called right after OLE_PPS_File().
  48. *
  49. * @access public
  50. * @return mixed true on success
  51. */
  52. public function init()
  53. {
  54. return true;
  55. }
  56. /**
  57. * Append data to PPS
  58. *
  59. * @access public
  60. * @param string $data The data to append
  61. */
  62. public function append($data)
  63. {
  64. $this->_data .= $data;
  65. }
  66. /**
  67. * Returns a stream for reading this file using fread() etc.
  68. * @return resource a read-only stream
  69. */
  70. public function getStream()
  71. {
  72. $this->ole->getStream($this);
  73. }
  74. }