Pergunta

I'm getting the error "Class 'HttpSocket' not found" even though I included

App::uses('HttpSocket', 'Network/Http');

before the class. I'm using it like

$HttpSocket = new HttpSocket();
$results = $HttpSocket->post(DebugConstants::REGISTRATION_SITE, $info);

with cakephp version 2.4.5. Does anyone know how to fix this?

Foi útil?

Solução

Make sure your line in the model really looks like this:

App::uses('HttpSocket', 'Network/Http');

and not like this:

App::uses(... other classes ... , 'HttpSocket', 'Network/Http');

I don't really know why :) but in my case it mysteriously started to work after I extracted the two classes into separate App::uses();

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top