composerでphpwordをインストールしてみましょう。
まずはcomposer.jsonを編集して以下のように記述します。
1 2 3 4 5 6 |
{ "require": { "phpoffice/phpword": "v0.13.*" } } |
確認します。
1 2 3 4 5 6 7 |
# cat composer.json { "require": { "phpoffice/phpword": "v0.13.*" } } # |
compser.jsonを配置したディレクトリで以下のコマンドを実行します。
1 |
composer install |
やってみましょう。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# composer install Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 6 installs, 0 updates, 0 removals - Installing pclzip/pclzip (2.8.2): Downloading (100%) - Installing phpoffice/common (v0.2.6): Downloading (100%) - Installing zendframework/zend-stdlib (2.4.13): Downloading (100%) - Installing zendframework/zend-validator (2.4.13): Downloading (100%) - Installing zendframework/zend-escaper (2.4.13): Downloading (100%) - Installing phpoffice/phpword (v0.13.0): Downloading (100%) zendframework/zend-stdlib suggests installing zendframework/zend-eventmanager (To support aggregate hydrator usage) zendframework/zend-stdlib suggests installing zendframework/zend-serializer (Zend\Serializer component) zendframework/zend-stdlib suggests installing zendframework/zend-servicemanager (To support hydrator plugin manager usage) zendframework/zend-stdlib suggests installing zendframework/zend-filter (To support naming strategy hydrator usage) zendframework/zend-validator suggests installing zendframework/zend-db (Zend\Db component) zendframework/zend-validator suggests installing zendframework/zend-filter (Zend\Filter component, required by the Digits validator) zendframework/zend-validator suggests installing zendframework/zend-i18n (Zend\I18n component to allow translation of validation error messages as well as to use the various Date validators) zendframework/zend-validator suggests installing zendframework/zend-math (Zend\Math component) zendframework/zend-validator suggests installing zendframework/zend-resources (Translations of validator messages) zendframework/zend-validator suggests installing zendframework/zend-servicemanager (Zend\ServiceManager component to allow using the ValidatorPluginManager and validator chains) zendframework/zend-validator suggests installing zendframework/zend-session (Zend\Session component) zendframework/zend-validator suggests installing zendframework/zend-uri (Zend\Uri component, required by the Uri and Sitemap\Loc validators) phpoffice/phpword suggests installing ext-gd2 (Allows adding images) phpoffice/phpword suggests installing dompdf/dompdf (Allows writing PDF) Writing lock file Generating autoload files # echo $? 0 # |