Skip to content

Commit

Permalink
[+]: "Use plain PHP for data maps to benefit from OPcache on PHP 5.6+"
Browse files Browse the repository at this point in the history
  • Loading branch information
voku committed Apr 28, 2016
1 parent b88a893 commit 41ed461
Show file tree
Hide file tree
Showing 19 changed files with 458 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/voku/helper/UTF8.php
Original file line number Diff line number Diff line change
Expand Up @@ -2620,9 +2620,10 @@ public static function getCharDirection($chr)
*/
protected static function getData($file)
{
$file = __DIR__ . '/data/' . $file . '.ser';
$file = __DIR__ . '/data/' . $file . '.php';
if (file_exists($file)) {
return unserialize(file_get_contents($file));
/** @noinspection PhpIncludeInspection */
return require $file;
} else {
return false;
}
Expand Down Expand Up @@ -4706,7 +4707,7 @@ public static function str_transliterate($str, $unknown = '?')
$bankfile = __DIR__ . '/data/' . sprintf('x%02x', $bank) . '.php';
if (file_exists($bankfile)) {
/** @noinspection PhpIncludeInspection */
include $bankfile;
require $bankfile;
} else {
$UTF8_TO_ASCII[$bank] = array();
}
Expand Down
222 changes: 222 additions & 0 deletions src/voku/helper/data/caseFolding_full.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
<?php

static $data = array (
0 =>
array (
0 => 'ß',
1 => 'İ',
2 => 'ʼn',
3 => 'ǰ',
4 => 'ΐ',
5 => 'ΰ',
6 => 'և',
7 => '',
8 => '',
9 => '',
10 => '',
11 => '',
12 => '',
13 => '',
14 => '',
15 => '',
16 => '',
17 => '',
18 => '',
19 => '',
20 => '',
21 => '',
22 => '',
23 => '',
24 => '',
25 => '',
26 => '',
27 => '',
28 => '',
29 => '',
30 => '',
31 => '',
32 => '',
33 => '',
34 => '',
35 => '',
36 => '',
37 => '',
38 => '',
39 => '',
40 => '',
41 => '',
42 => '',
43 => '',
44 => '',
45 => '',
46 => '',
47 => '',
48 => '',
49 => '',
50 => '',
51 => '',
52 => '',
53 => '',
54 => '',
55 => '',
56 => '',
57 => '',
58 => '',
59 => '',
60 => '',
61 => '',
62 => '',
63 => '',
64 => '',
65 => '',
66 => '',
67 => '',
68 => '',
69 => '',
70 => '',
71 => '',
72 => '',
73 => '',
74 => '',
75 => '',
76 => '',
77 => '',
78 => '',
79 => '',
80 => '',
81 => '',
82 => '',
83 => '',
84 => '',
85 => '',
86 => '',
87 => '',
88 => '',
89 => '',
90 => '',
91 => '',
92 => '',
93 => '',
94 => '',
95 => '',
96 => '',
97 => '',
98 => '',
99 => '',
100 => '',
101 => '',
102 => '',
103 => '',
),
1 =>
array (
0 => 'ss',
1 => '',
2 => 'ʼn',
3 => '',
4 => 'ΐ',
5 => 'ΰ',
6 => 'եւ',
7 => '',
8 => '',
9 => '',
10 => '',
11 => '',
12 => 'ss',
13 => 'ὐ',
14 => 'ὒ',
15 => 'ὔ',
16 => 'ὖ',
17 => 'ἀι',
18 => 'ἁι',
19 => 'ἂι',
20 => 'ἃι',
21 => 'ἄι',
22 => 'ἅι',
23 => 'ἆι',
24 => 'ἇι',
25 => 'ἀι',
26 => 'ἁι',
27 => 'ἂι',
28 => 'ἃι',
29 => 'ἄι',
30 => 'ἅι',
31 => 'ἆι',
32 => 'ἇι',
33 => 'ἠι',
34 => 'ἡι',
35 => 'ἢι',
36 => 'ἣι',
37 => 'ἤι',
38 => 'ἥι',
39 => 'ἦι',
40 => 'ἧι',
41 => 'ἠι',
42 => 'ἡι',
43 => 'ἢι',
44 => 'ἣι',
45 => 'ἤι',
46 => 'ἥι',
47 => 'ἦι',
48 => 'ἧι',
49 => 'ὠι',
50 => 'ὡι',
51 => 'ὢι',
52 => 'ὣι',
53 => 'ὤι',
54 => 'ὥι',
55 => 'ὦι',
56 => 'ὧι',
57 => 'ὠι',
58 => 'ὡι',
59 => 'ὢι',
60 => 'ὣι',
61 => 'ὤι',
62 => 'ὥι',
63 => 'ὦι',
64 => 'ὧι',
65 => 'ὰι',
66 => 'αι',
67 => 'άι',
68 => 'ᾶ',
69 => 'ᾶι',
70 => 'αι',
71 => 'ὴι',
72 => 'ηι',
73 => 'ήι',
74 => 'ῆ',
75 => 'ῆι',
76 => 'ηι',
77 => 'ῒ',
78 => 'ΐ',
79 => 'ῖ',
80 => 'ῗ',
81 => 'ῢ',
82 => 'ΰ',
83 => 'ῤ',
84 => 'ῦ',
85 => 'ῧ',
86 => 'ὼι',
87 => 'ωι',
88 => 'ώι',
89 => 'ῶ',
90 => 'ῶι',
91 => 'ωι',
92 => 'ff',
93 => 'fi',
94 => 'fl',
95 => 'ffi',
96 => 'ffl',
97 => 'st',
98 => 'st',
99 => 'մն',
100 => 'մե',
101 => 'մի',
102 => 'վն',
103 => 'մխ',
),
);

$result =& $data;
unset($data);
return $result;
1 change: 0 additions & 1 deletion src/voku/helper/data/caseFolding_full.ser

This file was deleted.

Binary file removed src/voku/helper/data/to.bestfit1250.ser
Binary file not shown.
Binary file removed src/voku/helper/data/to.bestfit1251.ser
Binary file not shown.
Binary file removed src/voku/helper/data/to.bestfit1252.ser
Binary file not shown.
Binary file removed src/voku/helper/data/to.bestfit1253.ser
Binary file not shown.
Binary file removed src/voku/helper/data/to.bestfit1254.ser
Binary file not shown.
Binary file removed src/voku/helper/data/to.bestfit1255.ser
Binary file not shown.
Binary file removed src/voku/helper/data/to.bestfit1256.ser
Binary file not shown.
Binary file removed src/voku/helper/data/to.bestfit1257.ser
Binary file not shown.
Binary file removed src/voku/helper/data/to.bestfit1258.ser
Binary file not shown.
Binary file removed src/voku/helper/data/to.bestfit874.ser
Binary file not shown.
Binary file removed src/voku/helper/data/to.bestfit932.ser
Binary file not shown.
Binary file removed src/voku/helper/data/to.bestfit936.ser
Binary file not shown.
Binary file removed src/voku/helper/data/to.bestfit949.ser
Binary file not shown.
Binary file removed src/voku/helper/data/to.bestfit950.ser
Binary file not shown.
Loading

0 comments on commit 41ed461

Please sign in to comment.