|
21 | 21 | abstract class Tiny_Compress { |
22 | 22 | protected $api_key; |
23 | 23 | protected $count_callback; |
24 | | - protected $config; |
25 | 24 |
|
26 | 25 | public static function get_ca_file() { |
27 | 26 | return dirname(__FILE__) . '/cacert.pem'; |
28 | 27 | } |
29 | 28 |
|
30 | | - public static function get_config() { |
31 | | - return parse_ini_file(dirname(__FILE__) . '/config/tinypng-api.ini', true); |
32 | | - } |
33 | | - |
34 | 29 | public static function get_compressor($api_key, $count_callback=null) { |
35 | 30 | if (Tiny_PHP::is_curl_available()) { |
36 | | - return new Tiny_Compress_Curl($api_key, $count_callback, self::get_config()); |
| 31 | + return new Tiny_Compress_Curl($api_key, $count_callback); |
37 | 32 | } elseif (Tiny_PHP::is_fopen_available()) { |
38 | | - return new Tiny_Compress_Fopen($api_key, $count_callback, self::get_config()); |
| 33 | + return new Tiny_Compress_Fopen($api_key, $count_callback); |
39 | 34 | } |
40 | 35 | throw new Tiny_Exception('No HTTP client is available (cURL or fopen)', 'NoHttpClient'); |
41 | 36 | } |
42 | 37 |
|
43 | | - protected function __construct($api_key, $count_callback, $config) { |
| 38 | + protected function __construct($api_key, $count_callback) { |
44 | 39 | $this->api_key = $api_key; |
45 | 40 | $this->count_callback = $count_callback; |
46 | | - $this->config = $config; |
47 | 41 | } |
48 | 42 |
|
49 | 43 | abstract protected function shrink($input); |
|
0 commit comments