A
A
Alex Wells2017-07-26 01:19:44
Composer
Alex Wells, 2017-07-26 01:19:44

Composer autoload?

Hello. I am writing on laravel 5.5 dev, as very attractive chips have been delivered. Unfortunately, some libraries don't support 5.5 yet, so I forked the project and added a couple of characters to composer.json.
Here is the repo: https://github.com/autaut03/laravel-fractal
Actually in the same composer.json autoload src/helpers.php is specified , but for some unknown reason the file is not loaded/generated in autoload. This function is quite useful in the project, moreover, it is used in the provider of the library itself .
How to force composer to load helpers.php? Has anyone run into this problem?
PS UPD: composer stubbornly ignores this file:

public static $files = array (
        '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
        '1d1b89d124cc9cb8219922c9d5569199' => __DIR__ . '/..' . '/hamcrest/hamcrest-php/hamcrest/Hamcrest.php',
        '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
        '5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php',
        '2c102faa651ef8ea5874edb585946bce' => __DIR__ . '/..' . '/swiftmailer/swiftmailer/lib/swift_required.php',
        'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
        'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
        'bd9634f2d41831496de0d3dfe4c94881' => __DIR__ . '/..' . '/symfony/polyfill-php56/bootstrap.php',
        'f0906e6318348a765ffb6eb24e0d0938' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/helpers.php',
        '58571171fd5812e6e447dce228f52f4d' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/helpers.php',
        '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
        'e7223560d890eab89cda23685e711e2c' => __DIR__ . '/..' . '/psy/psysh/src/Psy/functions.php',
        '1e298922c3e2134d42dcdb03e6d5f55a' => __DIR__ . '/..' . '/torann/geoip/src/helpers.php',
        '4a1f389d6ce373bda9e57857d3b61c84' => __DIR__ . '/..' . '/barryvdh/laravel-debugbar/src/helpers.php',
        'd21d43db5f6e840ee7b10744ec7fdf66' => __DIR__ . '/../..' . '/app/Helpers/helpers.php',
    );

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor, 2017-07-26
@Alex_Wells

Add this to composer.json manually:

"autoload": {
    "classmap": [
      ...
    ],
    "psr-4": {
      ...
    },
    "files": [
      "path/to/your/helper.php"
    ]
}

And don't forget to pull composer dump-autoload.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question