Skip to content

Is there any opportunity to set env variable in php process? #30

@enl

Description

@enl

Ok, I need to set environment variable for php process while starting built-in server. This is necessary in order to switch to testing database.

My application config file looks like this:

$connection = [
     'database' => getenv('DATABASE_NAME') ?: 'default-name',
];

So all I need is to set DATABASE_NAME variable before starting php -S process. Is there any opportunity to achieve this? Here it is my codeception.yml:

extensions:
    config:
        Codeception\Extension\PhpBuiltinServer:
            hostname: localhost
            port: 8000
            autostart: true
            documentRoot: web
            startDelay: 1
            phpIni: /etc/php5/apache2/php.ini
            router: web/index.php
            directoryIndex: index.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions