我有一些問題讓phpdoc正常運行。被大部分生成的文檔成功,但我得到以下警告多次:PHPDocumentor日期問題警告
Warning: date(): 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 'America/Los_Angeles
' for 'PST/-8.0/no DST' instead in /Users/ben/bin/PhpDocumentor/phpDocumentor/Converter.inc on line 5064
和
Warning: strftime(): 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 'America/Los_Angeles
' for 'PST/-8.0/no DST' instead in PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
Smarty的警告,因爲它只是產生一個我可以很容易地從代碼中刪除時間戳在渲染文檔的模板頂部。沒什麼大不了的。 phpDocumentor中的第一個錯誤我不確定。似乎只是分配一個日期給Smarty的模板:
$templ->assign("date",date("r",time()));
也許我可以消除在Smarty模板和該行的所有的「日期」變量。
無論如何,這個警告也出現在生成的文檔中,並且索引頁僅顯示此警告。有什麼想法發生在這裏?我正在使用版本1.4.3,這裏是我的標誌/選項:
#!/usr/bin/env bash
phpdoc \
--title 'Asra Documentation' \
--directory library/Asra \
--target docs \
--defaultcategoryname Asra \
--defaultpackagename Asra \
--quiet on \
--output HTML:frames:phpedit
是的,這是確切的原因。 @Typeoneerror:這是PHP 5.3特有的問題,而不是您實際使用的PHP代碼。每次代碼調用使用默認時區設置的PHP函數時,您都可能遇到同樣的問題。 – kiamlaluno 2009-12-22 17:39:15
你們搖滾。我剛剛在phpdoc文件中添加了對date_default ..的調用。固定。 – typeoneerror 2009-12-22 17:56:01
如果您的error_reporting設置爲E_ALL,則也會發生PHP 5.2。 E_STRICT – djn 2009-12-22 17:57:28