我正在寻找一种方法让我的 laravel 4.1 应用程序与交换服务器集成。
我发现这个脚本https://github.com/jamesiarmes/php-ews似乎符合我的需要。但是我现在不知道如何将它集成到我的 laravel 应用程序中。
我已将脚本复制到我的应用程序文件夹中的文件夹中
我在我的控制器文件夹中创建了一个控制器:
<?php
require_once('/exchange-ews/ExchangeWebServices.php');
require_once('/exchange-ews/EWSAutodiscover.php');
require_once('/exchange-ews/EWSType/CalendarItemType.php');
/**
* Class to control EWS Exchnage
*/
class EwsController
{
public $server = 'xxxx';
public $username = 'xxx';
public $password = 'xxxx';
public $version = 'xxxx';
public function getCalendarEvent()
{
$ews = new ExchangeWebServices($server, $username, $password, $version);
}
public function getServer()
{
$ews = EWSAutodiscover::getEWS($this->$username, $this->password);
return $ews;
}
}
在我的路线中,我创建了以下路线:
Route::get('testEWS', function ()
{
$result = EwsController::getServer();
return $result;
});
到目前为止,这没有任何作用。当我调用路由时,我得到的只是服务器错误,但我无法看到错误是什么。简直就是白屏。
我还不够了解在我的应用程序中加入非 laravel 包。我该怎么做呢?
谢谢
更新
这是 xdebug 错误日志在错误点的一些输出:
fl=php:internal
fn=php::ErrorException->__construct
133 7
fl=C:\wamp\www\golfmanager\golfmanager\vendor\laravel\framework\src\Illuminate\Exception\Handler.php
fn=Illuminate\Exception\Handler->handleError
129 12886
cfl=php:internal
cfn=php::error_reporting
calls=1 0 0
131 1
cfl=php:internal
cfn=php::ErrorException->__construct
calls=1 0 0
133 7