【问题标题】:How do I autoload old class names in PHP Zend 2? [duplicate]如何在 PHP Zend 2 中自动加载旧的类名? [复制]
【发布时间】:2015-07-09 15:22:54
【问题描述】:

如何在 Zend 2 中自动加载 Google_Client 类?

【问题讨论】:

    标签: php zend-framework2 psr-0


    【解决方案1】:

    如果您的项目使用 Composer,您可以使用它的类映射自动加载器来抓取任何目录并将找到的所有类添加到自动加载器:

    如果您的项目使用 Zend Framework (Zend\Loader) check out it's documentation here 的内置自动加载器。默认情况下它会自动加载 PSR-0,但Zend\Loader 也支持类映射自动加载 (docs here)。在 ZF2 模块中使用Zend\Loader 的示例check out the Application module of ZendSkeletonApplication

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-11
      相关资源
      最近更新 更多