public static function create($api_key, $after_compress_callback = null)
 {
     if (Tiny_PHP::client_supported()) {
         $class = 'Tiny_Compress_Client';
     } elseif (Tiny_PHP::fopen_available()) {
         $class = 'Tiny_Compress_Fopen';
     } else {
         throw new Tiny_Exception('No HTTP client is available (cURL or fopen)', 'NoHttpClient');
     }
     return new $class($api_key, $after_compress_callback);
 }
Ejemplo n.º 2
0
 public static function tear_down_after_class()
 {
     Tiny_PHP::$client_supported = true;
     Tiny_PHP::$fopen_available = true;
 }
 public static function set_up_before_class()
 {
     Tiny_PHP::$client_supported = false;
     Tiny_PHP::$fopen_available = false;
 }