Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Latest commit

 

History

History
31 lines (21 loc) · 759 Bytes

Intl.md

File metadata and controls

31 lines (21 loc) · 759 Bytes

CakePHP 3.4+ Intl拓展的简单替代

使用

安装

composer

composer require cakedc/intl --ignore-platform-reqs

在CakePHP中修改

在config/requirements.php中找到并注释

if (!extension_loaded('intl')) {
     trigger_error('You must enable the intl extension to use CakePHP.', E_USER_ERROR);
}

其他

在部分环境下,安装了该插件后使用CakePHP会报错误

PHP Fatal error: Cannot use IntlCalendar as IntlCalendar because the name is already in use in /vendor/cakedc/intl/src/IntlGregorianCalendar.php on line 14

这时候你需要注释掉/vendor/cakedc/intl/src/IntlGregorianCalendar.php文件中 use IntlCalendar;