Aucune description

installing.rst 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. .. _setup:
  2. Installing/configuring
  3. ======================
  4. Requirements
  5. ------------
  6. Mandatory:
  7. - PHP 5.3+
  8. - PHP `Zip <http://php.net/manual/en/book.zip.php>`__ extension
  9. - PHP `XML
  10. Parser <http://www.php.net/manual/en/xml.installation.php>`__
  11. extension
  12. Optional PHP extensions:
  13. - `GD <http://php.net/manual/en/book.image.php>`__
  14. - `XMLWriter <http://php.net/manual/en/book.xmlwriter.php>`__
  15. - `XSL <http://php.net/manual/en/book.xsl.php>`__
  16. Installation
  17. ------------
  18. There are two ways to install PHPWord, i.e. via
  19. `Composer <http://getcomposer.org/>`__ or manually by downloading the
  20. library.
  21. Using Composer
  22. ~~~~~~~~~~~~~~
  23. To install via Composer, add the following lines to your
  24. ``composer.json``:
  25. .. code-block:: json
  26. {
  27. "require": {
  28. "phpoffice/phpword": "dev-master"
  29. }
  30. }
  31. If you are a developer or if you want to help us with testing then fetch the latest branch for developers.
  32. Notice: All contributions must be done against the developer branch.
  33. .. code-block:: json
  34. {
  35. "require": {
  36. "phpoffice/phpword": "dev-develop"
  37. }
  38. }
  39. Manual install
  40. ~~~~~~~~~~~~~~
  41. To install manually, you change to the webserver directory of your file system .
  42. Then you have 2 possibilities.
  43. 1. `download PHPWord package from github <https://github.com/PHPOffice/PHPWord/archive/master.zip>`__.
  44. Extract the package and put the contents to your machine.
  45. 2. Alternatively you can use Git to install it:
  46. .. code-block:: console
  47. git clone https://github.com/PHPOffice/PHPWord.git
  48. To use the library, include ``src/PhpWord/Autoloader.php`` in your PHP script and
  49. invoke ``Autoloader::register``.
  50. .. code-block:: php
  51. require_once '/path/to/src/PhpWord/Autoloader.php';
  52. \PhpOffice\PhpWord\Autoloader::register();
  53. Using samples
  54. -------------
  55. After installation, you can browse and use the samples that we've
  56. provided, either by command line or using browser. If you can access
  57. your PHPWord library folder using browser, point your browser to the
  58. ``samples`` folder, e.g. ``http://localhost/PhpWord/samples/``.