Typically, you include Composer tags in your project. I suggest you take a look at packagist to see if there is a Composer package for your class, otherwise you cannot require it using a composer.
Composer places your classes in the vendor directory, you must place all the "providers" there (3rd party library). See where to put them in this directory so that the Composer autoloader can automatically download it.
After that, it is recommended to create a package for this particular class. This is the best way to create a service there. For example, if your class is Foo , you create Acme\FooBundle , which loads the Foo service:
<?xml version="1.0" encoding="UTF-8" ?> <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> <services> <service id="acme_foo.foo" class="\Foo" ></service> </services> </container>
source share