Tim Wong
Tim Wong

Reputation: 287

Composer autoload Class not found exception

I create a file named Util.php and there are two class in the Util.php file.

how can I make the Util.php into composer library for other project include? now I got a Class Not Found Exception.

Upvotes: 0

Views: 128

Answers (1)

bkrukowski
bkrukowski

Reputation: 66

I create a file named Util.php and there are two class in the Util.php file.

First of all this is bad practice

Anyway, it can help: https://getcomposer.org/doc/04-schema.md#files

{
    "autoload": {
        "files": ["src/MyLibrary/functions.php"]
    }
}

Upvotes: 1

Related Questions