1 | <?php |
||
7 | class HandlerTools |
||
8 | { |
||
9 | public static $handlers = [ |
||
10 | "win" => [ |
||
11 | "gif" => "gifsicle.exe", |
||
12 | "png" => "optipng.exe", |
||
13 | "jpg" => "jpegtran.exe", |
||
14 | "pngquant" => "pngquant.exe", |
||
15 | "webp" => "cwebp.exe", |
||
16 | ], |
||
17 | "darwin" => [ |
||
18 | "gif" => "gifsicle-mac", |
||
19 | "png" => "optipng-mac", |
||
20 | "jpg" => "jpegtran-mac", |
||
21 | "jpeg" => "jpegtran-mac", |
||
22 | "pngquant" => "pngquant-mac", |
||
23 | "webp" => "cwebp-mac9", |
||
24 | ], |
||
25 | "sunos" => [ |
||
26 | "gif" => "gifsicle-sol", |
||
27 | "png" => "optipng-sol", |
||
28 | "jpg" => "jpegtran-sol", |
||
29 | "jpeg" => "jpegtran-sol", |
||
30 | "pngquant" => "pngquant-sol", |
||
31 | "webp" => "cwebp-sol", |
||
32 | ], |
||
33 | "freebsd" =>[ |
||
34 | "gif" => "gifsicle-fbsd", |
||
35 | "png" => "optipng-fbsd", |
||
36 | "jpg" => "jpegtran-fbsd", |
||
37 | "jpeg" => "jpegtran-fbsd", |
||
38 | "pngquant" => "pngquant-fbsd", |
||
39 | "webp" => "cwebp-fbsd", |
||
40 | ], |
||
41 | "linux" => [ |
||
42 | "gif" => "gifsicle-linux", |
||
43 | "png" => "optipng-linux", |
||
44 | "jpg" => "jpegtran-linux", |
||
45 | "jpeg" => "jpegtran-linux", |
||
46 | "pngquant" => "pngquant-linux", |
||
47 | "webp" => "cwebp-linux", |
||
48 | ], |
||
49 | ]; |
||
50 | |||
51 | public static function getBinaryHandler($type){ |
||
60 | |||
61 | public static function getBinaryHandlers(){ |
||
70 | |||
71 | } |