{"action":"created","comment":{"url":"https://api.github.com/repos/webbhuset/features/pulls/comments/78894564","id":78894564,"diff_hunk":"@@ -0,0 +1,184 @@\n+<?php\n+\n+class Webbhuset_Features_Model_Sitemap\n+    extends Mage_Sitemap_Model_Sitemap {\n+    /**\n+     * Initiate new SubSitemap XML file\n+     * \n+     */\n+    public function newFile($subName) \n+    {\n+        $io = new Varien_Io_File();\n+        $io->setAllowCreateFolders(true);\n+        $io->open(array('path' => $this->getPath()));\n+\n+        if ($io->fileExists($this->getSitemapFilename()) && !$io->isWriteable($this->getSitemapFilename())) {\n+            Mage::throwException(Mage::helper('sitemap')->__('File \"%s\" cannot be saved. Please, make sure the directory \"%s\" is writeable by web server.', $this->getSitemapFilename(), $this->getPath()));\n+        }\n+        $sitemapFileName = $this->getSitemapFilename();\n+        $fileName = explode('.' , $sitemapFileName);\n+        $io->streamOpen($fileName[0] . $subName . '.xml');\n+        $io->streamWrite('<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . \"\\n\");\n+        $io->streamWrite('<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">');\n+\n+        return $io;\n+    }\n+    /**\n+     * Close SubSitemap XML file\n+     */\n+    public function closeFile($io) \n+    {\n+        $io->streamWrite('</urlset>');\n+        $io->streamClose();\n+    }\n+    /**\n+     * Generate Sitemap Index XML file\n+     */\n+    public function createSitemapIndexFile($nr) \n+    {\n+        $io = new Varien_Io_File();\n+        $io->setAllowCreateFolders(true);\n+        $io->open(array('path' => $this->getPath()));\n+        $storeId = $this->getStoreId();\n+        $date    = Mage::getSingleton('core/date')->gmtDate('Y-m-d H:i:s');\n+        $baseUrl = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);\n+\n+        $io->streamOpen($this->getSitemapFilename());\n+        $io->streamWrite('<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . \"\\n\");\n+        $io->streamWrite('<siteMapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">');\n+\n+        $sitemapFileName = $this->getSitemapFilename();\n+        $fileName = explode('.' , $sitemapFileName);","path":"app/code/community/Webbhuset/Features/Model/Sitemap.php","position":51,"original_position":51,"commit_id":"c2ce0124e1659fc2b914dee419c56ec315c05c2e","original_commit_id":"c2ce0124e1659fc2b914dee419c56ec315c05c2e","user":{"login":"albertdahlin","id":8900986,"avatar_url":"https://avatars.githubusercontent.com/u/8900986?v=3","gravatar_id":"","url":"https://api.github.com/users/albertdahlin","html_url":"https://github.com/albertdahlin","followers_url":"https://api.github.com/users/albertdahlin/followers","following_url":"https://api.github.com/users/albertdahlin/following{/other_user}","gists_url":"https://api.github.com/users/albertdahlin/gists{/gist_id}","starred_url":"https://api.github.com/users/albertdahlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albertdahlin/subscriptions","organizations_url":"https://api.github.com/users/albertdahlin/orgs","repos_url":"https://api.github.com/users/albertdahlin/repos","events_url":"https://api.github.com/users/albertdahlin/events{/privacy}","received_events_url":"https://api.github.com/users/albertdahlin/received_events","type":"User","site_admin":false},"body":"Hantera `$fileName` på ett bättre sätt. Nu kommer det bli fel om namnet är t.ex `sitemap.se.xml`.\r\n\r\nTitta på t.ex [basename](http://php.net/manual/en/function.basename.php) eller [pathinfo](http://php.net/manual/en/function.pathinfo.php)","created_at":"2016-09-15T05:59:57Z","updated_at":"2016-09-15T06:00:58Z","html_url":"https://github.com/webbhuset/features/pull/1#discussion_r78894564","pull_request_url":"https://api.github.com/repos/webbhuset/features/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/webbhuset/features/pulls/comments/78894564"},"html":{"href":"https://github.com/webbhuset/features/pull/1#discussion_r78894564"},"pull_request":{"href":"https://api.github.com/repos/webbhuset/features/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/webbhuset/features/pulls/1","id":85170646,"html_url":"https://github.com/webbhuset/features/pull/1","diff_url":"https://github.com/webbhuset/features/pull/1.diff","patch_url":"https://github.com/webbhuset/features/pull/1.patch","issue_url":"https://api.github.com/repos/webbhuset/features/issues/1","number":1,"state":"open","locked":false,"title":"Dev/sitemap","user":{"login":"albertdahlin","id":8900986,"avatar_url":"https://avatars.githubusercontent.com/u/8900986?v=3","gravatar_id":"","url":"https://api.github.com/users/albertdahlin","html_url":"https://github.com/albertdahlin","followers_url":"https://api.github.com/users/albertdahlin/followers","following_url":"https://api.github.com/users/albertdahlin/following{/other_user}","gists_url":"https://api.github.com/users/albertdahlin/gists{/gist_id}","starred_url":"https://api.github.com/users/albertdahlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albertdahlin/subscriptions","organizations_url":"https://api.github.com/users/albertdahlin/orgs","repos_url":"https://api.github.com/users/albertdahlin/repos","events_url":"https://api.github.com/users/albertdahlin/events{/privacy}","received_events_url":"https://api.github.com/users/albertdahlin/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-14T05:57:03Z","updated_at":"2016-09-15T06:00:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"82a9c2e45b5eed672f27f2de79176a173f2e787b","assignee":{"login":"albertdahlin","id":8900986,"avatar_url":"https://avatars.githubusercontent.com/u/8900986?v=3","gravatar_id":"","url":"https://api.github.com/users/albertdahlin","html_url":"https://github.com/albertdahlin","followers_url":"https://api.github.com/users/albertdahlin/followers","following_url":"https://api.github.com/users/albertdahlin/following{/other_user}","gists_url":"https://api.github.com/users/albertdahlin/gists{/gist_id}","starred_url":"https://api.github.com/users/albertdahlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albertdahlin/subscriptions","organizations_url":"https://api.github.com/users/albertdahlin/orgs","repos_url":"https://api.github.com/users/albertdahlin/repos","events_url":"https://api.github.com/users/albertdahlin/events{/privacy}","received_events_url":"https://api.github.com/users/albertdahlin/received_events","type":"User","site_admin":false},"assignees":[{"login":"albertdahlin","id":8900986,"avatar_url":"https://avatars.githubusercontent.com/u/8900986?v=3","gravatar_id":"","url":"https://api.github.com/users/albertdahlin","html_url":"https://github.com/albertdahlin","followers_url":"https://api.github.com/users/albertdahlin/followers","following_url":"https://api.github.com/users/albertdahlin/following{/other_user}","gists_url":"https://api.github.com/users/albertdahlin/gists{/gist_id}","starred_url":"https://api.github.com/users/albertdahlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albertdahlin/subscriptions","organizations_url":"https://api.github.com/users/albertdahlin/orgs","repos_url":"https://api.github.com/users/albertdahlin/repos","events_url":"https://api.github.com/users/albertdahlin/events{/privacy}","received_events_url":"https://api.github.com/users/albertdahlin/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/webbhuset/features/pulls/1/commits","review_comments_url":"https://api.github.com/repos/webbhuset/features/pulls/1/comments","review_comment_url":"https://api.github.com/repos/webbhuset/features/pulls/comments{/number}","comments_url":"https://api.github.com/repos/webbhuset/features/issues/1/comments","statuses_url":"https://api.github.com/repos/webbhuset/features/statuses/c2ce0124e1659fc2b914dee419c56ec315c05c2e","head":{"label":"webbhuset:dev/sitemap","ref":"dev/sitemap","sha":"c2ce0124e1659fc2b914dee419c56ec315c05c2e","user":{"login":"webbhuset","id":5766322,"avatar_url":"https://avatars.githubusercontent.com/u/5766322?v=3","gravatar_id":"","url":"https://api.github.com/users/webbhuset","html_url":"https://github.com/webbhuset","followers_url":"https://api.github.com/users/webbhuset/followers","following_url":"https://api.github.com/users/webbhuset/following{/other_user}","gists_url":"https://api.github.com/users/webbhuset/gists{/gist_id}","starred_url":"https://api.github.com/users/webbhuset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webbhuset/subscriptions","organizations_url":"https://api.github.com/users/webbhuset/orgs","repos_url":"https://api.github.com/users/webbhuset/repos","events_url":"https://api.github.com/users/webbhuset/events{/privacy}","received_events_url":"https://api.github.com/users/webbhuset/received_events","type":"Organization","site_admin":false},"repo":{"id":64950682,"name":"features","full_name":"webbhuset/features","owner":{"login":"webbhuset","id":5766322,"avatar_url":"https://avatars.githubusercontent.com/u/5766322?v=3","gravatar_id":"","url":"https://api.github.com/users/webbhuset","html_url":"https://github.com/webbhuset","followers_url":"https://api.github.com/users/webbhuset/followers","following_url":"https://api.github.com/users/webbhuset/following{/other_user}","gists_url":"https://api.github.com/users/webbhuset/gists{/gist_id}","starred_url":"https://api.github.com/users/webbhuset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webbhuset/subscriptions","organizations_url":"https://api.github.com/users/webbhuset/orgs","repos_url":"https://api.github.com/users/webbhuset/repos","events_url":"https://api.github.com/users/webbhuset/events{/privacy}","received_events_url":"https://api.github.com/users/webbhuset/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/webbhuset/features","description":"Adds some \"nice to have features\" to Magento.","fork":false,"url":"https://api.github.com/repos/webbhuset/features","forks_url":"https://api.github.com/repos/webbhuset/features/forks","keys_url":"https://api.github.com/repos/webbhuset/features/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webbhuset/features/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webbhuset/features/teams","hooks_url":"https://api.github.com/repos/webbhuset/features/hooks","issue_events_url":"https://api.github.com/repos/webbhuset/features/issues/events{/number}","events_url":"https://api.github.com/repos/webbhuset/features/events","assignees_url":"https://api.github.com/repos/webbhuset/features/assignees{/user}","branches_url":"https://api.github.com/repos/webbhuset/features/branches{/branch}","tags_url":"https://api.github.com/repos/webbhuset/features/tags","blobs_url":"https://api.github.com/repos/webbhuset/features/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webbhuset/features/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webbhuset/features/git/refs{/sha}","trees_url":"https://api.github.com/repos/webbhuset/features/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webbhuset/features/statuses/{sha}","languages_url":"https://api.github.com/repos/webbhuset/features/languages","stargazers_url":"https://api.github.com/repos/webbhuset/features/stargazers","contributors_url":"https://api.github.com/repos/webbhuset/features/contributors","subscribers_url":"https://api.github.com/repos/webbhuset/features/subscribers","subscription_url":"https://api.github.com/repos/webbhuset/features/subscription","commits_url":"https://api.github.com/repos/webbhuset/features/commits{/sha}","git_commits_url":"https://api.github.com/repos/webbhuset/features/git/commits{/sha}","comments_url":"https://api.github.com/repos/webbhuset/features/comments{/number}","issue_comment_url":"https://api.github.com/repos/webbhuset/features/issues/comments{/number}","contents_url":"https://api.github.com/repos/webbhuset/features/contents/{+path}","compare_url":"https://api.github.com/repos/webbhuset/features/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webbhuset/features/merges","archive_url":"https://api.github.com/repos/webbhuset/features/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webbhuset/features/downloads","issues_url":"https://api.github.com/repos/webbhuset/features/issues{/number}","pulls_url":"https://api.github.com/repos/webbhuset/features/pulls{/number}","milestones_url":"https://api.github.com/repos/webbhuset/features/milestones{/number}","notifications_url":"https://api.github.com/repos/webbhuset/features/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webbhuset/features/labels{/name}","releases_url":"https://api.github.com/repos/webbhuset/features/releases{/id}","deployments_url":"https://api.github.com/repos/webbhuset/features/deployments","created_at":"2016-08-04T16:34:31Z","updated_at":"2016-08-04T16:36:11Z","pushed_at":"2016-09-14T14:02:16Z","git_url":"git://github.com/webbhuset/features.git","ssh_url":"git@github.com:webbhuset/features.git","clone_url":"https://github.com/webbhuset/features.git","svn_url":"https://github.com/webbhuset/features","homepage":null,"size":27,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"webbhuset:master","ref":"master","sha":"20c4618152a00a699faf12d6631831e6fb87f94d","user":{"login":"webbhuset","id":5766322,"avatar_url":"https://avatars.githubusercontent.com/u/5766322?v=3","gravatar_id":"","url":"https://api.github.com/users/webbhuset","html_url":"https://github.com/webbhuset","followers_url":"https://api.github.com/users/webbhuset/followers","following_url":"https://api.github.com/users/webbhuset/following{/other_user}","gists_url":"https://api.github.com/users/webbhuset/gists{/gist_id}","starred_url":"https://api.github.com/users/webbhuset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webbhuset/subscriptions","organizations_url":"https://api.github.com/users/webbhuset/orgs","repos_url":"https://api.github.com/users/webbhuset/repos","events_url":"https://api.github.com/users/webbhuset/events{/privacy}","received_events_url":"https://api.github.com/users/webbhuset/received_events","type":"Organization","site_admin":false},"repo":{"id":64950682,"name":"features","full_name":"webbhuset/features","owner":{"login":"webbhuset","id":5766322,"avatar_url":"https://avatars.githubusercontent.com/u/5766322?v=3","gravatar_id":"","url":"https://api.github.com/users/webbhuset","html_url":"https://github.com/webbhuset","followers_url":"https://api.github.com/users/webbhuset/followers","following_url":"https://api.github.com/users/webbhuset/following{/other_user}","gists_url":"https://api.github.com/users/webbhuset/gists{/gist_id}","starred_url":"https://api.github.com/users/webbhuset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webbhuset/subscriptions","organizations_url":"https://api.github.com/users/webbhuset/orgs","repos_url":"https://api.github.com/users/webbhuset/repos","events_url":"https://api.github.com/users/webbhuset/events{/privacy}","received_events_url":"https://api.github.com/users/webbhuset/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/webbhuset/features","description":"Adds some \"nice to have features\" to Magento.","fork":false,"url":"https://api.github.com/repos/webbhuset/features","forks_url":"https://api.github.com/repos/webbhuset/features/forks","keys_url":"https://api.github.com/repos/webbhuset/features/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webbhuset/features/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webbhuset/features/teams","hooks_url":"https://api.github.com/repos/webbhuset/features/hooks","issue_events_url":"https://api.github.com/repos/webbhuset/features/issues/events{/number}","events_url":"https://api.github.com/repos/webbhuset/features/events","assignees_url":"https://api.github.com/repos/webbhuset/features/assignees{/user}","branches_url":"https://api.github.com/repos/webbhuset/features/branches{/branch}","tags_url":"https://api.github.com/repos/webbhuset/features/tags","blobs_url":"https://api.github.com/repos/webbhuset/features/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webbhuset/features/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webbhuset/features/git/refs{/sha}","trees_url":"https://api.github.com/repos/webbhuset/features/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webbhuset/features/statuses/{sha}","languages_url":"https://api.github.com/repos/webbhuset/features/languages","stargazers_url":"https://api.github.com/repos/webbhuset/features/stargazers","contributors_url":"https://api.github.com/repos/webbhuset/features/contributors","subscribers_url":"https://api.github.com/repos/webbhuset/features/subscribers","subscription_url":"https://api.github.com/repos/webbhuset/features/subscription","commits_url":"https://api.github.com/repos/webbhuset/features/commits{/sha}","git_commits_url":"https://api.github.com/repos/webbhuset/features/git/commits{/sha}","comments_url":"https://api.github.com/repos/webbhuset/features/comments{/number}","issue_comment_url":"https://api.github.com/repos/webbhuset/features/issues/comments{/number}","contents_url":"https://api.github.com/repos/webbhuset/features/contents/{+path}","compare_url":"https://api.github.com/repos/webbhuset/features/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webbhuset/features/merges","archive_url":"https://api.github.com/repos/webbhuset/features/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webbhuset/features/downloads","issues_url":"https://api.github.com/repos/webbhuset/features/issues{/number}","pulls_url":"https://api.github.com/repos/webbhuset/features/pulls{/number}","milestones_url":"https://api.github.com/repos/webbhuset/features/milestones{/number}","notifications_url":"https://api.github.com/repos/webbhuset/features/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webbhuset/features/labels{/name}","releases_url":"https://api.github.com/repos/webbhuset/features/releases{/id}","deployments_url":"https://api.github.com/repos/webbhuset/features/deployments","created_at":"2016-08-04T16:34:31Z","updated_at":"2016-08-04T16:36:11Z","pushed_at":"2016-09-14T14:02:16Z","git_url":"git://github.com/webbhuset/features.git","ssh_url":"git@github.com:webbhuset/features.git","clone_url":"https://github.com/webbhuset/features.git","svn_url":"https://github.com/webbhuset/features","homepage":null,"size":27,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/webbhuset/features/pulls/1"},"html":{"href":"https://github.com/webbhuset/features/pull/1"},"issue":{"href":"https://api.github.com/repos/webbhuset/features/issues/1"},"comments":{"href":"https://api.github.com/repos/webbhuset/features/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/webbhuset/features/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/webbhuset/features/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/webbhuset/features/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/webbhuset/features/statuses/c2ce0124e1659fc2b914dee419c56ec315c05c2e"}}}}
{"actor":{"display_login":"albertdahlin"}}