示例#1
0
<?php

require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/client.php';
$files = new Soramugi\GoogleDrive\Files($client);
foreach ($files->listFiles()->getItems() as $item) {
    if (!$item->getLabels()->getTrashed()) {
        echo "file : {$item->getTitle()}\n";
        echo "{$item->getId()}\n";
    }
}
<?php

require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/client.php';
$files = new Soramugi\GoogleDrive\Files($client);
foreach ($files->searchTitle('新しい') as $file) {
    if ($file->isFolder()) {
        echo $file->getTitle() . "\n";
        echo $file->getMimeType() . "\n";
        echo $file->getId() . "\n";
    }
}
示例#3
0
<?php

require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/client.php';
$files = new Soramugi\GoogleDrive\Files($client);
$fileId = '0AjjjyR-K3-zzdG9DSWxRcUJ2RFpocEFoeVhabzVrUVE';
$file = $files->get($fileId);
echo "file : {$file->getTitle()}\n";
echo "{$file->getId()}\n";