{"action":"created","issue":{"url":"https://api.github.com/repos/fguillot/picoFeed/issues/121","labels_url":"https://api.github.com/repos/fguillot/picoFeed/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/fguillot/picoFeed/issues/121/comments","events_url":"https://api.github.com/repos/fguillot/picoFeed/issues/121/events","html_url":"https://github.com/fguillot/picoFeed/issues/121","id":67320193,"number":121,"title":"Grabber/Client problems","user":{"login":"Raydiation","id":195053,"avatar_url":"https://avatars.githubusercontent.com/u/195053?v=3","gravatar_id":"","url":"https://api.github.com/users/Raydiation","html_url":"https://github.com/Raydiation","followers_url":"https://api.github.com/users/Raydiation/followers","following_url":"https://api.github.com/users/Raydiation/following{/other_user}","gists_url":"https://api.github.com/users/Raydiation/gists{/gist_id}","starred_url":"https://api.github.com/users/Raydiation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raydiation/subscriptions","organizations_url":"https://api.github.com/users/Raydiation/orgs","repos_url":"https://api.github.com/users/Raydiation/repos","events_url":"https://api.github.com/users/Raydiation/events{/privacy}","received_events_url":"https://api.github.com/users/Raydiation/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-09T09:28:01Z","updated_at":"2015-04-09T13:53:41Z","closed_at":null,"body":"I've tried to work on #120 but reading the client code this piece of code confused me \r\n\r\n* https://github.com/fguillot/picoFeed/blob/master/lib/PicoFeed/Client/Client.php#L666\r\n* https://github.com/fguillot/picoFeed/blob/master/lib/PicoFeed/Client/Client.php#L667\r\n\r\nWe are using the content grabber timeout and useragent for all requests, which does not seem to make sense. Is this a bug? Both seem to require the same parameters, but need a different config. I'd suggest the following solution:\r\n\r\n* Remove the grabber config parameters\r\n* No need to implement __clone since we are only setting pass by value values and no references\r\n* Allow to pass an optional grabber config to the parser\r\n\r\n```php\r\n$clientConfig = new Config();\r\n$clientConfig->setClientConnectTimeout(20);\r\n$clientConfig->setClientTimeout(10); // etc\r\n\r\n// cloning the config to override values\r\n$grabberConfig = clone $clientConfig;\r\n$grabberConfig->setClientTimeout(20);\r\n\r\n$reader = new Reader($clientConfig);\r\n$resource = $reader->download('http://linuxfr.org/news.atom');\r\n\r\n$parser = $reader->getParser(\r\n        $resource->getUrl(),\r\n        $resource->getContent(),\r\n        $resource->getEncoding(),\r\n        $grabberConfig // optional, defaults to the reader config\r\n);\r\n```\r\n\r\n@fguillot @mkresin "},"comment":{"url":"https://api.github.com/repos/fguillot/picoFeed/issues/comments/91238659","html_url":"https://github.com/fguillot/picoFeed/issues/121#issuecomment-91238659","issue_url":"https://api.github.com/repos/fguillot/picoFeed/issues/121","id":91238659,"user":{"login":"Raydiation","id":195053,"avatar_url":"https://avatars.githubusercontent.com/u/195053?v=3","gravatar_id":"","url":"https://api.github.com/users/Raydiation","html_url":"https://github.com/Raydiation","followers_url":"https://api.github.com/users/Raydiation/followers","following_url":"https://api.github.com/users/Raydiation/following{/other_user}","gists_url":"https://api.github.com/users/Raydiation/gists{/gist_id}","starred_url":"https://api.github.com/users/Raydiation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raydiation/subscriptions","organizations_url":"https://api.github.com/users/Raydiation/orgs","repos_url":"https://api.github.com/users/Raydiation/repos","events_url":"https://api.github.com/users/Raydiation/events{/privacy}","received_events_url":"https://api.github.com/users/Raydiation/received_events","type":"User","site_admin":false},"created_at":"2015-04-09T13:53:41Z","updated_at":"2015-04-09T13:53:41Z","body":"Basically the grabber and feed reader both use two entirely different clients and should be configured separately. In addition there seems to be a bug that ignores config values that are only set for the client and not for the content grabber: setting the client timeout and useragent is impossible because both use the settings for the content grabber"}}