2017-09-29 13 views
0

설치된 php-ews 사용하여 작곡가에서 PHP-EWS 코드와 일치하지 않습니다 설치가 잘 전달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 = '[email protected]'; 
$password = 'myPass'; 
$version = Client::VERSION_2010; 

$client = new Client($host, $username, $password, $version); 

을하지만 PHP는 하이픈 허용하지 않는 -을 나는 오류가있어, 그 use 명령 경로에 을() :

PHP Parse error: syntax error, unexpected '-', expecting ',' or ';' in /var/www/html

을 그런 다음 php-ews 프로젝트의 모든 코드 파일에있는 use 구의 경로가 작곡가를 사용하여 설치 한 프로젝트 파일과 일치하지 않는 것으로 나타났습니다. 예를 들어, 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; 

위의 경로는 심지어 모든 프로젝트에 존재하지 않는 .... 프로젝트 파일 및 폴더, 내부 코드 userequire 문구와 일치하지 않습니다.

설치를 잘못 했습니까? 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" 
    } 
    } 
}] 

리눅스 CentOS의 7
PHP 버전 : 5.4.16
이 Microsoft Exchange 버전은 2010

답변

0

설치가 올바른 것 같다. require != use use는 네임 스페이스입니다.이 이름은 autoloaded 인 Client.php에 정의되어 있습니다. 클라이언트 .php 6 행 : namespace jamesiarmes\PhpEws;