vendor/sentry/sentry/lib/Raven/CurlHandler.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
/*
* This file is part of Raven.
*
* (c) Sentry Team
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Asynchronous Curl connection manager.
*
* @package raven
*/
// TODO(dcramer): handle ca_cert
class Raven_CurlHandler
{
protected $join_timeout;
protected $multi_handle;
protected $options;
protected $requests;
public function __construct($options, $join_timeout = 5)
{
$this->options = $options;
$this->multi_handle = curl_multi_init();
$this->requests = array();
$this->join_timeout = 5;
register_shutdown_function(array($this, 'join'));
}
public function __destruct()
{
$this->join();
}
public function enqueue($url, $data = null, $headers = array())
{
$ch = curl_init();
$new_headers = array();
foreach ($headers as $key => $value) {
array_push($new_headers, $key .': '. $value);
}
// XXX(dcramer): Prevent 100-continue response form server (Fixes GH-216)
$new_headers[] = 'Expect:';
curl_setopt($ch, CURLOPT_HTTPHEADER, $new_headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt_array($ch, $this->options);
if (isset($data)) {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。