示例#1
0
文件: root.php 项目: noxfate/gtc
<?php

require_once __DIR__ . '/onedrive/onedrive-config.php';
require_once __DIR__ . '/vendor/autoload.php';
session_start();
if (!array_key_exists('onedrive.client.state', $_SESSION)) {
    throw new Exception('onedrive.client.state undefined in session');
}
$onedrive = new \Krizalys\Onedrive\Client(array('state' => $_SESSION['onedrive.client.state']));
$root = $onedrive->fetchRoot();
$objects = $root->fetchObjects();
?>
<!DOCTYPE html>
<html lang=en dir=ltr>
	<head>
		<meta charset=utf-8>
		<title>Fetching the OneDrive root – Demonstration of the OneDrive SDK for PHP</title>
		<link rel=stylesheet href=//ajax.aspnetcdn.com/ajax/bootstrap/3.2.0/css/bootstrap.min.css>
		<link rel=stylesheet href=//ajax.aspnetcdn.com/ajax/bootstrap/3.2.0/css/bootstrap-theme.min.css>
		<meta name=viewport content="width=device-width, initial-scale=1">
	</head>
	<body>
		<div class=container>
			<h1>Fetching the OneDrive root</h1>
			<p>The <code>Client::fetchRoot</code> method returned the root from your OneDrive account.</p>
			<h2>Properties</h2>
			<pre><?php 
print_r($root->fetchProperties());
?>
</pre>
			<h2>Objects</h2>