Coder Social home page Coder Social logo

gaesupportlaravel's Introduction

GaeSupportLaravel

Google App Engine (GAE) Standard and Flexible Environment support package for Laravel 5.5 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 5.5 LTS

Functionality

Installation

Pull in the package via Composer.

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

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(
    realpath(__DIR__.'/../')
);

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

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 .env, set the following:

QUEUE_DRIVER=gae
CACHE_DRIVER=array
SESSION_DRIVER=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(
    realpath(__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;

gaesupportlaravel's People

Contributors

iamacarpet avatar mhiran avatar dstretton avatar matthewnessworthy avatar flexgrip avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.