【发布时间】:2017-02-16 21:00:36
【问题描述】:
所以...我在 PHP7.0 中使用 codeigniter3,因为这是与 stomp v2.0.0 @pecl 兼容的版本...一切都应该井井有条。
我已经在application/config.php中设置了
$config['composer_autoload'] = TRUE;
在 composer.json 中
{
"name": "gritnet/gms",
"description": "GMS is a basic content management system based on CodeIgniter with the sole purpose of helping in the development of small to medium custom websites",
"type": "project",
"require": {
"rmccue/requests": "^1.7",
"stomp-php/stomp-php": "4.*"
},
"authors": [
{
"name": "GRITNET LIMITED",
"email": "office@gritnet.uk"
}
]
}
在运行命令composer install我得到
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
在运行命令composer update我得到
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
当我尝试使用通过 composer 安装的库连接到服务器时,出现以下错误:
An uncaught Exception was encountered
Type: Error
Message: Call to undefined method Stomp::connect()
Filename: /home/gritnet/public_html/gms/application/controllers/Homepage.php
Line Number: 11
第 11 行是
Line 10: $stomp = new Stomp('tcp://localhost:61613');
Line 11: $stomp->connect();
知道为什么不加载类吗?
所有文件都在application/vendor
【问题讨论】:
标签: php codeigniter composer-php stomp