Skip to content

Including autoload assumes working dir = base path #2

Closed
@andig

Description

@andig

HttpKernelBridge does and ugly autoload include relative to the current directory in https://github.com/php-pm/php-pm-httpkernel/blob/master/Bridges/HttpKernel.php#L39:

    require_once './vendor/autoload.php';

This will be wrong if the working directory is different from the base path of the script including the kernel adapter.

I'd rather suggest

require_once dirname(realpath($_SERVER['SCRIPT_NAME'])) . '/vendor/autoload.php';

Sounds good?

Alternatively we good assume that the appBootstrap itself will be able to the path accordingly. Maybe better make the require and optional include?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions