All Projects → a1comms → GaeSupportLaravel

a1comms / GaeSupportLaravel

Licence: MIT License
Run Laravel on Google App Engine

Programming Languages

PHP
23972 projects - #3 most used programming language
go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to GaeSupportLaravel

deploy-appengine
A GitHub Action that deploys source code to Google App Engine.
Stars: ✭ 184 (+736.36%)
Mutual labels:  appengine, google-appengine, gae, google-cloud
docker-laravel-appengine
Laravel dockerized with official Google App Engine flexible php environment + swoole.
Stars: ✭ 66 (+200%)
Mutual labels:  appengine, gae, appengine-php
rdm-app
Code for the rdm.openlighting.org site
Stars: ✭ 17 (-22.73%)
Mutual labels:  appengine, google-appengine, gae
Golang Samples
Sample apps and code written for Google Cloud in the Go programming language.
Stars: ✭ 3,088 (+13936.36%)
Mutual labels:  appengine, google-appengine, google-cloud
Google Actions Java Sdk
(Deprecated) Unofficial Google Actions Java SDK - for Android engineers and all Java lovers
Stars: ✭ 280 (+1172.73%)
Mutual labels:  appengine, google-cloud
server
The ViUR application development framework - legacy version 2.x for Python 2.7
Stars: ✭ 12 (-45.45%)
Mutual labels:  appengine, google-cloud
Ruby Docker
Ruby runtime for Google Cloud Platform
Stars: ✭ 122 (+454.55%)
Mutual labels:  appengine, google-cloud
Elixir Runtime
The community-supported runtime for Elixir on Google App Engine.
Stars: ✭ 158 (+618.18%)
Mutual labels:  appengine, google-cloud
luceneappengine
This project provides a directory useful to build Lucene and Google App Engine powered applications
Stars: ✭ 16 (-27.27%)
Mutual labels:  appengine, google-appengine
gae-vue-webapp2-starter
A simple GAE Vue Webapp2 starter project.
Stars: ✭ 17 (-22.73%)
Mutual labels:  appengine, gae
appengine-java-standard
Google App Engine Standard Java runtime: Prod runtime, local devappserver, Cloud SDK Java components, GAE APIs, and GAE API emulators.
Stars: ✭ 141 (+540.91%)
Mutual labels:  appengine, google-cloud
clojure-app-engine
A skeleton to get started with Clojure on Google App Engine
Stars: ✭ 13 (-40.91%)
Mutual labels:  google-appengine, google-cloud
zorya
Google Cloud Instance Scheduler helping to reduce costs by 60% on average for non-production environments.
Stars: ✭ 127 (+477.27%)
Mutual labels:  google-appengine, google-cloud
ElegantRL
Scalable and Elastic Deep Reinforcement Learning Using PyTorch. Please star. 🔥
Stars: ✭ 2,074 (+9327.27%)
Mutual labels:  gae
site-publish
Site Publish is a simple file-based content publishing system that runs on Google App Engine. It is designed to be a part of a dynamic website that also hosts static content.
Stars: ✭ 14 (-36.36%)
Mutual labels:  google-appengine
kuromoji-for-bigquery
Tokenize Japanese text on BigQuery with Kuromoji in Apache Beam/Google Dataflow at scale
Stars: ✭ 11 (-50%)
Mutual labels:  google-cloud
flysystem-google-cloud-storage
Flysystem v1 adapter for Google Cloud Storage
Stars: ✭ 21 (-4.55%)
Mutual labels:  google-cloud
bazel-cache
Minimal cloud oriented Bazel gRPC cache
Stars: ✭ 33 (+50%)
Mutual labels:  google-cloud
testable appengine
A testable Python skeleton application for Google's App Engine and AppScale environments
Stars: ✭ 30 (+36.36%)
Mutual labels:  google-appengine
storage-abstraction
Provides an abstraction layer for interacting with a storage; the storage can be local or in the cloud.
Stars: ✭ 36 (+63.64%)
Mutual labels:  google-cloud

GaeSupportLaravel

Google App Engine (GAE) Standard Environment support package for Laravel 6.0 LTS.

Latest Stable Version Monthly Downloads Total Downloads Latest Unstable Version License

Based on original work for App Engine Standard (on the PHP5.5 runtime) by @shpasser https://github.com/shpasser/GaeSupportL5

This library is designed for homogeneous operation between the Standard Environment and the Flexible Environment.

Note: we only intend to support Laravel LTS releases, with this version targeted specifically at Laravel 6.0 LTS

Functionality

NOTE for outdated google-cloud-php

This library depends on an OpenCensus tracing library that forces an outdated google-cloud-php version.

To get the latest version, add the following lines to your composer.json file:

    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/a1comms/opencensus-php-exporter-stackdriver.git"
        }
    ],

