I know Composer because of Symfony2 but now I would like to use it as a standalone part. I followed the instructions that its documentation said but don't know how to set a local library as a dependency, how to load it?
In other words, how to load a local repository using Composer instead of referencing a remote one?
To solve the Memory exhausted issue, you can try running composer with an Unlimited memory flag like this: php -d memory_limit=-1 /usr/local/bin/composer [COMMAND] or php -d memory_limit=-1 composer. phar [COMMAND] when using a local composer. If that doesn't help, you can upgrade your hosting plan.
Make sure you have no problems with your setup by running the installer's checks via curl -sS https://getcomposer.org/installer | php -- --check . Try clearing Composer's cache by running composer clear-cache . Ensure you're installing vendors straight from your composer.
Now just open the composer. json file and delete the dependency which you want to remove. Now we just need to run the composer update command once more and it will remove all the phpunit dependencies which we don't want as shown below: Running composer update once again.
I've just found the solution! I did everything fine but misstyped the namespace of the dependency I wanted to autoload. So the answer to this question is
curl -s https://getcomposer.org/installer | php
Created a file composer.json
than put the following content into it:
{
"autoload": {
"psr-0": {
"MyNamespace":"src/"
}
}
}
run: php composer.phar install
../vendor/autoload.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With