- Example with you having a Namespace in your module / <--module root /src/Foo <--This is your namespace folder
This is now your composer
"require": {
"php": ">=5.4.0",
"someother/other_class": "4.2.*",
},
"autoload": {
"psr-0": {
"Foo": "src/"
}
}
- You have not extra Namespaces in your module then your composer will not have any either. Basically the libraries you "require" will add them to composers autoload file.
Go look into vendor/autoload.php and click around
"require": {
"php": ">=5.4.0",
"someother/other_class": "4.2.*",
}
- You are extending a library This can be ideal
/ <--module root
/src/Foo/Bar.php
In that Bar.php file
<?php
namespace Foo;
class Bar extends OtherClass {
}
Now your composer.json looks like
"require": {
"php": ">=5.4.0",
"someother/other_class": "4.2.*",
},
"autoload": {
"psr-0": {
"Foo": "src/"
}
}