[英]php-ews folders do not match php-ews code at all
使用composer安裝的php-ews
:
{
"minimum-stability": "dev",
"prefer-stable": true,
"require":
{
"php-ews/php-ews": "dev-master"
}
}
安裝順利。
在我的項目代碼中提出了這個簡單的請求:
require_once 'composer/vendor/autoload.php';
use \php-ews\php-ews\src\Client;
$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
短語的路徑根本與使用composer安裝的項目文件不匹配。 例如,在create.php文件中,有一些use
短語:
use \jamesiarmes\PhpEws\Client;
use \jamesiarmes\PhpEws\Request\CreateItemType;
use \jamesiarmes\PhpEws\ArrayType\NonEmptyArrayOfAllItemsType;
use \jamesiarmes\PhpEws\ArrayType\NonEmptyArrayOfAttendeesType;
use \jamesiarmes\PhpEws\Enumeration\BodyTypeType;
use \jamesiarmes\PhpEws\Enumeration\CalendarItemCreateOrDeleteOperationType;
use \jamesiarmes\PhpEws\Enumeration\ResponseClassType;
use \jamesiarmes\PhpEws\Enumeration\RoutingType;
以上路徑甚至在項目中根本不存在。...作曲家安裝的項目文件和文件夾,它們與代碼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
use是一個名稱空間,它在Client.php中定義,並自動加載。 client.php第6行: namespace jamesiarmes\\PhpEws;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.