Php --calendar support?


(R Magauran) #1

I just spun up a “flex” docker trying to get the basic mobile interface up. It requires php to be compiled with calendar support. Yet when I try to run functions such as:
cal_days_in_month()
cal_to_jd()
jddayofweek()
jdmonthname()

the error.log fills up:

[Mon Jul 01 16:14:10.879732 2019] [php7:error] [pid 570] [client 172.27.0.1:45516] PHP Fatal error: Uncaught Error: Call to undefined function cal_days_in_month() in /var/www/localhost/htdocs/openemr/interface/main/mobile/m_cal.php:82\nStack trace:\n#0 {main}\n thrown in /var/www/localhost/htdocs/openemr/interface/main/mobile/m_cal.php on line 82, referer: https://localhost:9300/interface/main/mobile/camera.php?v=5cda1937135bb65cf362ec24868626e9

Yet phpinfo() says it was compiled "–enable-calendar=shared’ " with calendar support.

bash-4.4# php -v
PHP 7.2.19 (cli) (built: Jun 14 2019 18:21:33) ( NTS )
Copyright © 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright © 1998-2018 Zend Technologies

Any ideas where I am going wrong?


(Stephen Waite) #2

don’t think it’s included in the docker build so try
apk add php7-calendar


(R Magauran) #3

Perfect. Restarted containers and we are up and running.
Thank you!


(Brady Miller) #4

hi @rmagauran ,
Is this php extension something that you are planning to need in future code. Asking because now would be the time to add it to the dockers before the release (in case we bring in a patch in the future that needs this extension); just let me know and I can add it.
Thanks,
-brady


(R Magauran) #5

Yes. I suspect that there will a more elegant way to approach mobile but the first iteration will need it. When a full mobile interface is deployed then maybe not…


(Brady Miller) #6

hi @rmagauran , I added this php extension to the docker environments. -brady