File.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace PhpOffice\PhpSpreadsheet\Shared\OLE\PPS;
  3. // vim: set expandtab tabstop=4 shiftwidth=4:
  4. // +----------------------------------------------------------------------+
  5. // | PHP Version 4 |
  6. // +----------------------------------------------------------------------+
  7. // | Copyright (c) 1997-2002 The PHP Group |
  8. // +----------------------------------------------------------------------+
  9. // | This source file is subject to version 2.02 of the PHP license, |
  10. // | that is bundled with this package in the file LICENSE, and is |
  11. // | available at through the world-wide-web at |
  12. // | http://www.php.net/license/2_02.txt. |
  13. // | If you did not receive a copy of the PHP license and are unable to |
  14. // | obtain it through the world-wide-web, please send a note to |
  15. // | license@php.net so we can mail you a copy immediately. |
  16. // +----------------------------------------------------------------------+
  17. // | Author: Xavier Noguer <xnoguer@php.net> |
  18. // | Based on OLE::Storage_Lite by Kawai, Takanori |
  19. // +----------------------------------------------------------------------+
  20. //
  21. use PhpOffice\PhpSpreadsheet\Shared\OLE;
  22. use PhpOffice\PhpSpreadsheet\Shared\OLE\PPS;
  23. /**
  24. * Class for creating File PPS's for OLE containers.
  25. *
  26. * @author Xavier Noguer <xnoguer@php.net>
  27. *
  28. * @category PhpSpreadsheet
  29. */
  30. class File extends PPS
  31. {
  32. /**
  33. * The constructor.
  34. *
  35. * @param string $name The name of the file (in Unicode)
  36. *
  37. * @see OLE::ascToUcs()
  38. */
  39. public function __construct($name)
  40. {
  41. parent::__construct(null, $name, OLE::OLE_PPS_TYPE_FILE, null, null, null, null, null, '', []);
  42. }
  43. /**
  44. * Initialization method. Has to be called right after OLE_PPS_File().
  45. *
  46. * @return mixed true on success
  47. */
  48. public function init()
  49. {
  50. return true;
  51. }
  52. /**
  53. * Append data to PPS.
  54. *
  55. * @param string $data The data to append
  56. */
  57. public function append($data)
  58. {
  59. $this->_data .= $data;
  60. }
  61. }