Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Get current proxy
- */
- public static function getProxy()
- {
- $current_proxy_line = file_get_contents(__DIR__ . '/../config/current_proxy_line.txt');
- $lines = file(__DIR__ . '/../config/proxy_list.txt', FILE_IGNORE_NEW_LINES);
- $proxy = $lines[$current_proxy_line];
- if (empty($proxy)) {
- $current_proxy_line = 0;
- $proxy = $lines[$current_proxy_line];
- }else{
- $current_proxy_line++;
- }
- file_put_contents(__DIR__ . '/../config/current_proxy_line.txt', $current_proxy_line);
- return $proxy;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement