Now that I want to use that in another project of mine I’ve added it to my composer.json and composer install installed it fine. However when I try to use it
I’m getting “Fatal error: Class ‘Problem\Util\LockFile’ not found in…”. If I take a look at vendor/composer/autoload_namespaces.php I’ve got the following
Still getting “Fatal error: Class ‘Util\LockFile’ not found in…”.
The namespace on the utility class is Problem\Util.
Update: I also found that my util filename was lockfile.php instead of LockFile.php which is now changed but that didn’t fix my problem, still getting the same error.
The next likely issue (though I haven’t run any code to test and be sure) is that there isn’t a good mapping between your utility class’s filesystem path and its namespace path. As you probably noticed in the autoload_namespaces file that the namespace is blank for your util package. You’ll probably have to edit your utility class’s composer.json. Instead of:
That seem to have fixed it. I really need to read more about this. Having troubles following. Now there is no autoload_namespaces.php line for php-util-lockfile at all and there is nothing about LockFile in the autoload_classmap.php but everything seems to work fine, thanks!