2. php - phpDocumentor - インストール

 
2.1 概要
2.2 phpDocumentor インストール
2.3 必要なモジュール
2.4 GraphViz インストール

2.1 概要

 実は、前節でインストールした「PHP Universal Feed Generator」のドキュメントを抜き出したかったのです。  当然、composer を使うのがよろしいようで。

2.2 phpDocumentor インストール

 参考サイトの通りにやってみます。  既に

/作業ディレクトリ/
 の配下には「PHP Universal Feed Generator」が展開されています。

> cd /作業ディレクトリ/
> composer require --dev phpdocumentor/phpdocumentor
Using version ^2.9 for phpdocumentor/phpdocumentor
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 54 installs, 0 updates, 0 removals
  - Installing zetacomponents/base (1.9.1): Downloading (100%)

・・・	略	・・・

  - Installing cilex/cilex (1.1.0): Downloading (100%)
  - Installing phpdocumentor/phpdocumentor (v2.9.0): Downloading (100%)
zendframework/zend-servicemanager suggests installing ocramius/proxy-manager (ProxyManager 0.5.* to handle lazy initialization of services)

・・・	略	・・・

phpdocumentor/phpdocumentor suggests installing ext-xslcache (Enabling the XSLCache extension improves the generation of xml based templates.)
Package kherge/version is abandoned, you should avoid using it. No replacement was suggested.
Package herrera-io/json is abandoned, you should avoid using it. Use kherge/json instead.
Package herrera-io/phar-update is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
 なんだかとてもたくさんのものがインストールされたようです。

2.3 必要なモジュール

 話が前後しますが・・・。  php-composer を単体で pkg でインストールしたもので

> pkg install php72-composer
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 12 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        php72-composer: 1.6.5
        php72-ctype: 7.2.10
        php72: 7.2.10
        libargon2: 20171227_1
        php72-openssl: 7.2.10
        php72-filter: 7.2.10
        php72-json: 7.2.10
        php72-intl: 7.2.10
        php72-mbstring: 7.2.10
        oniguruma: 6.8.1
        php72-phar: 7.2.10
        php72-hash: 7.2.10

Number of packages to be installed: 12

・・・	以下略	・・・
 phpdocumentor/phpdocumentor をインストールしようとすると(openpsa/universalfeedcreator はすんなりインストールできました)

 composer require --dev phpdocumentor/phpdocumentor
Using version ^2.9 for phpdocumentor/phpdocumentor
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - nikic/php-parser v1.4.1 requires ext-tokenizer * -> the requested PHP extension tokenizer is missing from your system.

・・・	略	・・・

  To enable extensions, verify that they are enabled in your .ini files:
    -
    - /usr/local/etc/php/ext-20-ctype.ini

・・・	略	・・・

    - /usr/local/etc/php/ext-30-phar.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Installation failed, reverting ./composer.json to its original content.
 てな感じで怒られちゃいました。  php-tokenizer が必要なのですね。

> pkg install php72-tokenizer
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        php72-tokenizer: 7.2.10

Number of packages to be installed: 1

9 KiB to be downloaded.

Proceed with this action? [y/N]: y Enter
[1/1] Fetching php72-tokenizer-7.2.10.txz: 100%    9 KiB   9.0kB/s    00:01
Checking integrity... done (0 conflicting)
[1/1] Installing php72-tokenizer-7.2.10...
[1/1] Extracting php72-tokenizer-7.2.10: 100%
 この後は、うまくいきました。

2.4 GraphViz インストール

 次項へ移行して、舞い戻っています。  目的とすることには GraphViz が必要なようです。  そもそもあるのか?

> composer search graphviz
phpdocumentor/graphviz
clue/graph A mathematical graph/network library written in PHP
phpdocumentor/graphviz Wrapper for Graphviz
graphp/graphviz GraphViz graph drawing for mathematical graph/network
alom/graphviz Graphviz generation for PHP
spryker/graphviz Graphviz module
ddvzwzjm/finite-graphviz Visualisation of Finite state machines using DOT language
alecsammon/php-graphviz A php wrapper for GraphViz
osinet/grafizzi A GraphViz generator for PHP. PEAR Image_GraphViz rethought.
mediawiki/graph-viz Online DOT graph renderer and message sequence chart renderer
dcentrica/chainpoint-receiptviz-php Generate graphical representations of a Chainpoint receipt
bartlett/umlwriter Create UML class diagrams from your PHP source.
mamchenkov/cakephp-graphviz-models A tool to generate a graph of model relationships
innmind/graphviz Graphviz abstraction
badams/graphviz Temporary fork of alom/graphviz
marltu/finite-graphviz
 ん、phpdocumentor/graphviz ってのが一発目にひっかかっています。  composer.lock を見てみると。

> cat composer.lock | grep phpdocumentor/graphviz
            "name": "phpdocumentor/graphviz",
                "phpdocumentor/graphviz": "~1.0",
 インストール済ってこと?  でまた、頭を抱えながら、次項へ引き返すわけだ。