brefphp / examples

Examples of PHP applications built with Bref
103 stars 31 forks source link

Add an Example Codeignitier 4 #37

Closed hasanbasri1993 closed 3 years ago

hasanbasri1993 commented 3 years ago

I got error like this,

sessionDrive = 'CodeIgniter\Session\Handlers\DatabaseHandler'; cahceHanlder = 'dummy'

This my serverless.yml

service: app

provider:
    name: aws
    region: ap-southeast-1
    runtime: provided.al2
    useDotenv: true

plugins:
    - ./vendor/bref/bref

functions:
    app:
        handler:  public/index.php
        description: ''
        timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
        layers:
            - ${bref:layer.php-74-fpm}
        events:
            -   httpApi: '*'
            -   http: '*'

# Exclude files from deployment
package:
    patterns:
        - '!node_modules/**'
        - '!tests/**'

and composer.json

{
    "name": "codeigniter4/appstarter",
    "type": "project",
    "description": "CodeIgniter4 starter app",
    "homepage": "https://codeigniter.com",
    "license": "MIT",
    "require": {
        "php": "^7.4||^8.0",
        "codeigniter4/framework": "^4",
        "bref/bref": "^1.2"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9",
        "mikey179/vfsstream": "^1.6",
        "phpunit/phpunit": "^9.1"
    },
    "suggest": {
        "ext-fileinfo": "Improves mime type detection for files"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app",
            "Config\\": "app/Config"
        },
        "exclude-from-classmap": [
            "**/Database/Migrations/**"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\Support\\": "tests/_support"
        }
    },
    "scripts": {
        "test": "phpunit"
    },
    "support": {
        "forum": "http://forum.codeigniter.com/",
        "source": "https://github.com/codeigniter4/CodeIgniter4",
        "slack": "https://codeigniterchat.slack.com"
    }
}

image

mnapoli commented 3 years ago

Hi, please open a GitHub discussion in the main Bref repository.