繁体   English   中英

Zend Framework 2加载类PHPGangsta_GoogleAuthenticator

[英]Zend Framework 2 load class PHPGangsta_GoogleAuthenticator

我正在尝试在ZF2中加载一个带有下划线的类。

这是我要使用的项目: https : //github.com/PHPGangsta/GoogleAuthenticator

文件夹路径如下所示:

/module
  /Application
      /Service
          /MyService.php
/vendor/
  /PHPGangsta
      /GoogleAuthenticator.php

GoogleAuthenticator.php有一个名为PHPGangsta_GoogleAuthenticator的类,我想在MyService.php使用它,而require任何文件。

另外,我无法更改PHPGangsta内部的文件,因为该项目在git下进行了子PHPGangsta

您可以帮助配置zf2类自动加载吗?

假设您使用Composer(推荐的方法)安装了ZF2,请编辑composer.json以将phpgangsta/googleauthenticator添加到require部分。 然后运行composer install 而已。 然后,您应该能够在应用程序中使用该库-无需执行任何其他自动加载配置。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM