phpdocumentor v2 --template cli option invalid - php

From the docs when I run the following command
phpdoc -d ../../src/ -t /tmp/domain-model-docs --template="responsive-twig"
I get this error
ERROR: Unknown command-line option "--template=responsive-twig" encountered, use phpdoc -h for help
ERROR: Unknown command-line option "--template=responsive-twig" encountered, use phpdoc -h for help
The docs state
$ phpdoc -d "./src" -t "./docs/api" --template="clean"
However, in the help that option does not exist (phpdoc -h).
Has it been renamed?

After more work & investigation, I got the following error...
vagrant#packer-ubuntu-13:/var/www/opg-core-back-end$ vendor/bin/phpdoc.php
PHP Fatal error: Class 'Monolog\ErrorHandler' not found in /var/www/opg-core-back-end/vendor/phpdocumentor/phpdocumentor/src/phpDocumentor/Application.php on line 131
PHP Stack trace:
PHP 1. {main}() /var/www/opg-core-back-end/vendor/phpdocumentor/phpdocumentor/bin/phpdoc.php:0
PHP 2. phpDocumentor\Application->__construct() /var/www/opg-core-back-end/vendor/phpdocumentor/phpdocumentor/bin/phpdoc.php:26
PHP 3. phpDocumentor\Application->addLogging() /var/www/opg-core-back-end/vendor/phpdocumentor/phpdocumentor/src/phpDocumentor/Application.php:57
Then I found out that monolog was an older version due to the ElasticSearch client after specifying phpdocumentor to use v2.3 rather than v2.* in composer & got this error...
our requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for elasticsearch/elasticsearch 0.4.0 -> satisfiable by elasticsearch/elasticsearch[v0.4.0].
- phpdocumentor/phpdocumentor v2.3.0 requires monolog/monolog ~1.6 -> satisfiable by monolog/monolog[1.6.0, 1.7.0, 1.8.0, 1.8.x-dev].
- Can only install one of: monolog/monolog[1.6.0, 1.5.0].
- Can only install one of: monolog/monolog[1.7.0, 1.5.0].
- Can only install one of: monolog/monolog[1.8.0, 1.5.0].
- Can only install one of: monolog/monolog[1.8.x-dev, 1.5.0].
- elasticsearch/elasticsearch v0.4.0 requires monolog/monolog 1.5.0 -> satisfiable by monolog/monolog[1.5.0].
- Installation request for phpdocumentor/phpdocumentor 2.3 -> satisfiable by phpdocumentor/phpdocumentor[v2.3.0].
To generate the class diagram, I temporary removed ElasticSearch dependency from composer. Not a long term solution, but allowed me to get the domain model diagram.

Related

Your requirements could not be resolved to an installable set of packages (phpseclib/bcmath_compat)

I don't understand this error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- don't install phpseclib/bcmath_compat 1.0.3|don't install php 7.3.13
- composer.json/composer.lock requires php 7.3.* -> satisfiable by php[7.3.13].
- Installation request for phpseclib/bcmath_compat 1.0.3 -> satisfiable by phpseclib/bcmath_compat[1.0.3].
I'm running PHP 7.3.13.
Any ideas?
This is basically a new requirement of a package that was recently updated, for which your app has a loose version requirement.
A simple (albeit temporary) fix for it would be to make use of Composer's require inline alias
TL;DR: Assuming you're trying to install a Laravel product, just run this at the root of your project:
composer require moontoast/math "1.1.2 as 1.999.999"

php symfony error mongoDB

