문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top