Installation

Pull in the package via Composer:

"require": {
    "a1comms/gae-support-laravel": "~6.0"
}

Laravel Specific (Not Lumen)

1. Add the following to composer.json:

    "scripts": {
        "post-autoload-dump": [
            "php artisan gae:prepare"
        ]
    },

2. For Laravel, include the service provider within config/app.php:

    'providers' => [
        A1comms\GaeSupportLaravel\GaeSupportServiceProvider::class,
    ];

3. Also, for added functionality, include the optional service providers:

    'providers' => [
        A1comms\GaeSupportLaravel\Auth\AuthServiceProvider::class,
        A1comms\GaeSupportLaravel\View\ViewServiceProvider::class,
        A1comms\GaeSupportLaravel\Queue\QueueServiceProvider::class,
        A1comms\GaeSupportLaravel\Trace\TraceServiceProvider::class,
    ];

And remove the relevant Laravel service providers that these replace:

    'providers' => [
        //Illuminate\View\ViewServiceProvider::class,
        //Illuminate\Queue\QueueServiceProvider::class,
    ];

4. Update bootstrap/app.php to load the overridden application class & initialise logging to Stackdriver:

/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/

$app = new A1comms\GaeSupportLaravel\Foundation\Application(
    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);

5. Update app/Exceptions/Handler.php to enable proper Exception logging to StackDriver Error Reporting & Logging:

Change the following use statement:

use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

To our class, that'll inject the required logging hook:

use A1comms\GaeSupportLaravel\Foundation\Exceptions\Handler as ExceptionHandler;

6. In config/logging.php, configure a custom logger and set it as the default:

It's also useful to set the emergency log path to a location App Engine will forward to Stackdriver Logging, see below.

<?php

use A1comms\GaeSupportLaravel\Log\CreateLoggingDriver;

return [
    
    'default' => 'gae',

    'channels' => [
        'gae' => [
            'driver' => 'custom',
            'via' => CreateLoggingDriver::class,
        ],

        'emergency' => [
            'path' => '/var/log/emergency.log',
        ],
    ],

];

7. In .env, set the following:

QUEUE_CONNECTION=gae
CACHE_DRIVER=array
SESSION_DRIVER=gae
LOG_CHANNEL=gae

Lumen Specific (Not Laravel)

1. Update bootstrap/app.php to load the overridden application class

/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| Here we will load the environment and create the application instance
| that serves as the central piece of this framework. We'll use this
| application as an "IoC" container and router for this framework.
|
*/

$app = new A1comms\GaeSupportLaravel\Foundation\LumenApplication(
    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);

2. Update app/Exceptions/Handler.php to enable proper Exception logging to StackDriver Error Reporting & Logging:

Change the following use statement:

use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;

To our class, that'll inject the required logging hook:

use A1comms\GaeSupportLaravel\Foundation\Exceptions\LumenHandler as ExceptionHandler;

Upgrading (from Laravel/Lumen 5.5 LTS)

Laravel Specific (Not Lumen)

1. Update the package version in composer.json:

"require": {
    "a1comms/gae-support-laravel": "~6.0"
}

2. Remove the following from bootstrap/app.php:

/*
|--------------------------------------------------------------------------
| Setup Early Logging
|--------------------------------------------------------------------------
*/
A1comms\GaeSupportLaravel\Log\Logger::setup($app);

3. Then update bootstrap/app.php from this:

$app = new A1comms\GaeSupportLaravel\Foundation\Application(
    realpath(__DIR__.'/../')
);

To this:

$app = new A1comms\GaeSupportLaravel\Foundation\Application(
    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);

4. In config/logging.php, configure a custom logger and set it as the default:

It's also useful to set the emergency log path to a location App Engine will forward to Stackdriver Logging, see below.

<?php

use A1comms\GaeSupportLaravel\Log\CreateLoggingDriver;

return [
    
    'default' => 'gae',

    'channels' => [
        'gae' => [
            'driver' => 'custom',
            'via' => CreateLoggingDriver::class,
        ], 

        'emergency' => [
            'path' => '/var/log/emergency.log',
        ],
    ],

];

5. Follow the Laravel upgrade steps for all versions 5.5 ... 6.0

Lumen Specific (Not Laravel)

1. Update the package version in composer.json:

"require": {
    "a1comms/gae-support-laravel": "~6.0"
}

2. Update bootstrap/app.php to change this:

$app = new A1comms\GaeSupportLaravel\Foundation\LumenApplication(
    realpath(__DIR__.'/../')
);

To this:

$app = new A1comms\GaeSupportLaravel\Foundation\LumenApplication(
    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);

3. Follow the Lumen upgrade steps for all versions 5.5 ... 6.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].