使用作曲家安装了php-ews
:
{
"minimum-stability": "dev",
"prefer-stable": true,
"require":
{
"php-ews/php-ews": "dev-master"
}
}
安装通过了。
在我的项目代码中提出了这个简单的请求:
require_once 'composer/vendor/autoload.php';
use php-ewsphp-ewssrcClient;
$host = 'my.server.co.il';
$username = 'user@server.co.il';
$password = 'myPass';
$version = Client::VERSION_2010;
$client = new Client($host, $username, $password, $version);
,但PHP在其use
命令路径中不接受连字符( - ),我有错误:
php解析错误:语法错误,意外' - ',期望',''或;''在/var/www/html
然后我注意到,php-ews
项目的所有代码文件中use
短语的路径,完全不匹配使用作曲家安装的项目文件。例如,在 create.php 文件中有 use
短语:
use jamesiarmesPhpEwsClient;
use jamesiarmesPhpEwsRequestCreateItemType;
use jamesiarmesPhpEwsArrayTypeNonEmptyArrayOfAllItemsType;
use jamesiarmesPhpEwsArrayTypeNonEmptyArrayOfAttendeesType;
use jamesiarmesPhpEwsEnumerationBodyTypeType;
use jamesiarmesPhpEwsEnumerationCalendarItemCreateOrDeleteOperationType;
use jamesiarmesPhpEwsEnumerationResponseClassType;
use jamesiarmesPhpEwsEnumerationRoutingType;
上述路径根本根本不存在。作曲家安装的项目文件和文件夹,它们内部与代码use
和require
短语不匹配。
我是否做错了安装?是否有其他方法可以使用 composer.json 文件,以便我可以正确安装项目,而没有连字符(php-ews)?
php-ews
版本已安装:
"packages": [{
"name": "jamesiarmes/php-ntlm",
"version": "1.0.0-beta.1",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}]
Linux Centos 7
PHP版本:5.4.16
Microsoft Exchange版本:2010
安装似乎正确。 require != use
使用是一个命名空间,这是在自动加载的client.php中定义的。Client.php第6行: namespace jamesiarmesPhpEws;