Установка phpDocumentor 2 с использованием Composer и PEAR - PullRequest
0 голосов
/ 24 января 2020

Я работаю над Ubuntu 18.04 с php версией 7.2.24 и хочу сделать свои первые шаги с phpdo c.

Для этого я хочу использовать composer. Я создал новую папку и вставил

composer require "phpdocumentor/phpdocumentor:2.*"

Это был вывод

$ composer require "phpdocumentor/phpdocumentor:2.*"
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 64 installs, 0 updates, 0 removals
  - Installing phpdocumentor/reflection-docblock (2.0.5): Loading from cache
  - Installing nikic/php-parser (v1.4.1): Loading from cache
  - Installing psr/log (1.1.2): Loading from cache
  - Installing phpdocumentor/reflection (3.0.1): Loading from cache
  - Installing symfony/finder (v2.8.52): Loading from cache
  - Installing phpdocumentor/fileset (1.0.0): Loading from cache
  - Installing phpdocumentor/graphviz (1.0.4): Loading from cache
  - Installing zendframework/zend-stdlib (2.7.7): Loading from cache
  - Installing zendframework/zend-hydrator (1.1.0): Loading from cache
  - Installing zendframework/zend-filter (2.9.2): Loading from cache
  - Installing psr/container (1.0.0): Loading from cache
  - Installing container-interop/container-interop (1.2.0): Loading from cache
  - Installing zendframework/zend-servicemanager (2.7.11): Loading from cache
  - Installing zendframework/zend-eventmanager (3.2.1): Loading from cache
  - Installing psr/simple-cache (1.0.1): Loading from cache
  - Installing psr/cache (1.0.1): Loading from cache
  - Installing zendframework/zend-cache (2.8.3): Loading from cache
  - Installing zendframework/zend-json (3.1.2): Loading from cache
  - Installing zendframework/zend-serializer (2.9.1): Loading from cache
  - Installing zendframework/zend-i18n (2.10.1): Loading from cache
  - Installing zendframework/zend-config (2.6.0): Loading from cache
  - Installing kherge/version (1.0.1): Loading from cache
  - Installing seld/jsonlint (1.7.2): Loading from cache
  - Installing justinrainbow/json-schema (1.6.1): Loading from cache
  - Installing herrera-io/json (1.0.3): Loading from cache
  - Installing herrera-io/phar-update (1.0.3): Loading from cache
  - Installing hoa/exception (1.17.01.16): Loading from cache
  - Installing hoa/event (1.17.01.13): Loading from cache
  - Installing hoa/consistency (1.17.05.02): Loading from cache
  - Installing hoa/visitor (2.17.01.16): Loading from cache
  - Installing hoa/ustring (4.17.01.16): Loading from cache
  - Installing hoa/protocol (1.17.01.14): Loading from cache
  - Installing hoa/zformat (1.17.01.10): Loading from cache
  - Installing hoa/iterator (2.17.01.10): Loading from cache
  - Installing hoa/compiler (3.17.08.08): Loading from cache
  - Installing hoa/regex (1.17.01.13): Loading from cache
  - Installing hoa/math (1.17.05.16): Loading from cache
  - Installing hoa/stream (1.17.02.21): Loading from cache
  - Installing hoa/file (1.17.07.11): Loading from cache
  - Installing doctrine/instantiator (1.3.0): Loading from cache
  - Installing doctrine/lexer (1.2.0): Loading from cache
  - Installing doctrine/annotations (v1.8.0): Loading from cache
  - Installing jms/metadata (2.1.0): Loading from cache
  - Installing jms/serializer (3.4.0): Loading from cache
  - Installing symfony/filesystem (v3.0.9): Loading from cache
  - Installing symfony/polyfill-ctype (v1.13.1): Loading from cache
  - Installing symfony/config (v2.8.52): Loading from cache
  - Installing symfony/stopwatch (v2.8.52): Loading from cache
  - Installing symfony/event-dispatcher (v2.8.52): Loading from cache
  - Installing zetacomponents/base (1.9.1): Loading from cache
  - Installing zetacomponents/document (1.3.1): Loading from cache
  - Installing symfony/process (v2.8.52): Loading from cache
  - Installing erusev/parsedown (1.7.4): Loading from cache
  - Installing twig/twig (v1.42.4): Loading from cache
  - Installing monolog/monolog (1.25.3): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.13.1): Loading from cache
  - Installing symfony/debug (v3.0.9): Loading from cache
  - Installing symfony/console (v2.8.52): Loading from cache
  - Installing symfony/translation (v3.0.9): Loading from cache
  - Installing symfony/validator (v2.8.52): Loading from cache
  - Installing pimple/pimple (v1.1.1): Loading from cache
  - Installing cilex/console-service-provider (1.0.0): Loading from cache
  - Installing cilex/cilex (1.1.0): Loading from cache
  - Installing phpdocumentor/phpdocumentor (v2.9.0): Loading from cache
