コード例 #1
0
require_once 'vendor/autoload.php';
define('LOGLEVEL', LOGLEVEL_DEBUG);
define('LOGUSERLEVEL', LOGLEVEL_DEVICEID);
// $username = "******";
// $password = "******";
//
// define('CALDAV_SERVER', 'http://sogo-demo.inverse.ca');
// define('CALDAV_PORT', '80');
// define('CALDAV_PATH', '/SOGo/dav/%u/Calendar/');
// define('CALDAV_PERSONAL', 'personal');
// define('CALDAV_SUPPORTS_SYNC', true);
$caldav_path = str_replace('%u', $username, CALDAV_PATH);
$caldav = new CalDAVClient(CALDAV_SERVER . ":" . CALDAV_PORT . $caldav_path, $username, $password);
printf("Connected %d\n", $caldav->CheckConnection());
// Show options supported by server
$options = $caldav->DoOptionsRequest();
print_r($options);
$calendars = $caldav->FindCalendars();
print_r($calendars);
$path = $caldav_path . CALDAV_PERSONAL . "/";
$val = $caldav->GetCalendarDetails($path);
print_r($val);
$begin = gmdate("Ymd\\THis\\Z", time() - 24 * 7 * 60 * 60);
$finish = gmdate("Ymd\\THis\\Z", 2147483647);
$msgs = $caldav->GetEvents($begin, $finish, $path);
print_r($msgs);
// Initial sync
$results = $caldav->GetSync($path, true, CALDAV_SUPPORTS_SYNC);
print_r($results);
sleep(60);
$results = $caldav->GetSync($path, false, CALDAV_SUPPORTS_SYNC);
コード例 #2
0
ファイル: caldav-client-v2.php プロジェクト: rossryan/Calico
/*
* $acc["google"] = array(
* "user"=>"*****@*****.**",
* "pass"=>"xxxxx",
* "server"=>"ssl://www.google.com",
* "port"=>"443",
* "uri"=>"https://www.google.com/calendar/dav/kunsttherapie@gmail.com/events/",
* );
*/
$acc["davical"] = array("user" => "rwr26", "pass" => "Warp\$ig7", "server" => "ssl://calendar.cs.drexel.edu", "port" => "443", "uri" => "http://rack19.cs.drexel.edu/davical/caldav.php/rwr26/home/");
//*******************************
$account = $acc["davical"];
echo "Got here";
//*******************************
$cal = new CalDAVClient($account["uri"], $account["user"], $account["pass"], "", $account["server"], $account["port"]);
$options = $cal->DoOptionsRequest();
echo "Printing options below:";
echo print_r($options);
/*
*
* //*******************************
* //*******************************
*
* $xmlC = <<<PROPP
* <?xml version="1.0" encoding="utf-8" ?>
* <D:propfind xmlns:D="DAV:" xmlns:C="http://calendarserver.org/ns/">
*     <D:prop>
*             <D:displayname />
*             <C:getctag />
*             <D:resourcetype />
*