faq.rst 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .. _faq:
  2. Frequently asked questions
  3. ==========================
  4. Is this the same with PHPPowerPoint that I found in CodePlex?
  5. -------------------------------------------------------------
  6. No. This one is much better with tons of new features that you can’t
  7. find in PHPPowerPoint 0.1. The development in CodePlex is halted and
  8. switched to GitHub to allow more participation from the crowd. The more
  9. the merrier, right?
  10. I’ve been running PHPPowerPoint from CodePlex flawlessly, but I can’t use the latest PHPPresentation from GitHub. Why?
  11. --------------------------------------------------------------------------------------------------------------------
  12. PHPPresentation requires PHP 5.3+ since 0.2, while PHPPowerPoint 0.1 from CodePlex
  13. can run with PHP 5.2. There’s a lot of new features that we can get from
  14. PHP 5.3 and it’s been around since 2009! You should upgrade your PHP
  15. version to use PHPPresentation 0.2+.
  16. Why am I getting a class not found error?
  17. -----------------------------------------
  18. If you have followed the instructions for either adding this package to your
  19. ``composer.json`` or registering the autoloader, then perhaps you forgot to
  20. include a ``use`` statement for the class(es) you are trying to access.
  21. Here's an example that allows you to refer to the ``MemoryDrawing`` class
  22. without having to specify the full class name in your code:
  23. .. code-block:: php
  24. use PhpOffice\PhpPresentation\Shape\MemoryDrawing as MemoryDrawing;
  25. If you *have* followed the installation instructions and you *have* added
  26. the necessary ``use`` statements to your code, then maybe you are still
  27. referencing the ``PHPPowerPoint`` classes using the old PEAR/PSR-0 approach.
  28. The 0.1 approach to naming classes used verbose class names to avoid
  29. namespace collisions with other libraries. For example, the ``MemoryDrawing``
  30. class was actually called ``PHPPowerPoint_Shape_MemoryDrawing``. Version
  31. 0.2 of the library renamed the classes, moved to a namespaced approach
  32. and switched to the PSR-0 autoloader. Interestingly, old code that was
  33. still referencing classes using the verbose approach *still worked* (which
  34. was pretty cool!). This is because the PSR-0 autoloader was correctly
  35. translating the verbose class references into the correct file name and
  36. location. However, ``PHPPowerPoint`` now relies exclusively on the PSR-4
  37. autoloader, so old code that may have been referencing the classes with
  38. the verbose class names will need to be updated accordingly.
  39. Why PHPPowerPoint become PHPPresentation ?
  40. ------------------------------------------
  41. As `Roman Syroeshko noticed us <https://github.com/PHPOffice/PHPPresentation/issues/25>`__, PowerPoint is a `trademark <http://www.microsoft.com/en-us/legal/IntellectualProperty/Trademarks/EN-US.aspx#332b86b0-befe-4b89-862e-d538e2a653e0>`__.
  42. For avoiding any problems with Microsoft, we decide to change the name to a more logic name, with our panel of readers/writers.