protected function output_options($resize) { $options = array('http' => array('method' => 'GET'), 'ssl' => array('cafile' => self::get_ca_file(), 'verify_peer' => true)); if ($resize) { $options['http']['header'] = array('Authorization: Basic ' . base64_encode('api:' . $this->api_key), 'Content-Type: application/json', 'User-Agent: ' . Tiny_WP_Base::plugin_identification() . ' fopen'); $options['http']['content'] = json_encode(array('resize' => $resize)); } return $options; }
protected function output_options($url, $resize) { $options = array(CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => true, CURLOPT_CAINFO => self::get_ca_file(), CURLOPT_SSL_VERIFYPEER => true, CURLOPT_USERAGENT => Tiny_WP_Base::plugin_identification() . ' cURL'); if ($resize) { $options[CURLOPT_USERPWD] = 'api:' . $this->api_key; $options[CURLOPT_HTTPHEADER] = array('Content-Type: application/json'); $options[CURLOPT_POSTFIELDS] = json_encode(array('resize' => $resize)); } return $options; }
protected function shrink_options($input) { $options = array(CURLOPT_URL => Tiny_Config::URL, CURLOPT_USERPWD => 'api:' . $this->api_key, CURLOPT_POSTFIELDS => $input, CURLOPT_BINARYTRANSFER => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => true, CURLOPT_CAINFO => self::get_ca_file(), CURLOPT_SSL_VERIFYPEER => true, CURLOPT_USERAGENT => Tiny_WP_Base::plugin_identification() . ' cURL'); if (TINY_DEBUG) { $f = fopen(dirname(__FILE__) . '/curl.log', 'w'); if (is_resource($f)) { $options[CURLOPT_VERBOSE] = true; $options[CURLOPT_STDERR] = $f; } } return $options; }
protected function shrink_options($input) { return array('http' => array('method' => 'POST', 'header' => array('Content-type: image/png', 'Authorization: Basic ' . base64_encode('api:' . $this->api_key), 'User-Agent: ' . Tiny_WP_Base::plugin_identification() . ' fopen'), 'content' => $input), 'ssl' => array('cafile' => self::get_ca_file(), 'verify_peer' => true)); }
protected function shrink_options($input) { return array(CURLOPT_URL => $this->config['api']['url'], CURLOPT_USERPWD => 'api:' . $this->api_key, CURLOPT_POSTFIELDS => $input, CURLOPT_BINARYTRANSFER => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => true, CURLOPT_CAINFO => self::get_ca_file(), CURLOPT_SSL_VERIFYPEER => true, CURLOPT_USERAGENT => Tiny_WP_Base::plugin_identification()); }