Skip to content

Commit

Permalink
5.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
aliyilmaz committed Apr 13, 2023
1 parent 3261a02 commit 83e2b95
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions Mind.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
*
* @package Mind
* @version Release: 5.6.0
* @version Release: 5.6.1
* @license GPL3
* @author Ali YILMAZ <[email protected]>
* @category Php Framework, Design pattern builder for PHP.
Expand Down Expand Up @@ -3727,25 +3727,14 @@ public function session_check(){
* @param string $url
* @return int
*/
public function remoteFileSize($url){
$ch = curl_init($url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_NOBODY, TRUE);

curl_exec($ch);

$response_code = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);

curl_close($ch);

if(!in_array($response_code, array('200'))){
return -1;
}
return $size;
}
function remoteFileSize( $url ) {
$filesize = -1;
if($this->is_http($url) OR $this->is_https($url)){
$headers = get_headers($url, 1);
$filesize = $headers['Content-Length'];
}
return $filesize;
}

/**
* Layer installer
Expand Down

0 comments on commit 83e2b95

Please sign in to comment.