clemens-tolboom / uml-generator-php

http://clemens-tolboom.github.io/uml-generator-php/
MIT License
44 stars 5 forks source link

Exception with text '"@0" is not a valid date.' #66

Closed smelukov closed 9 years ago

smelukov commented 9 years ago

./uml-generator-php generate:json /path/to/sources /path/to/docs

RESOLVED as reported by @rossillingworth

you need to see your php.ini date.timezone

smelukov commented 9 years ago

1111

clemens-tolboom commented 9 years ago

Cannot reproduce. I just ran

cd /tmp
git clone git@github.com:clemens-tolboom/uml-generator-php.git
cd uml-generator-php
uml-generator-php generate:json src/ /tmp/test

Please try the above.

rossillingworth commented 9 years ago

I get the same problem... here is the verbose output using php 5.5.18

[rillingworth@linux uml-generator-php]$ php bin/uml-generator-php --verbose generate:json src/ /tmp/test

[InvalidArgumentException]
"@0" is not a valid date.

Exception trace: () at /home/rillingworth/tools/uml-generator-php/vendor/symfony/finder/Symfony/Component/Finder/Comparator/DateComparator.php:38 Symfony\Component\Finder\Comparator\DateComparator->__construct() at /home/rillingworth/tools/uml-generator-php/vendor/symfony/finder/Symfony/Component/Finder/Finder.php:239 Symfony\Component\Finder\Finder->date() at /home/rillingworth/tools/uml-generator-php/src/Command/JsonCommand.php:90 UmlGeneratorPhp\Command\JsonCommand->execute() at /home/rillingworth/tools/uml-generator-php/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252 Symfony\Component\Console\Command\Command->run() at /home/rillingworth/tools/uml-generator-php/vendor/symfony/console/Symfony/Component/Console/Application.php:874 Symfony\Component\Console\Application->doRunCommand() at /home/rillingworth/tools/uml-generator-php/vendor/symfony/console/Symfony/Component/Console/Application.php:195 Symfony\Component\Console\Application->doRun() at /home/rillingworth/tools/uml-generator-php/vendor/symfony/console/Symfony/Component/Console/Application.php:126 Symfony\Component\Console\Application->run() at /home/rillingworth/tools/uml-generator-php/bin/uml-generator-php:14

generate:json [-s|--skip="..."] [-o|--only="..."] input output

rossillingworth commented 9 years ago

I have found the cause of the problem.

I have a new install of PHP5.5.18, and had yet to set the 'date.timezone'. I kept getting annoying warning about timezone defaulting to UTC when I run php -i.

PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0

Once I fixed this, uml-generator-php then ran without any problem. ie: edit date.timezone in php.ini.

clemens-tolboom commented 9 years ago

I've updated the initial question. So all clear. Thanks @rossillingworth for your answer.