{"action":"created","comment":{"url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/pulls/comments/50251388","id":50251388,"diff_hunk":"@@ -623,6 +623,11 @@ function regenerate_thumbnails_download_file( $url, $file, $attachment_id, $s3_o\n \t */\n \tprotected function copy_s3_file_to_server( $s3_object, $file ) {\n \t\ttry {\n+\t\t\t$directory = dirname($file);\n+\t\t\tif (!file_exists($directory)) {\n+\t\t\t\tmkdir($directory, 0775, true);","path":"classes/as3cf-plugin-compatibility.php","position":6,"original_position":6,"commit_id":"d14d734b8ddc1f5f031600ba461a33eaf55b59b6","original_commit_id":"d14d734b8ddc1f5f031600ba461a33eaf55b59b6","user":{"login":"polevaultweb","id":1770201,"avatar_url":"https://avatars.githubusercontent.com/u/1770201?v=3","gravatar_id":"","url":"https://api.github.com/users/polevaultweb","html_url":"https://github.com/polevaultweb","followers_url":"https://api.github.com/users/polevaultweb/followers","following_url":"https://api.github.com/users/polevaultweb/following{/other_user}","gists_url":"https://api.github.com/users/polevaultweb/gists{/gist_id}","starred_url":"https://api.github.com/users/polevaultweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polevaultweb/subscriptions","organizations_url":"https://api.github.com/users/polevaultweb/orgs","repos_url":"https://api.github.com/users/polevaultweb/repos","events_url":"https://api.github.com/users/polevaultweb/events{/privacy}","received_events_url":"https://api.github.com/users/polevaultweb/received_events","type":"User","site_admin":false},"body":"I think we would use `wp_mkdir_p`","created_at":"2016-01-20T13:12:31Z","updated_at":"2016-01-20T13:12:31Z","html_url":"https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront/pull/302#discussion_r50251388","pull_request_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/pulls/302","_links":{"self":{"href":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/pulls/comments/50251388"},"html":{"href":"https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront/pull/302#discussion_r50251388"},"pull_request":{"href":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/pulls/302"}}},"pull_request":{"url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/pulls/302","id":56596483,"html_url":"https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront/pull/302","diff_url":"https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront/pull/302.diff","patch_url":"https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront/pull/302.patch","issue_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/issues/302","number":302,"state":"open","locked":false,"title":"Create directory if not exists","user":{"login":"rafaljanicki","id":7746477,"avatar_url":"https://avatars.githubusercontent.com/u/7746477?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaljanicki","html_url":"https://github.com/rafaljanicki","followers_url":"https://api.github.com/users/rafaljanicki/followers","following_url":"https://api.github.com/users/rafaljanicki/following{/other_user}","gists_url":"https://api.github.com/users/rafaljanicki/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaljanicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaljanicki/subscriptions","organizations_url":"https://api.github.com/users/rafaljanicki/orgs","repos_url":"https://api.github.com/users/rafaljanicki/repos","events_url":"https://api.github.com/users/rafaljanicki/events{/privacy}","received_events_url":"https://api.github.com/users/rafaljanicki/received_events","type":"User","site_admin":false},"body":"On EC2 current version throws errors of \"file not exists\" when the target directory doesn't exist. It may be a bug in AWS SDK, but still needs a fix to work correctly.","created_at":"2016-01-20T11:38:40Z","updated_at":"2016-01-20T13:12:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbbd3d8e9ba7e0223c6cb2bca3069a30f9ab9250","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/pulls/302/commits","review_comments_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/pulls/302/comments","review_comment_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/pulls/comments{/number}","comments_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/issues/302/comments","statuses_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/statuses/d14d734b8ddc1f5f031600ba461a33eaf55b59b6","head":{"label":"rafaljanicki:patch-1","ref":"patch-1","sha":"d14d734b8ddc1f5f031600ba461a33eaf55b59b6","user":{"login":"rafaljanicki","id":7746477,"avatar_url":"https://avatars.githubusercontent.com/u/7746477?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaljanicki","html_url":"https://github.com/rafaljanicki","followers_url":"https://api.github.com/users/rafaljanicki/followers","following_url":"https://api.github.com/users/rafaljanicki/following{/other_user}","gists_url":"https://api.github.com/users/rafaljanicki/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaljanicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaljanicki/subscriptions","organizations_url":"https://api.github.com/users/rafaljanicki/orgs","repos_url":"https://api.github.com/users/rafaljanicki/repos","events_url":"https://api.github.com/users/rafaljanicki/events{/privacy}","received_events_url":"https://api.github.com/users/rafaljanicki/received_events","type":"User","site_admin":false},"repo":{"id":50025954,"name":"wp-amazon-s3-and-cloudfront","full_name":"rafaljanicki/wp-amazon-s3-and-cloudfront","owner":{"login":"rafaljanicki","id":7746477,"avatar_url":"https://avatars.githubusercontent.com/u/7746477?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaljanicki","html_url":"https://github.com/rafaljanicki","followers_url":"https://api.github.com/users/rafaljanicki/followers","following_url":"https://api.github.com/users/rafaljanicki/following{/other_user}","gists_url":"https://api.github.com/users/rafaljanicki/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaljanicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaljanicki/subscriptions","organizations_url":"https://api.github.com/users/rafaljanicki/orgs","repos_url":"https://api.github.com/users/rafaljanicki/repos","events_url":"https://api.github.com/users/rafaljanicki/events{/privacy}","received_events_url":"https://api.github.com/users/rafaljanicki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rafaljanicki/wp-amazon-s3-and-cloudfront","description":"Automatically copies media uploads to Amazon S3 for delivery. Optionally configure Amazon CloudFront for even faster delivery.","fork":true,"url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront","forks_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/forks","keys_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/teams","hooks_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/hooks","issue_events_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/issues/events{/number}","events_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/events","assignees_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/assignees{/user}","branches_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/branches{/branch}","tags_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/tags","blobs_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/git/refs{/sha}","trees_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/statuses/{sha}","languages_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/languages","stargazers_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/stargazers","contributors_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/contributors","subscribers_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/subscribers","subscription_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/subscription","commits_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/commits{/sha}","git_commits_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/git/commits{/sha}","comments_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/comments{/number}","issue_comment_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/issues/comments{/number}","contents_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/contents/{+path}","compare_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/merges","archive_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/downloads","issues_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/issues{/number}","pulls_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/pulls{/number}","milestones_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/milestones{/number}","notifications_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/labels{/name}","releases_url":"https://api.github.com/repos/rafaljanicki/wp-amazon-s3-and-cloudfront/releases{/id}","created_at":"2016-01-20T11:34:27Z","updated_at":"2016-01-20T11:34:28Z","pushed_at":"2016-01-20T13:04:29Z","git_url":"git://github.com/rafaljanicki/wp-amazon-s3-and-cloudfront.git","ssh_url":"git@github.com:rafaljanicki/wp-amazon-s3-and-cloudfront.git","clone_url":"https://github.com/rafaljanicki/wp-amazon-s3-and-cloudfront.git","svn_url":"https://github.com/rafaljanicki/wp-amazon-s3-and-cloudfront","homepage":"https://wordpress.org/plugins/amazon-s3-and-cloudfront/","size":1308,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"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":"master"}},"base":{"label":"deliciousbrains:master","ref":"master","sha":"05861fab4f0f84fa8ee1a45173ff81e35caec620","user":{"login":"deliciousbrains","id":3844035,"avatar_url":"https://avatars.githubusercontent.com/u/3844035?v=3","gravatar_id":"","url":"https://api.github.com/users/deliciousbrains","html_url":"https://github.com/deliciousbrains","followers_url":"https://api.github.com/users/deliciousbrains/followers","following_url":"https://api.github.com/users/deliciousbrains/following{/other_user}","gists_url":"https://api.github.com/users/deliciousbrains/gists{/gist_id}","starred_url":"https://api.github.com/users/deliciousbrains/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deliciousbrains/subscriptions","organizations_url":"https://api.github.com/users/deliciousbrains/orgs","repos_url":"https://api.github.com/users/deliciousbrains/repos","events_url":"https://api.github.com/users/deliciousbrains/events{/privacy}","received_events_url":"https://api.github.com/users/deliciousbrains/received_events","type":"Organization","site_admin":false},"repo":{"id":5677202,"name":"wp-amazon-s3-and-cloudfront","full_name":"deliciousbrains/wp-amazon-s3-and-cloudfront","owner":{"login":"deliciousbrains","id":3844035,"avatar_url":"https://avatars.githubusercontent.com/u/3844035?v=3","gravatar_id":"","url":"https://api.github.com/users/deliciousbrains","html_url":"https://github.com/deliciousbrains","followers_url":"https://api.github.com/users/deliciousbrains/followers","following_url":"https://api.github.com/users/deliciousbrains/following{/other_user}","gists_url":"https://api.github.com/users/deliciousbrains/gists{/gist_id}","starred_url":"https://api.github.com/users/deliciousbrains/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deliciousbrains/subscriptions","organizations_url":"https://api.github.com/users/deliciousbrains/orgs","repos_url":"https://api.github.com/users/deliciousbrains/repos","events_url":"https://api.github.com/users/deliciousbrains/events{/privacy}","received_events_url":"https://api.github.com/users/deliciousbrains/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront","description":"Automatically copies media uploads to Amazon S3 for delivery. Optionally configure Amazon CloudFront for even faster delivery.","fork":false,"url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront","forks_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/forks","keys_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/teams","hooks_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/hooks","issue_events_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/issues/events{/number}","events_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/events","assignees_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/assignees{/user}","branches_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/branches{/branch}","tags_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/tags","blobs_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/git/refs{/sha}","trees_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/statuses/{sha}","languages_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/languages","stargazers_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/stargazers","contributors_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/contributors","subscribers_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/subscribers","subscription_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/subscription","commits_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/commits{/sha}","git_commits_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/git/commits{/sha}","comments_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/comments{/number}","issue_comment_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/issues/comments{/number}","contents_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/contents/{+path}","compare_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/merges","archive_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/downloads","issues_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/issues{/number}","pulls_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/pulls{/number}","milestones_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/milestones{/number}","notifications_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/labels{/name}","releases_url":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/releases{/id}","created_at":"2012-09-04T19:11:26Z","updated_at":"2016-01-18T03:00:15Z","pushed_at":"2016-01-20T13:04:29Z","git_url":"git://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront.git","ssh_url":"git@github.com:deliciousbrains/wp-amazon-s3-and-cloudfront.git","clone_url":"https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront.git","svn_url":"https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront","homepage":"https://wordpress.org/plugins/amazon-s3-and-cloudfront/","size":1353,"stargazers_count":180,"watchers_count":180,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":32,"forks":76,"open_issues":32,"watchers":180,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/pulls/302"},"html":{"href":"https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront/pull/302"},"issue":{"href":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/issues/302"},"comments":{"href":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/issues/302/comments"},"review_comments":{"href":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/pulls/302/comments"},"review_comment":{"href":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/pulls/302/commits"},"statuses":{"href":"https://api.github.com/repos/deliciousbrains/wp-amazon-s3-and-cloudfront/statuses/d14d734b8ddc1f5f031600ba461a33eaf55b59b6"}}}}