{"action":"created","comment":{"url":"https://api.github.com/repos/serverless/serverless-openwhisk/pulls/comments/147741101","pull_request_review_id":72879428,"id":147741101,"diff_hunk":"@@ -10,9 +11,19 @@ class Php extends BaseRuntime {\n   }\n \n   processActionPackage (handlerFile, zip) {\n-    return zip.file(handlerFile).async('nodebuffer').then(data => {\n-      zip.remove(handlerFile)\n-      return zip.file('index.php', data)\n+    var fileName = handlerFile, pathSeparatorIndex = handlerFile.lastIndexOf('/');","path":"compile/functions/runtimes/php.js","position":15,"original_position":15,"commit_id":"6b70c2d7b0c501de170368c8ef5706740d449c5e","original_commit_id":"6b70c2d7b0c501de170368c8ef5706740d449c5e","user":{"login":"jthomas","id":2322,"avatar_url":"https://avatars2.githubusercontent.com/u/2322?v=4","gravatar_id":"","url":"https://api.github.com/users/jthomas","html_url":"https://github.com/jthomas","followers_url":"https://api.github.com/users/jthomas/followers","following_url":"https://api.github.com/users/jthomas/following{/other_user}","gists_url":"https://api.github.com/users/jthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/jthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jthomas/subscriptions","organizations_url":"https://api.github.com/users/jthomas/orgs","repos_url":"https://api.github.com/users/jthomas/repos","events_url":"https://api.github.com/users/jthomas/events{/privacy}","received_events_url":"https://api.github.com/users/jthomas/received_events","type":"User","site_admin":false},"body":"Can you change the use of `var` to `let` and `const` for those two variables?\r\nfileName changes but pathSeparatorIndex does not.","created_at":"2017-10-30T15:35:32Z","updated_at":"2017-10-30T15:35:49Z","html_url":"https://github.com/serverless/serverless-openwhisk/pull/88#discussion_r147741101","pull_request_url":"https://api.github.com/repos/serverless/serverless-openwhisk/pulls/88","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/serverless/serverless-openwhisk/pulls/comments/147741101"},"html":{"href":"https://github.com/serverless/serverless-openwhisk/pull/88#discussion_r147741101"},"pull_request":{"href":"https://api.github.com/repos/serverless/serverless-openwhisk/pulls/88"}}},"pull_request":{"url":"https://api.github.com/repos/serverless/serverless-openwhisk/pulls/88","id":149332034,"html_url":"https://github.com/serverless/serverless-openwhisk/pull/88","diff_url":"https://github.com/serverless/serverless-openwhisk/pull/88.diff","patch_url":"https://github.com/serverless/serverless-openwhisk/pull/88.patch","issue_url":"https://api.github.com/repos/serverless/serverless-openwhisk/issues/88","number":88,"state":"open","locked":false,"title":"Uses only the sub-directory for PHP","user":{"login":"sroze","id":804625,"avatar_url":"https://avatars0.githubusercontent.com/u/804625?v=4","gravatar_id":"","url":"https://api.github.com/users/sroze","html_url":"https://github.com/sroze","followers_url":"https://api.github.com/users/sroze/followers","following_url":"https://api.github.com/users/sroze/following{/other_user}","gists_url":"https://api.github.com/users/sroze/gists{/gist_id}","starred_url":"https://api.github.com/users/sroze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sroze/subscriptions","organizations_url":"https://api.github.com/users/sroze/orgs","repos_url":"https://api.github.com/users/sroze/repos","events_url":"https://api.github.com/users/sroze/events{/privacy}","received_events_url":"https://api.github.com/users/sroze/received_events","type":"User","site_admin":false},"body":"As you may already know, the Openwhisk PHP runtime has its few rules:\r\n1. The entrypoint of your function/action should be a file named `index.php` at the root of the ZIP archive\r\n2. If you don't have a `vendor` folder (i.e. some PHP dependencies) at the root of the folder, the runtime will move its own `vendor` folder for whatever reason\r\n\r\nThe current behaviour of the PHP runtime on this Serverless Framework integration is that the handler file is renamed to the `index.php` file. This works well enough for simple files within the root folder, but will not work for handlers within sub-directories.\r\n\r\nThis pull-request fixes the scenario of a file-system looking like:\r\n```\r\n- first-function/\r\n+-- composer.json\r\n+-- index.php\r\n+-- vendor/\r\n- 2nd-function/\r\n+-- composer.json\r\n+-- index.php\r\n+-- vendor/\r\n- serverless.yaml\r\n``` \r\n\r\n```yaml\r\n# serverless.yaml\r\nprovider:\r\n  name: openwhisk\r\n  runtime: php\r\n\r\npackage:\r\n  individually: true\r\n\r\nfunctions:\r\n first-function:\r\n    handler: first-function/index.main\r\n 2nd-function:\r\n    handler: 2nd-function/index.main\r\n\r\nplugins:\r\n  - serverless-openwhisk\r\n```","created_at":"2017-10-28T11:45:26Z","updated_at":"2017-10-30T15:35:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa29cd5b9285c339112a2ba52322658f385dfe27","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/serverless/serverless-openwhisk/pulls/88/commits","review_comments_url":"https://api.github.com/repos/serverless/serverless-openwhisk/pulls/88/comments","review_comment_url":"https://api.github.com/repos/serverless/serverless-openwhisk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/serverless/serverless-openwhisk/issues/88/comments","statuses_url":"https://api.github.com/repos/serverless/serverless-openwhisk/statuses/6b70c2d7b0c501de170368c8ef5706740d449c5e","head":{"label":"sroze:uses-only-sub-directory-for-php","ref":"uses-only-sub-directory-for-php","sha":"6b70c2d7b0c501de170368c8ef5706740d449c5e","user":{"login":"sroze","id":804625,"avatar_url":"https://avatars0.githubusercontent.com/u/804625?v=4","gravatar_id":"","url":"https://api.github.com/users/sroze","html_url":"https://github.com/sroze","followers_url":"https://api.github.com/users/sroze/followers","following_url":"https://api.github.com/users/sroze/following{/other_user}","gists_url":"https://api.github.com/users/sroze/gists{/gist_id}","starred_url":"https://api.github.com/users/sroze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sroze/subscriptions","organizations_url":"https://api.github.com/users/sroze/orgs","repos_url":"https://api.github.com/users/sroze/repos","events_url":"https://api.github.com/users/sroze/events{/privacy}","received_events_url":"https://api.github.com/users/sroze/received_events","type":"User","site_admin":false},"repo":{"id":108643692,"name":"serverless-openwhisk","full_name":"sroze/serverless-openwhisk","owner":{"login":"sroze","id":804625,"avatar_url":"https://avatars0.githubusercontent.com/u/804625?v=4","gravatar_id":"","url":"https://api.github.com/users/sroze","html_url":"https://github.com/sroze","followers_url":"https://api.github.com/users/sroze/followers","following_url":"https://api.github.com/users/sroze/following{/other_user}","gists_url":"https://api.github.com/users/sroze/gists{/gist_id}","starred_url":"https://api.github.com/users/sroze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sroze/subscriptions","organizations_url":"https://api.github.com/users/sroze/orgs","repos_url":"https://api.github.com/users/sroze/repos","events_url":"https://api.github.com/users/sroze/events{/privacy}","received_events_url":"https://api.github.com/users/sroze/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sroze/serverless-openwhisk","description":"Adds OpenWhisk support to the Serverless Framework!","fork":true,"url":"https://api.github.com/repos/sroze/serverless-openwhisk","forks_url":"https://api.github.com/repos/sroze/serverless-openwhisk/forks","keys_url":"https://api.github.com/repos/sroze/serverless-openwhisk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sroze/serverless-openwhisk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sroze/serverless-openwhisk/teams","hooks_url":"https://api.github.com/repos/sroze/serverless-openwhisk/hooks","issue_events_url":"https://api.github.com/repos/sroze/serverless-openwhisk/issues/events{/number}","events_url":"https://api.github.com/repos/sroze/serverless-openwhisk/events","assignees_url":"https://api.github.com/repos/sroze/serverless-openwhisk/assignees{/user}","branches_url":"https://api.github.com/repos/sroze/serverless-openwhisk/branches{/branch}","tags_url":"https://api.github.com/repos/sroze/serverless-openwhisk/tags","blobs_url":"https://api.github.com/repos/sroze/serverless-openwhisk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sroze/serverless-openwhisk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sroze/serverless-openwhisk/git/refs{/sha}","trees_url":"https://api.github.com/repos/sroze/serverless-openwhisk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sroze/serverless-openwhisk/statuses/{sha}","languages_url":"https://api.github.com/repos/sroze/serverless-openwhisk/languages","stargazers_url":"https://api.github.com/repos/sroze/serverless-openwhisk/stargazers","contributors_url":"https://api.github.com/repos/sroze/serverless-openwhisk/contributors","subscribers_url":"https://api.github.com/repos/sroze/serverless-openwhisk/subscribers","subscription_url":"https://api.github.com/repos/sroze/serverless-openwhisk/subscription","commits_url":"https://api.github.com/repos/sroze/serverless-openwhisk/commits{/sha}","git_commits_url":"https://api.github.com/repos/sroze/serverless-openwhisk/git/commits{/sha}","comments_url":"https://api.github.com/repos/sroze/serverless-openwhisk/comments{/number}","issue_comment_url":"https://api.github.com/repos/sroze/serverless-openwhisk/issues/comments{/number}","contents_url":"https://api.github.com/repos/sroze/serverless-openwhisk/contents/{+path}","compare_url":"https://api.github.com/repos/sroze/serverless-openwhisk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sroze/serverless-openwhisk/merges","archive_url":"https://api.github.com/repos/sroze/serverless-openwhisk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sroze/serverless-openwhisk/downloads","issues_url":"https://api.github.com/repos/sroze/serverless-openwhisk/issues{/number}","pulls_url":"https://api.github.com/repos/sroze/serverless-openwhisk/pulls{/number}","milestones_url":"https://api.github.com/repos/sroze/serverless-openwhisk/milestones{/number}","notifications_url":"https://api.github.com/repos/sroze/serverless-openwhisk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sroze/serverless-openwhisk/labels{/name}","releases_url":"https://api.github.com/repos/sroze/serverless-openwhisk/releases{/id}","deployments_url":"https://api.github.com/repos/sroze/serverless-openwhisk/deployments","created_at":"2017-10-28T11:29:02Z","updated_at":"2017-10-28T11:29:04Z","pushed_at":"2017-10-28T11:36:56Z","git_url":"git://github.com/sroze/serverless-openwhisk.git","ssh_url":"git@github.com:sroze/serverless-openwhisk.git","clone_url":"https://github.com/sroze/serverless-openwhisk.git","svn_url":"https://github.com/sroze/serverless-openwhisk","homepage":"http://openwhisk.org/","size":256,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"serverless:master","ref":"master","sha":"dfb978adcd5cab495c646dc84402d7abc2f570e1","user":{"login":"serverless","id":13742415,"avatar_url":"https://avatars0.githubusercontent.com/u/13742415?v=4","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"repo":{"id":73327784,"name":"serverless-openwhisk","full_name":"serverless/serverless-openwhisk","owner":{"login":"serverless","id":13742415,"avatar_url":"https://avatars0.githubusercontent.com/u/13742415?v=4","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/serverless/serverless-openwhisk","description":"Adds OpenWhisk support to the Serverless Framework!","fork":false,"url":"https://api.github.com/repos/serverless/serverless-openwhisk","forks_url":"https://api.github.com/repos/serverless/serverless-openwhisk/forks","keys_url":"https://api.github.com/repos/serverless/serverless-openwhisk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/serverless/serverless-openwhisk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/serverless/serverless-openwhisk/teams","hooks_url":"https://api.github.com/repos/serverless/serverless-openwhisk/hooks","issue_events_url":"https://api.github.com/repos/serverless/serverless-openwhisk/issues/events{/number}","events_url":"https://api.github.com/repos/serverless/serverless-openwhisk/events","assignees_url":"https://api.github.com/repos/serverless/serverless-openwhisk/assignees{/user}","branches_url":"https://api.github.com/repos/serverless/serverless-openwhisk/branches{/branch}","tags_url":"https://api.github.com/repos/serverless/serverless-openwhisk/tags","blobs_url":"https://api.github.com/repos/serverless/serverless-openwhisk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/serverless/serverless-openwhisk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/serverless/serverless-openwhisk/git/refs{/sha}","trees_url":"https://api.github.com/repos/serverless/serverless-openwhisk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/serverless/serverless-openwhisk/statuses/{sha}","languages_url":"https://api.github.com/repos/serverless/serverless-openwhisk/languages","stargazers_url":"https://api.github.com/repos/serverless/serverless-openwhisk/stargazers","contributors_url":"https://api.github.com/repos/serverless/serverless-openwhisk/contributors","subscribers_url":"https://api.github.com/repos/serverless/serverless-openwhisk/subscribers","subscription_url":"https://api.github.com/repos/serverless/serverless-openwhisk/subscription","commits_url":"https://api.github.com/repos/serverless/serverless-openwhisk/commits{/sha}","git_commits_url":"https://api.github.com/repos/serverless/serverless-openwhisk/git/commits{/sha}","comments_url":"https://api.github.com/repos/serverless/serverless-openwhisk/comments{/number}","issue_comment_url":"https://api.github.com/repos/serverless/serverless-openwhisk/issues/comments{/number}","contents_url":"https://api.github.com/repos/serverless/serverless-openwhisk/contents/{+path}","compare_url":"https://api.github.com/repos/serverless/serverless-openwhisk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/serverless/serverless-openwhisk/merges","archive_url":"https://api.github.com/repos/serverless/serverless-openwhisk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/serverless/serverless-openwhisk/downloads","issues_url":"https://api.github.com/repos/serverless/serverless-openwhisk/issues{/number}","pulls_url":"https://api.github.com/repos/serverless/serverless-openwhisk/pulls{/number}","milestones_url":"https://api.github.com/repos/serverless/serverless-openwhisk/milestones{/number}","notifications_url":"https://api.github.com/repos/serverless/serverless-openwhisk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/serverless/serverless-openwhisk/labels{/name}","releases_url":"https://api.github.com/repos/serverless/serverless-openwhisk/releases{/id}","deployments_url":"https://api.github.com/repos/serverless/serverless-openwhisk/deployments","created_at":"2016-11-09T22:51:48Z","updated_at":"2017-10-26T17:46:41Z","pushed_at":"2017-10-30T13:50:38Z","git_url":"git://github.com/serverless/serverless-openwhisk.git","ssh_url":"git@github.com:serverless/serverless-openwhisk.git","clone_url":"https://github.com/serverless/serverless-openwhisk.git","svn_url":"https://github.com/serverless/serverless-openwhisk","homepage":"http://openwhisk.org/","size":255,"stargazers_count":61,"watchers_count":61,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":12,"forks":16,"open_issues":12,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/serverless/serverless-openwhisk/pulls/88"},"html":{"href":"https://github.com/serverless/serverless-openwhisk/pull/88"},"issue":{"href":"https://api.github.com/repos/serverless/serverless-openwhisk/issues/88"},"comments":{"href":"https://api.github.com/repos/serverless/serverless-openwhisk/issues/88/comments"},"review_comments":{"href":"https://api.github.com/repos/serverless/serverless-openwhisk/pulls/88/comments"},"review_comment":{"href":"https://api.github.com/repos/serverless/serverless-openwhisk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/serverless/serverless-openwhisk/pulls/88/commits"},"statuses":{"href":"https://api.github.com/repos/serverless/serverless-openwhisk/statuses/6b70c2d7b0c501de170368c8ef5706740d449c5e"}},"author_association":"NONE"}}
{"actor":{"display_login":"jthomas"}}