Skip to content

ApiClient.php does not work when composer's "vendor-dir" is not "vendor" #116

@vfalendysh

Description

@vfalendysh

File: cybersource/rest-client-php/lib/ApiClient.php
Function: getClientId()

This code has hardcoded "vendor" dir name, but composer has the ability to override it with vendor-dir directive, and when it happens, lib will stop working rendering file not found message. Also, what if I do not use composer?

$packages = json_decode(file_get_contents(DIR . "/../../../../vendor/composer/installed.json"), true);

proper code (does not go outside of the "vendor" folder):

$packages = json_decode(file_get_contents(DIR . "/../../../composer/installed.json"), true);

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