symfony2:如何集成不是捆绑包的php库 [英] symfony2: how to integrate a php library which is not a bundle

查看:79
本文介绍了symfony2:如何集成不是捆绑包的php库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Agile CRM集成到我的Symfony2应用程序中.

I am trying to integrate Agile CRM in my Symfony2 application.

Agile提供了一个PHP库: https://github.com/agilecrm/php-api

There is a PHP library provided by Agile : https://github.com/agilecrm/php-api

但是它不是捆绑包.

如何将其正确集成到我的应用程序中?我应该在我的app.php或内核中放置一次需求吗?还是有更好的方法?

How can I integrate it correctly in my application? Should I put a require once in my app.php or my kernel? Or is there a better way?

推荐答案

Composer具有自动加载文件的功能

Composer has a feature to auto load files

https://getcomposer.org/doc/04-schema.md#files

{
    "autoload": {
        "files": ["src/MyLibrary/functions.php"]
    }
}

其他方式吗?

使用库中提供的代码将功能作为服务公开.

Expose the functionality as a Service using the code provided in the library.

这篇关于symfony2:如何集成不是捆绑包的php库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