{"_id":"@aiir/php-lambda","_rev":"1-06318eb50cdbace8a4879afeda8c79a4","name":"@aiir/php-lambda","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aiir/php-lambda","version":"1.0.0","author":{"name":"Andy Buckingham","email":"andy@aiir.com"},"description":"Provides a Lambda handler function to execute PHP via a FastCGI child process.","main":"lib/handler.js","dependencies":{"fastcgi-client":"0.0.1"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiir/php-lambda.git"},"scripts":{"test":"node test/request.js"},"gitHead":"66b4f556134daae01f90e830891ab747a91a1e7b","bugs":{"url":"https://github.com/aiir/php-lambda/issues"},"homepage":"https://github.com/aiir/php-lambda#readme","_id":"@aiir/php-lambda@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.10.0","_npmUser":{"name":"andybee","email":"andy@andybee.com"},"dist":{"integrity":"sha512-bgcWGGyR4NTte30YB5xR3+6A2VTXBWWom9A535Mo+ACUwZCRbyjD5ztOOd+76BqVcMBLYSXPSdzCFgM3BvdYyg==","shasum":"f20d9af9446284ea965e13953f987561a204f972","tarball":"https://registry.npmjs.org/@aiir/php-lambda/-/php-lambda-1.0.0.tgz","fileCount":10,"unpackedSize":16283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbzJGoCRA9TVsSAnZWagAAMAYP/30CFawNf4BqULMfYLW2\nJoRXEWqLovoBP9QNvvs8axwIhlesX70u9ascHjYqF3SZRFs9vWF8OQjdIsFC\nVDRaR6np7014QWCUMmOEzSlmWUabIDmC9zlF7ju6OvVLD1WE9odsZSLG5G2W\nNdn/lOjAl32pw2YQth2gVWzxlpV+hfAiRV87BXLmOZ6tyoilBpezf9dGb/SY\nKTTnyGcBfpU1C8SDNwThgCxku8wOgVYlUFjiw/3Gs9xDg134BNRJscqCjdt8\nhvUgRt3kaU2UkCVWdwg6GZt8/RPRF21b9+s3W4R9dRfv9hCo/cF5I+zHoIdm\nH8VewzUBUbZLPRcxngakjoKM0YyhlLmQaQP/sfWKcsyDA8OVPU8e1XnVN09Q\nhRuwtvXwV6ixesYtlHWmKScJll2v5d1FLhOQml8gEULo3qkY/3Q9Ryd69Yde\njvDvBjGZvDooiQenAQceUkek+zGEBPMRtYuX8I+cM7lsP/AiPr7zOT7PlxPB\nRzVo8W2nOGQ9t98f6qVK/EdKWLNdnxjMXobr+yzoSBpFC6W+iSwu92JpBAnU\nls1gxC3t1Iy1Y1yPsxYp8Gh4NFmXWymfIt9YZJpniuy9/m8MQ+aEQazmMDmg\nyQwjh9bxxun0IOdHFSPY2hM1TVw7DPdFTlEUD7j5mokx/3bmGAYLG/JjtLx8\n4CKi\r\n=ynwK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICbfFv752oUN5V/exI8MCja/z1D490E8ATcso55lx87PAiAsIsIZbRgA/eL/uWCz36OTNgBKMnExAvSN+twVb5hIWw=="}]},"maintainers":[{"name":"andybee","email":"andy@andybee.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/php-lambda_1.0.0_1540133287848_0.5674481007116225"},"_hasShrinkwrap":false}},"time":{"created":"2018-10-21T14:48:07.763Z","1.0.0":"2018-10-21T14:48:07.969Z","modified":"2022-04-04T12:17:59.178Z"},"maintainers":[{"name":"andybee","email":"andy@andybee.com"}],"description":"Provides a Lambda handler function to execute PHP via a FastCGI child process.","homepage":"https://github.com/aiir/php-lambda#readme","repository":{"type":"git","url":"git+https://github.com/aiir/php-lambda.git"},"author":{"name":"Andy Buckingham","email":"andy@aiir.com"},"bugs":{"url":"https://github.com/aiir/php-lambda/issues"},"license":"MIT","readme":"# PHP Lambda\n\nAllows you to run PHP code within an AWS Lambda function, via Proxy Integration.\n\nTakes an incoming API Gateway Lambda Proxy Integration request object, builds and dispatches to PHP,\nthen parses the response back in to a suitable Lambda Proxy Integration response object.\n\nUses the PHP CGI process via FastCGI over a local socket to ensure fast execution of PHP code.\n\nThe FastCGI process is started up outside of the handler and therefore benefits from faster warm\nexecutions as Lambda \"freezes\" and \"warms\" the executing PHP process rather than cold starting it\neach time.\n\nRequires a compiled `php-cgi` executable in your Lambda function ZIP file to function. See the\nfollowing links for useful resources on producing a build:\n\nhttps://aws.amazon.com/blogs/compute/scripting-languages-for-aws-lambda-running-php-ruby-and-go/\nhttps://github.com/ArtisanHost/php-cgi-lambda-build-script\n\n## Requirements\n\nDesigned to run inside AWS' Lambda environment, with the Node.js 8.10 runtime.\n\n## Installation\n\nIn your existing PHP project, install the Node.js package:\n\n```\n$ npm install @aiir\\php-lambda\n```\n\nCreate an index.js script that setups your preferred environment:\n\n```\nconst createHandler = require('@aiir/php-lambda');\n\nmodule.exports.handler = createHandler();\n```\n\nPlace your `php-cgi` executable in the same folder, then create a zip file to setup on AWS.\n\nAs well as creating your Lambda function, you will need to create an API Gateway in front of it,\nconfigures with a `{proxy+}` or similar proxy integration resource.\n\n## Options\n\nThe library consists of a constructor function which returns the asynchronous handler for the Lambda\nfunction.\n\nIt can take an options object, which can consist of any of the following properties:\n\n* `args`\n  Allows you to supply an array of arguments to the PHP CGI process.\n\n* `command`\n  *Defaults to `php-cgi`*\n  Sets the PHP process to be called.\n\n* `index`\n  *Defaults to `index.php`*\n  Sets the PHP script to be used to route all requests.\n\n* `rewriteRules`\n  Allows specific routes to be handled by different PHP scripts. The value is an object, with the\n  key as the route prefix to match and the value the path to the PHP script.\n\n* `rootPath`\n  *Defaults to `.`*\n  Sets where to find the `index` script and which path to base all rewrite rule paths on.\n\n* `callbackWaitsForEmptyEventLoop`\n  Sets the value on the AWS `context` object property of the same name.\n\n## Authors\n\n- Created by [@andybee](https://twitter.com/)\n","readmeFilename":"README.md"}