Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
storage/oauth-private.key
storage/oauth-public.key
.DS_Store
.phpunit.result.cache
private.key
public.key
database/gateway.sqlite
build/logs/clover.xml
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM pwred/ubuntu-php7.2
FROM wyveo/nginx-php-fpm:php80

# Install memcached & xdebug extensions
# The latter is only necessary for test coverage, it will be disabled later on
Expand Down Expand Up @@ -26,7 +26,7 @@ ADD ci/logs-logentries.sh /root/

EXPOSE 80

RUN rm /etc/nginx/sites-enabled/default
RUN rm /etc/nginx/conf.d/default.conf
ADD ci/site.conf /etc/nginx/sites-enabled/site.conf
ADD ci/log.conf /etc/nginx/conf.d/log.conf

Expand Down
5 changes: 3 additions & 2 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Symfony\Component\HttpKernel\Exception\HttpException;
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Throwable;

class Handler extends ExceptionHandler
{
Expand All @@ -33,7 +34,7 @@ class Handler extends ExceptionHandler
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
public function report(Throwable $e)
{
parent::report($e);
}
Expand All @@ -45,7 +46,7 @@ public function report(Exception $e)
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
public function render($request, Throwable $e)
{
if ($e instanceof UnableToExecuteRequestException) {
return new Response(json_encode(['errors' => [$e->getMessage()]]), $e->getCode());
Expand Down
7 changes: 4 additions & 3 deletions app/Http/Controllers/GatewayController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use App\Services\RestClient;
use App\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Arr;
use Laravel\Lumen\Routing\Controller;

class GatewayController extends Controller
Expand Down Expand Up @@ -86,18 +87,18 @@ private function rearrangeKeys(array $output)
}

if (is_string($key)) {
array_set($carry, $key, $data);
Arr::set($carry, $key, $data);
}

if (is_array($key)) {
collect($key)->each(function($outputKey, $property) use (&$data, &$carry, $key) {
if ($property == '*') {
array_set($carry, $outputKey, $data);
Arr::set($carry, $outputKey, $data);
return;
}

if (isset($data[$property])) {
array_set($carry, $outputKey, $data[$property]);
Arr::set($carry, $outputKey, $data[$property]);
unset($data[$property]);
}
});
Expand Down
4 changes: 2 additions & 2 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
]);

$app->middleware([
\Barryvdh\Cors\HandleCors::class,
\Fruitcake\Cors\HandleCors::class,
\App\Http\Middleware\Throttle::class
// \App\Http\Middleware\AddCORSHeader::class
]);
Expand All @@ -93,7 +93,7 @@
$app->register(Appzcoder\LumenRoutesList\RoutesCommandServiceProvider::class);
$app->register(Laravel\Passport\PassportServiceProvider::class);
$app->register(Dusterio\LumenPassport\PassportServiceProvider::class);
$app->register(\Barryvdh\Cors\LumenServiceProvider::class);
$app->register(Fruitcake\Cors\CorsServiceProvider::class);
$app->register(App\Providers\AuthServiceProvider::class);

if ($app->environment() != 'testing') {
Expand Down
11 changes: 0 additions & 11 deletions ci/apm-appoptics.sh

This file was deleted.

Binary file removed ci/appoptics.so
Binary file not shown.
4 changes: 2 additions & 2 deletions ci/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ fi
#fi

# Start up PHP FPM
/bin/echo clear_env = no >> /etc/php/7.2/fpm/pool.d/www.conf
/bin/echo clear_env = no >> /etc/php/8.0/fpm/pool.d/www.conf
#/bin/echo pm.max_children = 25 >> /etc/php/7.0/fpm/pool.d/www.conf
/etc/init.d/php7.2-fpm start
/etc/init.d/php80-fpm start
#this one doesn't expose env variables
#/usr/sbin/service php7.0-fpm start

Expand Down
36 changes: 21 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"name": "PoweredLocal/vrata",
"name": "poweredlocal/vrata",
"description": "API gateway written in PHP7 and Lumen",
"keywords": ["microservices", "gateway", "lumen"],
"license": "MIT",
"type": "project",
"require": {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to update the php version as well 😄

"php": ">=7.1.3",
"laravel/lumen-framework": "5.8.*",
"doctrine/dbal": "~2.3",
"vlucas/phpdotenv": "~3.3",
"appzcoder/lumen-routes-list": "^1.0",
"dusterio/lumen-passport": "^0.2",
"guzzlehttp/guzzle": "~6.0",
"webpatser/laravel-uuid": "2.*",
"league/flysystem": "^1.0",
"barryvdh/laravel-cors": "^0.11"
"laravel/lumen-framework": "v8.2.4",
"doctrine/dbal": "~2.3",
"vlucas/phpdotenv": "~v5.3.0",
"appzcoder/lumen-routes-list": "2.0.x-dev",
"dusterio/lumen-passport": "^0.3.4",
"guzzlehttp/guzzle": "~7.3",
"webpatser/laravel-uuid": "4.0.1",
"fruitcake/laravel-cors": "^2.0",
"pestphp/pest": "^1.8"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"phpunit/phpunit": "~6.0",
"codeclimate/php-test-reporter": "dev-master",
"filp/whoops": "~2.0"
"fakerphp/faker": "~v1.15.1",
"phpunit/phpunit": "~9.0",
"filp/whoops": "~2.13.0",
"league/flysystem": "^1.1"
},
"autoload": {
"psr-4": {
Expand All @@ -39,5 +39,11 @@
]
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"repositories": [
{
"type": "vcs",
"url": "https://github.com/Lohn/lumen-route-list"
}
]
}
Loading