私はcakephp 2とwebsocketsのラチェットフレームワークを持っています。このすべてはaws ec2で動作します。私はいくつかのPHPのクラスを作成し、このようにCakePHPのモデルを使用しよう:私は、サーバー(wsserver
)を起動し、私はfoo
関数を呼び出すまで、すべてが正常に動作しcakephpモデルを読み込めません
<?php
namespace some\name\space;
use App;
use CakeModel;
App::uses('CakeModel', 'Model');
use Ratchet\ConnectionInterface;
require_once 'path/to/autoload.php';
require_once 'path/to/Cake/Core/App.php';
class SomeClassThatUseRatchetThings {
public function foo(ConnectionInterface $from) {
$cakeModel = new CakeModel();
...
。私がそれを呼び出すと、私は休暇中のエラーが発生します:
Class 'CakeModel' not found in /path/to/SomeClassThatUseRatchetThings.php on line 20
これはどうしてですか?私は何を逃したのですか?ありがとう。