示例#1
0
文件: Share.php 项目: seebz/oo-curl
 /**
  * Close a cURL share handle
  *
  * @return void
  */
 public function close()
 {
     if ($this->_sh) {
         curl_share_close($this->_sh);
         $this->_sh = null;
     }
 }
示例#2
0
 public function __destruct()
 {
     // 关闭 CURL 共享载体
     if ($this->curls) {
         curl_share_close($this->curls);
     }
 }
示例#3
0
 /**
  * Close a cURL share handle
  *
  * @param void
  * @return void
  */
 public final function curlShareClose()
 {
     curl_share_close($this->curl_share_handle);
 }
示例#4
0
文件: Curl.php 项目: bpteam/php-curl
 function __destruct()
 {
     curl_share_close($this->shareDescriptor);
     $this->cookie->deleteOldFiles();
 }
示例#5
0
 public function __destruct()
 {
     if (isset($this->sh)) {
         curl_share_close($this->sh);
     }
     curl_multi_close($this->mh);
 }
示例#6
0
 /**
  * @see curl_share_close()
  *
  * @return void
  */
 public function __destruct()
 {
     curl_share_close($this->handle);
 }
示例#7
0
 public function close()
 {
     return curl_share_close($this->resource);
 }
示例#8
0
    fwrite(STDERR, "Could not get compatible versions\n");
    curl_share_close($sh);
    exit(1);
}
$compatible = 0;
for ($x = 0; $x < $c; $x++) {
    if (intval($res[1][$x]) > $compatible) {
        $compatible = $res[1][$x];
    }
}
fwrite(STDERR, "Compatible: {$compatible}\n");
if (preg_match('/<textarea name="message"[^>]+>([\\w\\W]+?)<\\/textarea>/', $html, $res) == 0) {
    fwrite(STDERR, "Could not get description\n");
    curl_share_close($sh);
    exit(1);
}
$description = $res[1];
fwrite(STDERR, "Description: {$description}\n");
$curl = curl_init();
$f = new CURLFile($zipPath, 'application/x-zip-compressed', 'TheUndermineJournal.zip');
curl_setopt_array($curl, [CURLOPT_SHARE => $sh, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_URL => 'http://www.wowinterface.com/downloads/editfile.php', CURLOPT_POSTFIELDS => ['replacementfile' => $f, 'archiveold' => 1, 'ftitle' => 'The Undermine Journal', 'version' => $version, 'wysiwyg' => 0, 'message' => $description, 'changelog' => 'Automatic data update for ' . date('l, F j, Y'), 'donatepage' => '', 'compatible[]' => $compatible, 'overlaytype' => 0, 'overlaysid' => 0, 'allowpa' => 1, 'certify' => 'yes', 'docertify' => 'yes', 's' => '', 'securitytoken' => $securityToken, 'op' => 'editfile', 'id' => '19662', 'type' => 0, 'sbutton' => 'Update AddOn']]);
$html = curl_exec($curl);
curl_close($curl);
if (strpos($html, 'The file has been updated.') === false) {
    fwrite(STDERR, "Some upload error:\n{$html}\n");
    curl_share_close($sh);
    exit(1);
}
fwrite(STDERR, "WoW Interface update successful.\n");
curl_share_close($sh);