phpdocumentor/reflection-docblock suggests installing dflydev/markdown (~1.0)
zendframework/zend-filter suggests installing psr/http-factory-implementation (psr/http-factory-implementation, for creating file upload instances when consuming PSR-7 in file upload filters)
zendframework/zend-filter suggests installing zendframework/zend-crypt (Zend\Crypt component, for encryption filters)
zendframework/zend-filter suggests installing zendframework/zend-uri (Zend\Uri component, for the UriNormalize filter)
zendframework/zend-servicemanager suggests installing ocramius/proxy-manager (ProxyManager 0.5.* to handle lazy initialization of services)
zendframework/zend-servicemanager suggests installing zendframework/zend-di (Zend\Di component)
zendframework/zend-cache suggests installing zendframework/zend-session (Zend\Session component)
zendframework/zend-cache suggests installing ext-apc (APC or compatible extension, to use the APC storage adapter)
zendframework/zend-cache suggests installing ext-apcu (APCU >= 5.1.0, to use the APCu storage adapter)
zendframework/zend-cache suggests installing ext-dba (DBA, to use the DBA storage adapter)
zendframework/zend-cache suggests installing ext-memcache (Memcache >= 2.0.0 to use the Memcache storage adapter)
zendframework/zend-cache suggests installing ext-memcached (Memcached >= 1.0.0 to use the Memcached storage adapter)
zendframework/zend-cache suggests installing ext-mongo (Mongo, to use MongoDb storage adapter)
zendframework/zend-cache suggests installing ext-mongodb (MongoDB, to use the ExtMongoDb storage adapter)
zendframework/zend-cache suggests installing ext-redis (Redis, to use Redis storage adapter)
zendframework/zend-cache suggests installing ext-wincache (WinCache, to use the WinCache storage adapter)
zendframework/zend-cache suggests installing ext-xcache (XCache, to use the XCache storage adapter)
zendframework/zend-cache suggests installing mongodb/mongodb (Required for use with the ext-mongodb adapter)
zendframework/zend-cache suggests installing mongofill/mongofill (Alternative to ext-mongo - a pure PHP implementation designed as a drop in replacement)
zendframework/zend-json suggests installing zendframework/zend-json-server (For implementing JSON-RPC servers)
zendframework/zend-json suggests installing zendframework/zend-xml2json (For converting XML documents to JSON)
zendframework/zend-serializer suggests installing zendframework/zend-math ((^2.6 || ^3.0) To support Python Pickle serialization)
zendframework/zend-i18n suggests installing zendframework/zend-i18n-resources (Translation resources)
zendframework/zend-i18n suggests installing zendframework/zend-validator (You should install this package to use the provided validators)
zendframework/zend-i18n suggests installing zendframework/zend-view (You should install this package to use the provided view helpers)
jms/serializer suggests installing symfony/yaml (Required if you'd like to use the YAML metadata format.)
jms/serializer suggests installing doctrine/collections (Required if you like to use doctrine collection types as ArrayCollection.)
jms/serializer suggests installing doctrine/cache (Required if you like to use cache functionality.)
symfony/config suggests installing symfony/yaml (To use the yaml reference dumper)
symfony/event-dispatcher suggests installing symfony/dependency-injection
symfony/event-dispatcher suggests installing symfony/http-kernel
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
symfony/translation suggests installing symfony/yaml
symfony/validator suggests installing doctrine/cache (For using the default cached annotation reader and metadata cache.)
symfony/validator suggests installing symfony/http-foundation
symfony/validator suggests installing symfony/intl
symfony/validator suggests installing symfony/yaml
symfony/validator suggests installing egulias/email-validator (Strict (RFC compliant) email validation)
symfony/validator suggests installing symfony/property-access (For using the 2.4 Validator API)
symfony/validator suggests installing symfony/expression-language (For using the 2.4 Expression validator)
cilex/cilex suggests installing symfony/yaml (>=1.0.0)
phpdocumentor/phpdocumentor suggests installing ext-twig (Enabling the twig extension improves the generation of twig based templates.)
phpdocumentor/phpdocumentor suggests installing ext-xslcache (Enabling the XSLCache extension improves the generation of xml based templates.)
Package zendframework/zend-stdlib is abandoned, you should avoid using it. Use laminas/laminas-stdlib instead.
Package zendframework/zend-hydrator is abandoned, you should avoid using it. Use laminas/laminas-hydrator instead.
Package zendframework/zend-filter is abandoned, you should avoid using it. Use laminas/laminas-filter instead.
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package zendframework/zend-servicemanager is abandoned, you should avoid using it. Use laminas/laminas-servicemanager instead.
Package zendframework/zend-eventmanager is abandoned, you should avoid using it. Use laminas/laminas-eventmanager instead.
Package zendframework/zend-cache is abandoned, you should avoid using it. Use laminas/laminas-cache instead.
Package zendframework/zend-json is abandoned, you should avoid using it. Use laminas/laminas-json instead.
Package zendframework/zend-serializer is abandoned, you should avoid using it. Use laminas/laminas-serializer instead.
Package zendframework/zend-i18n is abandoned, you should avoid using it. Use laminas/laminas-i18n instead.
Package zendframework/zend-config is abandoned, you should avoid using it. Use laminas/laminas-config instead.
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

Похоже, что есть проблемы с зависимостями.

Я не могу запустить phpdoc либо. Эта команда должна фактически показать мне сообщение об ошибке, говорящее, что я должен ввести параметры, верно? Но я вижу это сообщение:

$ vendor/bin/phpdoc 
PHP Fatal error:  Uncaught Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@JMS\Serializer\Annotation\Type" in property phpDocumentor\Configuration::$title does not exist, or could not be auto-loaded. in /home/astrid/git/mist/phpdoc/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:54
Stack trace:
#0 /home/git/mist/phpdoc/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(739): Doctrine\Common\Annotations\AnnotationException::semanticalError('The annotation ...')
#1 /home/git/mist/phpdoc/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(661): Doctrine\Common\Annotations\DocParser->Annotation()
#2 /home/git/mist/phpdoc/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(354): Doctrine\Common\Annotations\DocParser->Annotations()
#3 /home/git/mist/phpdoc/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php(250): Doctrine\Common\Annotation in /home/astrid/git/mist/phpdoc/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php on line 54

На самом деле, я ничего не сделал сам. Так что я ожидал, что это сработает.

Поскольку установка с composer не рекомендуется , я затем протестировал еще один тип установки через PEAR:

$ pear channel-discover pear.phpdoc.org
Discovering channel pear.phpdoc.org over http:// failed with message: channel-add: Cannot open "http://pear.phpdoc.org/channel.xml" (File http://pear.phpdoc.org:80/channel.xml not valid (received: HTTP/1.1 308 Permanent Redirect
))
Trying to discover channel pear.phpdoc.org over https:// instead
Error: Unable to create XML parser
Discovery of channel "pear.phpdoc.org" failed (channel-add: invalid channel.xml file)

Что я делаю не так?

...