public static function setCookieFile($file) { self::$cookie_file = $file; $lines = file($file); foreach ($lines as $l) { $l = trim($l); // Skip comments and empty lines. if (empty($l) || $l[0] == '#') { continue; } $fields = preg_split('/\\s+/', $l); $domain = strtolower($fields[0]); if (!isset(self::$cookies[$domain])) { self::$cookies[$domain] = array(); } $cookie = new Scrapt_Cookie(); $cookie->domain = $domain; $cookie->global = $fields[1] == 'TRUE' ? true : false; $cookie->path = $fields[2]; $cookie->secure = $fields[3] == 'TRUE' ? true : false; $cookie->expiry_time = $fields[4]; $cookie->name = $fields[5]; $cookie->value = $fields[6]; self::$cookies[$domain][] = $cookie; } }
public function setCookieFile($cookie_file) { $this->cookieFile = $cookie_file; Scrapt_CookieJar::setCookieFile($cookie_file); }