Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer's autoload has no classmap

I'm loading this repo:

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "ivantcholakov/gibberish-aes-php",
                "version": "master",
                "source": {
                    "url": "https://github.com/ivantcholakov/gibberish-aes-php.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        }
    ],
    "require": {
        "ivantcholakov/gibberish-aes-php": "*@dev"
    }
}

But the generated classmap is empty, and I can't use the repo:

<?php

// autoload_classmap.php generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
);

What is wrong with my composer.json setup?

PS: I ran update

like image 529
Tjorriemorrie Avatar asked May 03 '26 14:05

Tjorriemorrie


1 Answers

You have to configure the autoload option for the repository like this:

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "ivantcholakov/gibberish-aes-php",
                "version": "master",
                "source": {
                    "url": "https://github.com/ivantcholakov/gibberish-aes-php.git",
                    "type": "git",
                    "reference": "master"
                },
                "autoload": {
                    "classmap": ["/"]
                }
            }
        }
    ],
    "require": {
        "ivantcholakov/gibberish-aes-php": "*@dev"
    }
}

As seen in the commtents a fresh composer install is sometimes needed after that.

like image 168
gries Avatar answered May 06 '26 03:05

gries



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!