-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call to undefined function PHP81_BC\strftime() #79
Comments
Hi Filippo, Thanks for reporting this. It's a breaking change introduced in fork. Fork now relies on Intl extension. But you made me realize that Int is not optional, it's mandatory due to So PHP version on your server must have php-intl installed. If your project is managed by composer, when switching to this fork, composer will install all necessary dependencies. Composer is a must have. Does your project use composer to manage deps?
Mine project runs on PHP 8.3 and is using this fork. No problems. Although, since I'm trying to get rid of cakephp2 dependency, I'm not using many features. Let me know if it answers your questions. |
Hi Kamil, thanks for taking the time to answer my questions. |
Hi @filippodona, I believe you do need to install it at the host/server level. On Debian-based systems (eg. Ubuntu), you'd need to run:
On Redhat-based systems:
Hope that helps! |
Hi Patrick, thank you very much for your contribution. This is my composer.json |
The message appears when this statement is used in a controller: |
@filippodona Make sure also that all dependencies required by fork are installed. Please provide error call stack + list of composer dependencies that are actually installed in your project. |
Hi Kamil, this is the error stack This is my composer.lock with all dependences installed (I rename it due to upload extensions restrictions) |
Composer has a command that outputs all installed dependencies with their version. |
This is the composer show command oputput: |
Looks good, so the package is there. Try to isolate the problem, and e.g. write a tiny script that loads |
Could this be a PHP81_BC namespace issue? |
If you run in your project I wonder if it's composer class mapping issue. |
I alway got In the autoload_static.php file there is no references to the PHP_81\strftime function. Could be a problem with the second level deps ? |
I had the same issue (apparently caused by my require APP . 'Vendor' . DS . 'autoload.php'; |
amazing @kitgrose your suggestion works fine! I have your same configuration (vendor-dir set to app/Vendor). |
Hi, Kamil I stumbled upon your repository because I'm looking for a way to make my project made in CakePHP2 work on PHP 8.
I followed all the documentation, the project is perfectly working on PHP 7.4, however updating the cakephp dependency using yours I continue to get this error Call to undefined function PHP81_BC\strftime(). In the documentation you write the following "In order to get rid of strftime() deprecation notices, it's required to switch to IntlDateFormatter class. This class is available in intl extension. Fork doesn't require it explicitly but to be able to use its functions Symfony ICU Polyfill is installed. To provide strftime behavior compatibility, PHP81_BC\strftime is used. PHP81_BC doesn't fully cover strftime, your code should work but there is a chance you'll get slightly different results." however I can't understand what exactly I have to do. Should I change my code and replace $this->Time->format with another syntax? Should I change some configuration? Would you be so kind as to help me? Also, could you tell me up to which PHP version your project is compatible (8.1, 8.2, 8.3)?
Thank you
The text was updated successfully, but these errors were encountered: