Skip to content

Commit e2ca202

Browse files
committed
支持5.1版本
1 parent 107bc89 commit e2ca202

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
],
1616
"require": {
1717
"overtrue/pinyin": "~4.0",
18-
"topthink/framework": "6.0.*"
18+
"topthink/framework": "6.0.*|5.1.*"
1919
},
2020
"autoload": {
2121
"psr-4": {

src/helpers.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<?php
22
use Overtrue\Pinyin\Pinyin;
33

4+
// 兼容 5.1 版本
5+
if (strpos(\think\App::VERSION, '5.1') !== false) {
6+
bind('pinyin', Pinyin::class);
7+
}
8+
49
if (!function_exists('pinyin')) {
510
/**
611
* Get the Pinyin of given string.

0 commit comments

Comments
 (0)