简体   繁体   English

php-ews文件夹根本不匹配php-ews代码

[英]php-ews folders do not match php-ews code at all

Installed php-ews using composer: 使用composer安装的php-ews

{
  "minimum-stability": "dev",
  "prefer-stable": true,
  "require":
  {
    "php-ews/php-ews": "dev-master"
  }
}

The installation passed fine. 安装顺利。

Made this simple request in my project code: 在我的项目代码中提出了这个简单的请求:

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);

But the PHP doesn't accept hyphens (-) in its use command path, I got the error: 但是PHP在其use命令路径中不接受连字符(-),但出现错误:

PHP Parse error: syntax error, unexpected '-', expecting ',' or ';' PHP解析错误:语法错误,意外的“-”,预期为“,”或“;” in /var/www/html 在/ var / www / html中

Then I noticed, the paths of the use phrases in all the code files of the php-ews project, do not match the project files that where installed using the composer at all. 然后我注意到,在php-ews项目的所有代码文件中, use短语的路径根本与使用composer安装的项目文件不匹配。 For example, in the create.php file there are use phrases: 例如,在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;

The above paths do not even exist in the project at all.... The project files and folders that the composer installed, they do not match the code use and require phrases inside of them. 以上路径甚至在项目中根本不存在。...作曲家安装的项目文件和文件夹,它们与代码use不匹配,并且其中require短语。

Did I make the wrong installation? 我做错了安装吗? is there other way to use the composer.json file so I can install the project right, without hyphens (php-ews) in the directories? 还有其他方法可以使用composer.json文件,这样我就可以正确安装项目,而目录中没有连字符(php-ews)?

php-ews Version installed: 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 Linux Centos 7
PHP version: 5.4.16 PHP版本:5.4.16
Microsoft Exchange version: 2010 Microsoft Exchange版本:2010

installation seems correct. 安装似乎正确。 require != use use is a namespace, this on is defined in the Client.php, which is autoloaded. require != use use是一个名称空间,它在Client.php中定义,并自动加载。 client.php line 6: namespace jamesiarmes\\PhpEws; client.php第6行: namespace jamesiarmes\\PhpEws;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM