-
-
Notifications
You must be signed in to change notification settings - Fork 97
Call to undefined function cal_days_in_month() #317
Comments
So it seems that PHP needs to be built with calendar support enabled. I try to avoid adding too many extensions to support third party plugins. Once I start every plugin author wants a slightly different PHP set up. :) However... Adding calendar support to a time tracking app seems justified. I'll add it to the todo list, it's not a massive change. I'll try and get it done soon-ish. |
Yeah or the method is replaced by a one line solution from php.net:
@tobybatch I never needed any of those method in over 10 years of development around Kimai... I checked a couple of systems, they all have calendar compiled in, so it is not a very exotic extension. BUT: Kimai composer does not require it. And it is not mentioned in the Store page. Not saying that you should not add that extension, but blindly requiring new PHP extensions in a paid extension and then relying on the community to fix that problem is not "best practice". I emailed the author. |
@kevinpapst Yeah, I saw that too. It's being used by the I'll look when I get time. |
Hi @tobybatch I'm the creator of the Red pill: I'll test the suggest function of Kevin or find an other solution Hope you are a Matrix fan, too and get the reference 😉 |
@tobybatch Adding the extension seam to be straight forward.
And adding in the
Is this right? |
@csageder Yes that's totally right. I just wonder if the better solution isn't to remove the dependency on a custom php compilation in the plugin, using Kevin's solution. I don't mean to be an arse, but each extension has some size to it:
and in if I build this one in then the next extension that need a custom build wants that one built in too and I may just as well build all ~60 of the extensions into the image. Let me check with the other repo maintainers. |
You could extend our image if you need a custome ext. Something like # apache debian php extension base
FROM php:8.0.10-apache-buster AS apache-php-ext-base
RUN apt-get update
RUN apt-get install -y \
libldap2-dev \
libicu-dev \
libpng-dev \
libzip-dev \
libxslt1-dev \
libfreetype6-dev
# php extension calendar
FROM apache-php-ext-base AS php-ext-cal
RUN docker-php-ext-install -j$(nproc) calendar
# PHP extension calendar
FROM kimai/kimai2:apache
COPY --from=php-ext-cal /usr/local/etc/php/conf.d/docker-php-ext-???.ini /usr/local/etc/php/conf.d/docker-php-ext-???.ini
COPY --from=php-ext-cal /usr/local/lib/php/extensions/no-debug-non-zts-20200930/???.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/???.so This isn't tested but should work. |
@Schrolli91 @jokay Opinions please?
Pro:
Con:
|
Users with special needs should create their own images - they can use this repo as base. IMHO |
@tobybatch I'm sorry but I have very limited time and can't support the Docker image developmenet for kimai2 anymore. For this case, I would say the same as @Schrolli91.
or
|
@tobybatch |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The problem persists with the latest stable release: Is there any step by step guide to resolve it or (better) a Docker image that fixes the problem? |
Can you open a new ticket please with all the relevant info, docker command, files, logs etc. This is a closed issue. |
Describe the bug
I have installed the newest version of the Controlling Plugin. This Plugin uses the php function
cal_days_in_month()
.To Reproduce
Steps to reproduce the behaviour:
php -a
echo cal_days_in_month(CAL_GREGORIAN, 8, 2003);
Desktop (please complete the following information):
Command used to run the container
Additional context
Function should work for php 4.1+ onwards: https://www.w3schools.com/php/func_cal_cal_days_in_month.asp
The text was updated successfully, but these errors were encountered: