<?php require_once __DIR__ . '/../onedrive-config.php'; require_once __DIR__ . '/../vendor/autoload.php'; session_start(); if (!array_key_exists('id', $_GET)) { throw new Exception('id undefined in $_GET'); } 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'])); $id = $_GET['id']; $file = $onedrive->fetchObject($id); ?> <!DOCTYPE html> <html lang=en dir=ltr> <head> <meta charset=utf-8> <title>Fetching a OneDrive file – 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 a OneDrive file</h1> <p>The <code>Client::fetchObject</code> method returned the file <em><?php echo htmlspecialchars($id); ?> </em>.</p>
<?php require_once __DIR__ . '/../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'])); if (!array_key_exists('name', $_GET)) { throw new Exception('name undefined in $_GET'); } $parentId = empty($_GET['parent_id']) ? null : $_GET['parent_id']; $name = $_GET['name']; $description = empty($_GET['description']) ? null : $_GET['description']; $parent = $onedrive->fetchObject($parentId); $folder = $parent->createFolder($name, $description); ?> <!DOCTYPE html> <html lang=en dir=ltr> <head> <meta charset=utf-8> <title>Creating a OneDrive folder – 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>Creating a OneDrive folder</h1> <p class=bg-success>The folder <em><?php
<?php require_once __DIR__ . '/../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'])); $id = empty($_GET['id']) ? null : $_GET['id']; $folder = $onedrive->fetchObject($id); $objects = $folder->fetchObjects(); ?> <!DOCTYPE html> <html lang=en dir=ltr> <head> <meta charset=utf-8> <title>Fetching a OneDrive folder – 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 a OneDrive folder</h1> <p>The <code>Client::fetchObject</code> method returned the folder <em><?php echo htmlspecialchars($id); ?> </em> from your OneDrive account.</p> <h2>Properties</h2> <pre><?php
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'])); if (!array_key_exists('id', $_GET)) { throw new Exception('id undefined in $_GET'); } $properties = array(); if (!empty($_GET['id'])) { $properties['id'] = $_GET['id']; } if (!empty($_GET['destination_id'])) { $properties['destination_id'] = $_GET['destination_id']; } $id = $_GET['id']; $object = $onedrive->fetchObject($_GET['id']); $object->move($_GET['destination_id']); ?> <!DOCTYPE html> <html lang=en dir=ltr> <head> <meta charset=utf-8> <title>Moving a OneDrive object – 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>Moving a OneDrive object</h1> <p class=bg-success>The object <em><?php