Answer the question
In order to leave comments, you need to log in
How to connect a third-party library to your symfony project?
The background is this: in a symfony application, you need to send notifications to ios, android. I want to use the GCMMessage and ApnsPHP libraries. Composer downloaded them without problems in vendors.
The catch is how to use them in a particular place. There are no problems with GCMMessage - just write use , but ApnsPHP uses its own ApnsPHP_Autoload. How to embed it in symfony without editing the code of the library itself?
Answer the question
In order to leave comments, you need to log in
composer.json
"autoload": {
"psr-0": { "": "src/", "ApnsPHP" : "vendor/duccio/apns-php/" }
}
<?php
namespace Acme;
class Test
{
public function __construct()
{
new \ApnsPHP_Message_Custom();
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question