I have problem with configuration MongoDB Symfony
Program doesnt see class \MongoDbBudle\ to I went to Tools ->
Composer -> add -> "doctrine/mongodb-odm". I tried to install it but I saw error:
C:\wamp64\bin\php\php7.0.10\php.exe C:\Users\Root\PhpstormProjects\untitled2\composer.phar require doctrine/mongodb-odm:1.2.x-dev -n --no-progress
./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
- Removal request for alcaeus/mongo-php-adapter == 1.1.9999999.9999999-dev
- Removal request for alcaeus/mongo-php-adapter == 9999999-dev
- doctrine/mongodb-odm 1.2.x-dev requires doctrine/mongodb ^1.4.0 -> satisfiable by doctrine/mongodb[1.4.0].
- doctrine/mongodb 1.4.0 requires ext-mongo ^1.5 -> satisfiable by alcaeus/mongo-php-adapter[1.1.x-dev, dev-master].
- Installation request for doctrine/mongodb-odm 1.2.x-dev -> satisfiable by doctrine/mongodb-odm[1.2.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- C:\wamp64\bin\php\php7.0.10\php.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.ini seems to be ok. I added dynamic extension mongo-dll:
http://pastebin.com/bfb34A0s
Please help me how to solve this problem.
Using ODM with PHP 7 is a bit trickier than it should, please check if adding
"provide": {
"ext-mongo": "1.6.14"
}
to your project's composer.json would solve the issue. Otherwise you can see full chapter on how to use ODM with PHP 7 in the official documentation

Symfony startup

I need help with creating a symfony project in ubuntu/eclipse i get a lot of warnings. i Use:
ubuntu: 15.04
eclipse: 4.5.0 mars
symfony feature: 1.1.0.20150705
I use Symfony Feature to create projects using a built in wizard.
Project details:
PHP version: 5.6
Symfony version: v2.7.3
Override composer.jason values: i use defaults
i get errors with app/bootstrap.php.cache
Maybe there is a good tutorial that might help me, but 'till now i haven't found one...
Maybe elipse isn't good for symfony project.
Here are some error messages:
!ENTRY com.dubture.composer.core 4 4 2015-08-06 20:49:38.196
!MESSAGE PHP Warning: require_once(/var/www/test3/app/bootstrap.php.cache): failed to open stream: No such file or directory in /var/www/test3/app/console on line 10
PHP Fatal error: require_once(): Failed opening required '/var/www/test3/app/bootstrap.php.cache' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/test3/app/console on line 10
and second
!ENTRY com.dubture.composer.core 4 4 2015-08-06 20:50:29.267
!MESSAGE Installing symfony/framework-standard-edition (v2.7.2)
- Installing symfony/framework-standard-edition (v2.7.2)
Loading from cache
Created project in test1
> SymfonyStandard\Composer::hookRootPackageInstall
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for sensiolabs/security-checker v2.0.5 -> satisfiable by sensiolabs/security-checker[v2.0.5].
- sensiolabs/security-checker v2.0.5 requires ext-curl * -> the requested PHP extension curl is missing from your system.
Problem 2
- sensiolabs/security-checker v2.0.5 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- sensio/distribution-bundle v4.0.0 requires sensiolabs/security-checker ~2.0 -> satisfiable by sensiolabs/security-checker[v2.0.5].
- Installation request for sensio/distribution-bundle v4.0.0 -> satisfiable by sensio/distribution-bundle[v4.0.0].
thats a piece of the whole log file, those are the messages i get in gui.
Composer installation failed with an error (see second set of error messages) because it could not install all dependencies.
It says in the error message:
the requested PHP extension curl is missing from your system.
You need to install this extension for PHP to get all required files to get your project up and running.
When Symfony2 starts up, it need some of bootstrap cookies which will be removed, eventually. From my experience, 'bootstrap.php.cache' file existed for ACME bundle example pages, and It is not essential file.
The solution is simple.
You just need to create 'bootstrap.php.cache' file in /var/www/test3/app/ folder. The content of 'bootstrap.php.cache' can be blank.
touch bootstrap.php.cache
Hope this works well for you. Good luck!
It's possible that, you don't have right permission for read in these file, check this sudo chmod 755 in these file. If you haven't that file, create it how suggests YONGSOO KIM
The solution is simple. You just need to create bootstrap.php.cache
file in /var/www/test3/app/ folder. The content of bootstrap.php.cache
can be blank.
You can fix problem with versions of package sensiolabs/security-checker or generate bootstrap cache file like answer here https://stackoverflow.com/a/6884027/4356973

phpunit and CodeCoverage

I'm running a vagrant box w/ a simple lamp stack. I've installed phpunit globally via composer :
composer global require "phpunit/phpunit=4.1.*"
When I run phpunit I get the following error:
PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/share/php/PHPUnit/Autoload.php on line 46
HP Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='/home/vagrant/.composer/vendor/phpunit/php-text-template:/home/vagrant/.composer/vendor/phpunit/phpunit-mock-objects:/home/vagrant/.composer/vendor/phpunit/php-timer:/home/vagrant/.composer/vendor/phpunit/php-token-stream:/home/vagrant/.composer/vendor/phpunit/php-file-iterator:/home/vagrant/.composer/vendor/phpunit/php-code-coverage:/home/vagrant/.composer/vendor/phpunit/phpunit:/home/vagrant/.composer/vendor/symfony/yaml:.:/usr/share/php:/usr/share/pear') in /usr/share/php/PHPUnit/Autoload.php on line 46
My research seems to imply that it's a problem with CodeCoverage not installing, but I'm having problems trying to get that installed. I've tried to install via composer and can't get it working.
Via Composer, I've tried adding to the global:
composer global require "phpunit/php-code-coverage": "3.0.*#dev"
and I get this output:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package phpunit/php-code-coverage could not be found in any version, there may be a typo in the package name.
Problem 2
- phpunit/phpunit 4.1.3 requires phpunit/php-code-coverage ~2.0 -> no matching package found.
- phpunit/phpunit 4.1.3 requires phpunit/php-code-coverage ~2.0 -> no matching package found.
- Installation request for phpunit/phpunit == 4.1.3.0 -> satisfiable by phpunit/phpunit[4.1.3].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
No clue what I'm doing wrong!
you need to reinstall code-coverage 2.0 first
composer global require "phpunit/php-code-coverage":"2.0.*#dev"
then you install phpunit
composer global require "phpunit/phpunit=4.1.*"

zend framework 2 composer.php

when I try to install webino-image-thumb using zend php composer it gave me this error
php composer.phar require webino/webino-image-thumb:2.*<br/>
./composer.json has been updated<br/>
Loading composer repositories with package information<br/>
Ignoring unknown parameter "server role"<br/>
Updating dependencies (including require-dev)<br/>
Your requirements could not be resolved to an installable set of packages.<br/><br/>
Problem 1<br/>
- Can only install one of: zf-commons/zfc-admin[v0.1.0, dev-master].<br/>
- Can only install one of: zf-commons/zfc-admin[v0.1.0, dev-master].<br/>
- Installation request for zf-commons/zfc-admin 0.1.0 -> satisfiable by zf-commons/zfc-admin[v0.1.0].<br/>
- Installation request for zf-commons/zfc-admin == 9999999-dev -> satisfiable by zf-commons/zfc-admin[dev-master].<br/>Any help<br/>Lanka
Just replace "webino/webino-image-thumb":"2.*" by "webino/webino-image-thumb":"1.*"
Composer filters packages by stability and by default it requires a minimum stability of stable. You can change this to RC since webino-image-thumb is 2.0.0-RC1 at the time of writing this or just use the 1.* stable release. Check the doc here

Categories