diff --git a/MD_STD.php b/MD_STD.php index f49055c..5335ec9 100644 --- a/MD_STD.php +++ b/MD_STD.php @@ -91,7 +91,7 @@ class MD_STD { */ public static function startsWith(string $haystack, string $needle):bool { - if (substr($haystack, 0, strlen($needle)) == $needle) return true; + if (substr($haystack, 0, \strlen($needle)) == $needle) return true; else return false; } @@ -179,19 +179,19 @@ class MD_STD { */ public static function runCurl(string $url, int $timeout = 1200):string { - $curl = curl_init(); + $curl = \curl_init(); - curl_setopt($curl, CURLOPT_URL, $url); - curl_setopt($curl, CURLOPT_HEADER, false); - curl_setopt($curl, CURLOPT_CONNECTTIMEOUT_MS, $timeout); //timeout in seconds - curl_setopt($curl, CURLOPT_TIMEOUT_MS, $timeout); //timeout in seconds - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($curl, CURLOPT_USERAGENT, 'md-bot/1.0'); - $result = curl_exec($curl); + \curl_setopt($curl, CURLOPT_URL, $url); + \curl_setopt($curl, CURLOPT_HEADER, false); + \curl_setopt($curl, CURLOPT_CONNECTTIMEOUT_MS, $timeout); //timeout in seconds + \curl_setopt($curl, CURLOPT_TIMEOUT_MS, $timeout); //timeout in seconds + \curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + \curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); + \curl_setopt($curl, CURLOPT_USERAGENT, 'md-bot/1.0'); + $result = \curl_exec($curl); - curl_close($curl); - if (is_bool($result)) return ""; + \curl_close($curl); + if (\is_bool($result)) return ""; return $result; } @@ -293,7 +293,7 @@ class MD_STD { */ public static function filesize(string $filename):int { - $output = filesize($filename); + $output = \filesize($filename); if ($output === false) { throw new Exception("Cannot get filesize of file {$filename}");