【问题标题】:Symfony2 and Google Ads APIs PHP Client LibrarySymfony2 和 Google Ads API PHP 客户端库
【发布时间】:2014-12-20 17:45:22
【问题描述】:

是否可以在 Symfony2 中包含 https://github.com/googleads/googleads-php-lib。我尝试用 composer 安装它,但我总是收到一些关于命名空间的错误。请注意,Google Library 不使用命名空间。我尝试设置包含的路径,但没有成功。

有没有人知道怎么弄出来的/

这是我得到的错误:

编译错误:AdWordsSoapClientFactory::DoRequireOnce(): 无法打开所需的 '/vagrant/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Lib/../v201309/CampaignService.php ' (include_path='/vagrant/vendor/googleads/googleads-php-lib/src:.:/usr/share/php:/usr/share/pear')

我也将此添加到 composer.json “类图”:[“供应商/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Lib”]

【问题讨论】:

  • v201309/CampaignService.php 存在吗?
  • 是的,那是最后的问题

标签: symfony google-ads-api


【解决方案1】:

也许这个肮脏的解决方案可以帮助你.. - 创建服务 (AdWordsService) - 在构造函数中包含类;

示例:

class MyAdWordsService
{
    public function __construct()
    {
        // include classes here
    }

    public function doSomething($someArguemtns)
    {
        do_some_operations();
    }
}

并使用它:

$myAdWordsService->doSomething();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多