-1
裝入類 「IO服務器」 我有這樣的命令:的Symfony 2,試圖從命名空間 「瑞奇服務器」
class SockServerCommand extends ContainerAwareCommand implements MessageComponentInterface
{
//... methods for implementing MessageComponentInterface here
/**
* {@inheritdoc}
*/
protected function configure()
{
$this->clients = new \SplObjectStorage;
$this
->setName('game_main:sock_server_command')
->setDescription('Hello PhpStorm');
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
// $port = $input->getArgument('port');
$server = \Ratchet\Server\IoServer::factory(
new \Ratchet\Http\HttpServer(
new \Ratchet\WebSocket\WsServer(
$this
)
),
7000
);
$server->run();
}
}
如果我運行命令app/console game_main:sock_server_command
,這給了我這個錯誤:
PHP Fatal error: Class 'Ratchet\Server\IoServer' not found in /var/public_html/symfony.loc/www/src/Game/MainBundle/Command/SockServerCommand.php on line 69
[2015-07-03 17:58:01] php.CRITICAL: Fatal Error: Class 'Ratchet\Server\IoServer' not found {"type":1,"file":"/var/public_html/symfony.loc/www/src/Game/MainBundle/Command/SockServerCommand.php","line":69,"level":-1,"stack":[]}
[Symfony\Component\Debug\Exception\ClassNotFoundException]
Attempted to load class "IoServer" from namespace "Ratchet\Server".
Did you forget a "use" statement for another namespace?
game_main:sock_server_command
爲什麼Symfony無法找到這個類?解決辦法是什麼?
該類是否存在?它居住在哪個文件中?你是如何安裝圖書館的? –
該類確實存在。 我做作曲家需要guzzle/guzzle &&作曲家需要cboden /棘輪。 –