I have written a class (alpha.php) which makes uses another package ( Package Name: somepackage). As always i used composer to install the package (somepackage) and used require_once __DIR__ . '/vendor/autoload.php';
to load the package in my class.
Now i am planning to make the class (alpha.php) i have written as a package to be shared with my friend. How can i use (Package Name: somepackage) now? I can no longer use require_once __DIR__ . '/vendor/autoload.php
in my class alpha.php.
How can i accomplish this?
You should only include the autoload, if your package is a full codebase, the sort used with the composer create-project
command.
If your package is to be used by other codebases you need not worry, and leave the autoloading up to them.