{"action":"created","comment":{"url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/pulls/comments/114046452","pull_request_review_id":35489630,"id":114046452,"diff_hunk":"@@ -326,4 +326,283 @@ private function getDate($date = null)\n \n \t\treturn $dateObj;\n \t}\n+\n+\t/**\n+\t * Copies a file or folder to a destination\n+\t * If the destination folder or file already exists, it will not overwrite them without\n+\t * force.\n+\t *\n+\t * @param   string  $sourcePath       Source path of the file or directory\n+\t * @param   string  $destinationPath  Destination path of the file or directory\n+\t * @param   bool    $force            Set true to overwrite files or directories\n+\t *\n+\t * @return bool\n+\t *\n+\t * @since __DEPLOY_VERSION__\n+\t * @throws MediaFileAdapterFilenotfoundexception\n+\t */\n+\tpublic function copy($sourcePath, $destinationPath, $force = false)\n+\t{\n+\t\t// Get absolute paths from relative paths\n+\t\t$sourcePath = $this->rootPath . $sourcePath;\n+\t\t$destinationPath = $this->rootPath . $destinationPath;\n+\n+\t\tif (!file_exists($sourcePath))\n+\t\t{\n+\t\t\tthrow new MediaFileAdapterFilenotfoundexception;\n+\t\t}\n+\n+\t\t// Check for existence of the file in destination\n+\t\t// if it does not exists simply copy source to destination\n+\n+\t\tif (is_dir($sourcePath))\n+\t\t{\n+\t\t\t$this->copyFolder($sourcePath, $destinationPath, $force);\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\t$this->copyFile($sourcePath, $destinationPath, $force);\n+\t\t}\n+\t}\n+\n+\t/**\n+\t * Copies a file\n+\t *\n+\t * @param   string  $sourcePath       Source path of the file or directory\n+\t * @param   string  $destinationPath  Destination path of the file or directory\n+\t * @param   bool    $force            Set true to overwrite files or directories\n+\t *\n+\t * @return void\n+\t *\n+\t * @since __DEPLOY_VERSION__\n+\t * @throws  Exception\n+\t */\n+\tprotected function copyFile($sourcePath, $destinationPath, $force = false)\n+\t{\n+\t\t$success = false;\n+\n+\t\t$fileExists = file_exists($destinationPath);\n+\t\tif (!$fileExists)\n+\t\t{\n+\t\t\t$success = JFile::copy($sourcePath, $destinationPath);\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\t// Overwrite file if it is forced, otherwise skip\n+\t\t\t// We do not allow to copy same file name to a existing folder in destination\n+\t\t\tif ($force && !is_dir($destinationPath))\n+\t\t\t{\n+\t\t\t\t$success = JFile::copy($sourcePath, $destinationPath);\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (!$success)\n+\t\t{\n+\t\t\tthrow new Exception('Copy is not possible');\n+\t\t}\n+","path":"plugins/filesystem/local/adapter/adapter.php","position":78,"original_position":78,"commit_id":"fd424b7c9688d494a2802f386d73f6f76adf91d1","original_commit_id":"fd424b7c9688d494a2802f386d73f6f76adf91d1","user":{"login":"laoneo","id":251072,"avatar_url":"https://avatars0.githubusercontent.com/u/251072?v=3","gravatar_id":"","url":"https://api.github.com/users/laoneo","html_url":"https://github.com/laoneo","followers_url":"https://api.github.com/users/laoneo/followers","following_url":"https://api.github.com/users/laoneo/following{/other_user}","gists_url":"https://api.github.com/users/laoneo/gists{/gist_id}","starred_url":"https://api.github.com/users/laoneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laoneo/subscriptions","organizations_url":"https://api.github.com/users/laoneo/orgs","repos_url":"https://api.github.com/users/laoneo/repos","events_url":"https://api.github.com/users/laoneo/events{/privacy}","received_events_url":"https://api.github.com/users/laoneo/received_events","type":"User","site_admin":false},"body":"Remove empty line","created_at":"2017-04-29T05:13:02Z","updated_at":"2017-04-29T05:16:39Z","html_url":"https://github.com/joomla-projects/media-manager-improvement/pull/188#discussion_r114046452","pull_request_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/pulls/188","_links":{"self":{"href":"https://api.github.com/repos/joomla-projects/media-manager-improvement/pulls/comments/114046452"},"html":{"href":"https://github.com/joomla-projects/media-manager-improvement/pull/188#discussion_r114046452"},"pull_request":{"href":"https://api.github.com/repos/joomla-projects/media-manager-improvement/pulls/188"}}},"pull_request":{"url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/pulls/188","id":116032181,"html_url":"https://github.com/joomla-projects/media-manager-improvement/pull/188","diff_url":"https://github.com/joomla-projects/media-manager-improvement/pull/188.diff","patch_url":"https://github.com/joomla-projects/media-manager-improvement/pull/188.patch","issue_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/issues/188","number":188,"state":"open","locked":false,"title":"Enhancement/basic file operations in FileSystemLocal Plugin","user":{"login":"kasvith","id":13379595,"avatar_url":"https://avatars3.githubusercontent.com/u/13379595?v=3","gravatar_id":"","url":"https://api.github.com/users/kasvith","html_url":"https://github.com/kasvith","followers_url":"https://api.github.com/users/kasvith/followers","following_url":"https://api.github.com/users/kasvith/following{/other_user}","gists_url":"https://api.github.com/users/kasvith/gists{/gist_id}","starred_url":"https://api.github.com/users/kasvith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasvith/subscriptions","organizations_url":"https://api.github.com/users/kasvith/orgs","repos_url":"https://api.github.com/users/kasvith/repos","events_url":"https://api.github.com/users/kasvith/events{/privacy}","received_events_url":"https://api.github.com/users/kasvith/received_events","type":"User","site_admin":false},"body":"Pull Request for Issue #186 .\r\n\r\n### Summary of Changes\r\nAdded following to **FileSystemLocal** plugin\r\n- Move\r\n- Copy\r\n\r\nAdded Tests for *Move/Copy*\r\n\r\n\r\n### Testing Instructions\r\n- test using `libraries\\vendor\\bin\\phpunit --testsuite plugins`\r\n\r\n\r\n### Expected result\r\n- Should be able copy,move and rename files with FileSystemLocal plugin\r\n- Should all test cases pass\r\n\r\n\r\n### Actual result\r\n- Tests are passing\r\n\r\n\r\n### Documentation Changes Required\r\n\r\n","created_at":"2017-04-15T17:14:41Z","updated_at":"2017-04-29T05:16:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"85022ad8715b999525212dc2b537bbbb27c0ea8e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/pulls/188/commits","review_comments_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/pulls/188/comments","review_comment_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/issues/188/comments","statuses_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/statuses/fd424b7c9688d494a2802f386d73f6f76adf91d1","head":{"label":"kasvith:enhancement/basic-file-operations","ref":"enhancement/basic-file-operations","sha":"fd424b7c9688d494a2802f386d73f6f76adf91d1","user":{"login":"kasvith","id":13379595,"avatar_url":"https://avatars3.githubusercontent.com/u/13379595?v=3","gravatar_id":"","url":"https://api.github.com/users/kasvith","html_url":"https://github.com/kasvith","followers_url":"https://api.github.com/users/kasvith/followers","following_url":"https://api.github.com/users/kasvith/following{/other_user}","gists_url":"https://api.github.com/users/kasvith/gists{/gist_id}","starred_url":"https://api.github.com/users/kasvith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasvith/subscriptions","organizations_url":"https://api.github.com/users/kasvith/orgs","repos_url":"https://api.github.com/users/kasvith/repos","events_url":"https://api.github.com/users/kasvith/events{/privacy}","received_events_url":"https://api.github.com/users/kasvith/received_events","type":"User","site_admin":false},"repo":{"id":87625518,"name":"media-manager-improvement","full_name":"kasvith/media-manager-improvement","owner":{"login":"kasvith","id":13379595,"avatar_url":"https://avatars3.githubusercontent.com/u/13379595?v=3","gravatar_id":"","url":"https://api.github.com/users/kasvith","html_url":"https://github.com/kasvith","followers_url":"https://api.github.com/users/kasvith/followers","following_url":"https://api.github.com/users/kasvith/following{/other_user}","gists_url":"https://api.github.com/users/kasvith/gists{/gist_id}","starred_url":"https://api.github.com/users/kasvith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasvith/subscriptions","organizations_url":"https://api.github.com/users/kasvith/orgs","repos_url":"https://api.github.com/users/kasvith/repos","events_url":"https://api.github.com/users/kasvith/events{/privacy}","received_events_url":"https://api.github.com/users/kasvith/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kasvith/media-manager-improvement","description":"Repository for the improvement of Media Manager","fork":true,"url":"https://api.github.com/repos/kasvith/media-manager-improvement","forks_url":"https://api.github.com/repos/kasvith/media-manager-improvement/forks","keys_url":"https://api.github.com/repos/kasvith/media-manager-improvement/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kasvith/media-manager-improvement/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kasvith/media-manager-improvement/teams","hooks_url":"https://api.github.com/repos/kasvith/media-manager-improvement/hooks","issue_events_url":"https://api.github.com/repos/kasvith/media-manager-improvement/issues/events{/number}","events_url":"https://api.github.com/repos/kasvith/media-manager-improvement/events","assignees_url":"https://api.github.com/repos/kasvith/media-manager-improvement/assignees{/user}","branches_url":"https://api.github.com/repos/kasvith/media-manager-improvement/branches{/branch}","tags_url":"https://api.github.com/repos/kasvith/media-manager-improvement/tags","blobs_url":"https://api.github.com/repos/kasvith/media-manager-improvement/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kasvith/media-manager-improvement/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kasvith/media-manager-improvement/git/refs{/sha}","trees_url":"https://api.github.com/repos/kasvith/media-manager-improvement/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kasvith/media-manager-improvement/statuses/{sha}","languages_url":"https://api.github.com/repos/kasvith/media-manager-improvement/languages","stargazers_url":"https://api.github.com/repos/kasvith/media-manager-improvement/stargazers","contributors_url":"https://api.github.com/repos/kasvith/media-manager-improvement/contributors","subscribers_url":"https://api.github.com/repos/kasvith/media-manager-improvement/subscribers","subscription_url":"https://api.github.com/repos/kasvith/media-manager-improvement/subscription","commits_url":"https://api.github.com/repos/kasvith/media-manager-improvement/commits{/sha}","git_commits_url":"https://api.github.com/repos/kasvith/media-manager-improvement/git/commits{/sha}","comments_url":"https://api.github.com/repos/kasvith/media-manager-improvement/comments{/number}","issue_comment_url":"https://api.github.com/repos/kasvith/media-manager-improvement/issues/comments{/number}","contents_url":"https://api.github.com/repos/kasvith/media-manager-improvement/contents/{+path}","compare_url":"https://api.github.com/repos/kasvith/media-manager-improvement/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kasvith/media-manager-improvement/merges","archive_url":"https://api.github.com/repos/kasvith/media-manager-improvement/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kasvith/media-manager-improvement/downloads","issues_url":"https://api.github.com/repos/kasvith/media-manager-improvement/issues{/number}","pulls_url":"https://api.github.com/repos/kasvith/media-manager-improvement/pulls{/number}","milestones_url":"https://api.github.com/repos/kasvith/media-manager-improvement/milestones{/number}","notifications_url":"https://api.github.com/repos/kasvith/media-manager-improvement/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kasvith/media-manager-improvement/labels{/name}","releases_url":"https://api.github.com/repos/kasvith/media-manager-improvement/releases{/id}","deployments_url":"https://api.github.com/repos/kasvith/media-manager-improvement/deployments","created_at":"2017-04-08T10:19:00Z","updated_at":"2017-04-08T10:19:13Z","pushed_at":"2017-04-29T04:16:07Z","git_url":"git://github.com/kasvith/media-manager-improvement.git","ssh_url":"git@github.com:kasvith/media-manager-improvement.git","clone_url":"https://github.com/kasvith/media-manager-improvement.git","svn_url":"https://github.com/kasvith/media-manager-improvement","homepage":"https://volunteers.joomla.org/teams/new-media-manager-team","size":156353,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"milestone1"}},"base":{"label":"joomla-projects:milestone1","ref":"milestone1","sha":"da290bf2bc84e9eced13df565f284351daadb7e1","user":{"login":"joomla-projects","id":4417437,"avatar_url":"https://avatars3.githubusercontent.com/u/4417437?v=3","gravatar_id":"","url":"https://api.github.com/users/joomla-projects","html_url":"https://github.com/joomla-projects","followers_url":"https://api.github.com/users/joomla-projects/followers","following_url":"https://api.github.com/users/joomla-projects/following{/other_user}","gists_url":"https://api.github.com/users/joomla-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla-projects/subscriptions","organizations_url":"https://api.github.com/users/joomla-projects/orgs","repos_url":"https://api.github.com/users/joomla-projects/repos","events_url":"https://api.github.com/users/joomla-projects/events{/privacy}","received_events_url":"https://api.github.com/users/joomla-projects/received_events","type":"Organization","site_admin":false},"repo":{"id":47698650,"name":"media-manager-improvement","full_name":"joomla-projects/media-manager-improvement","owner":{"login":"joomla-projects","id":4417437,"avatar_url":"https://avatars3.githubusercontent.com/u/4417437?v=3","gravatar_id":"","url":"https://api.github.com/users/joomla-projects","html_url":"https://github.com/joomla-projects","followers_url":"https://api.github.com/users/joomla-projects/followers","following_url":"https://api.github.com/users/joomla-projects/following{/other_user}","gists_url":"https://api.github.com/users/joomla-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla-projects/subscriptions","organizations_url":"https://api.github.com/users/joomla-projects/orgs","repos_url":"https://api.github.com/users/joomla-projects/repos","events_url":"https://api.github.com/users/joomla-projects/events{/privacy}","received_events_url":"https://api.github.com/users/joomla-projects/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/joomla-projects/media-manager-improvement","description":"Repository for the improvement of Media Manager","fork":false,"url":"https://api.github.com/repos/joomla-projects/media-manager-improvement","forks_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/forks","keys_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/teams","hooks_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/hooks","issue_events_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/issues/events{/number}","events_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/events","assignees_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/assignees{/user}","branches_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/branches{/branch}","tags_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/tags","blobs_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/git/refs{/sha}","trees_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/statuses/{sha}","languages_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/languages","stargazers_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/stargazers","contributors_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/contributors","subscribers_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/subscribers","subscription_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/subscription","commits_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/commits{/sha}","git_commits_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/git/commits{/sha}","comments_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/comments{/number}","issue_comment_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/issues/comments{/number}","contents_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/contents/{+path}","compare_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/merges","archive_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/downloads","issues_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/issues{/number}","pulls_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/pulls{/number}","milestones_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/milestones{/number}","notifications_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/labels{/name}","releases_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/releases{/id}","deployments_url":"https://api.github.com/repos/joomla-projects/media-manager-improvement/deployments","created_at":"2015-12-09T15:08:53Z","updated_at":"2017-04-11T16:35:49Z","pushed_at":"2017-04-29T04:16:08Z","git_url":"git://github.com/joomla-projects/media-manager-improvement.git","ssh_url":"git@github.com:joomla-projects/media-manager-improvement.git","clone_url":"https://github.com/joomla-projects/media-manager-improvement.git","svn_url":"https://github.com/joomla-projects/media-manager-improvement","homepage":"https://volunteers.joomla.org/teams/new-media-manager-team","size":156231,"stargazers_count":9,"watchers_count":9,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":32,"forks":23,"open_issues":32,"watchers":9,"default_branch":"milestone1"}},"_links":{"self":{"href":"https://api.github.com/repos/joomla-projects/media-manager-improvement/pulls/188"},"html":{"href":"https://github.com/joomla-projects/media-manager-improvement/pull/188"},"issue":{"href":"https://api.github.com/repos/joomla-projects/media-manager-improvement/issues/188"},"comments":{"href":"https://api.github.com/repos/joomla-projects/media-manager-improvement/issues/188/comments"},"review_comments":{"href":"https://api.github.com/repos/joomla-projects/media-manager-improvement/pulls/188/comments"},"review_comment":{"href":"https://api.github.com/repos/joomla-projects/media-manager-improvement/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joomla-projects/media-manager-improvement/pulls/188/commits"},"statuses":{"href":"https://api.github.com/repos/joomla-projects/media-manager-improvement/statuses/fd424b7c9688d494a2802f386d73f6f76adf91d1"}}}}
{"actor":{"display_login":"laoneo"}}