Question

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?

Was it helpful?

Solution

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();

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top