-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from brefphp/rework
- Loading branch information
Showing
11 changed files
with
76 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php declare(strict_types=1); | ||
|
||
if (getenv('BREF_AUTOLOAD_PATH')) { | ||
require getenv('BREF_AUTOLOAD_PATH'); | ||
} else { | ||
$appRoot = getenv('LAMBDA_TASK_ROOT'); | ||
|
||
require $appRoot . '/vendor/autoload.php'; | ||
} | ||
|
||
$runtimeClass = getenv('RUNTIME_CLASS'); | ||
|
||
if (! class_exists($runtimeClass)) { | ||
throw new RuntimeException("Bref is not installed in your application (could not find the class \"$runtimeClass\" in Composer dependencies). Did you run \"composer require bref/bref\"?"); | ||
} | ||
|
||
$runtimeClass::run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
|
||
# Fail on error | ||
set -e | ||
|
||
export RUNTIME_CLASS="Bref\ConsoleRuntime\Main" | ||
|
||
while true | ||
do | ||
if [ -z "${EXPERIMENTAL_AWS_LAMBDA_EXEC_WRAPPER}" ]; then | ||
# Default behavior | ||
|
||
# We redirect stderr to stdout so that everything | ||
# written on the output ends up in Cloudwatch automatically | ||
/opt/bin/php "/opt/bref/bootstrap.php" 2>&1 | ||
else | ||
# A wrapper script is configured | ||
# See https://docs.aws.amazon.com/lambda/latest/dg/runtimes-modify.html#runtime-wrapper | ||
# NOTE: EXPERIMENTAL FEATURE, DO NOT USE!!! | ||
# Note: If you do use it, open an issue or GitHub discussion or Slack thread | ||
# and let us know why it's useful to you, we might turn it into an official feature | ||
"${EXPERIMENTAL_AWS_LAMBDA_EXEC_WRAPPER}" /opt/bin/php "/opt/bref/bootstrap.php" 2>&1 | ||
fi | ||
done |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters