【发布时间】:2015-10-29 09:20:38
【问题描述】:
我正在开发一个套接字侦听器,它必须使用 CommandService 类处理数据。
CommandService.php
<?php
namespace Application\Service;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorAwareTrait;
class CommandService implements ServiceLocatorAwareInterface
{
use ServiceLocatorAwareTrait;
}
custom.php
<?php
include('../module/Application/src/Application/Service/CommandService.php');
?>
当我在控制台上运行时
php custom.php
我得到错误: 致命错误:在第 7 行的 C:\wamp\www\nutirent\module\Application\src\Application\Service\CommandService.php 中找不到接口“Zend\ServiceManager\ServiceLocatorAwareInterface”
因此,如果有人能给我一些建议,我将如何在不将 custom.php 作为类的情况下运行它。
【问题讨论】:
标签: php class oop zend-framework2