Skip to content

Commit a5340d4

Browse files
fix: updated filename for drive-v3
1 parent 8185035 commit a5340d4

20 files changed

+86
-125
lines changed

drive/snippets/drive_v3/src/createDrive.php renamed to drive/snippets/drive_v3/src/DriveCreateDrive.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ function createDrive()
3838
}
3939

4040
}
41-
require_once 'vendor/autoload.php';
4241
// [END drive_create_drive]
43-
createDrive();
44-
?>
42+
require_once 'vendor/autoload.php';
43+
createDrive();

drive/snippets/drive_v3/src/createFolder.php renamed to drive/snippets/drive_v3/src/DriveCreateFolder.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ function createFolder()
3535
}catch(Exception $e) {
3636
echo "Error Message: ".$e;
3737
}
38-
3938
}
40-
require_once 'vendor/autoload.php';
4139
// [END drive_create_folder]
42-
createFolder();
43-
?>
40+
require_once 'vendor/autoload.php';
41+
createFolder();

drive/snippets/drive_v3/src/createShortcut.php renamed to drive/snippets/drive_v3/src/DriveCreateShortcut.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ function createShortcut()
3939
}
4040

4141
}
42-
require_once 'vendor/autoload.php';
4342
// [END drive_create_shortcut]
44-
createShortcut();
45-
?>
43+
require_once 'vendor/autoload.php';
44+
createShortcut();

drive/snippets/drive_v3/src/createTeamDrive.php renamed to drive/snippets/drive_v3/src/DriveCreateTeamDrive.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
// [START drive_recover_drives]
17+
// [START drive_create_team_drives]
1818
use Google\Client;
1919
use Google\Service\Drive;
2020
use Google\Service\Drive\TeamDrive;
@@ -39,8 +39,7 @@ function createTeamDrive()
3939
echo "Error Message: ".$e;
4040
}
4141

42-
}
42+
}
43+
// [END drive_create_team_drives]
4344
require_once 'vendor/autoload.php';
44-
// [END drive_recover_drives]
45-
createTeamDrive();
46-
?>
45+
createTeamDrive();

drive/snippets/drive_v3/src/downloadFile.php renamed to drive/snippets/drive_v3/src/DriveDownloadFile.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ function downloadFile()
3838
}
3939

4040
}
41+
// [END drive_download_file]
4142
require_once 'vendor/autoload.php';
42-
// [END drive_download_file]
43-
downloadFile();
44-
?>
43+
downloadFile();

drive/snippets/drive_v3/src/exportPdf.php renamed to drive/snippets/drive_v3/src/DriveExportPdf.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ function exportPdf()
3737
}
3838

3939
}
40-
require_once 'vendor/autoload.php';
4140
// [END drive_export_pdf]
42-
exportPdf();
43-
?>
41+
require_once 'vendor/autoload.php';
42+
exportPdf();

drive/snippets/drive_v3/src/fetchAppDataFolder.php renamed to drive/snippets/drive_v3/src/DriveFetchAppDataFolder.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ function fetchAppDataFolder()
3434
echo "Error Message: ".$e;
3535
}
3636
}
37-
require_once 'vendor/autoload.php';
3837
// [END drive_fetch_appdata_folder]
38+
require_once 'vendor/autoload.php';
3939
fetchAppDataFolder();
40-
?>

drive/snippets/drive_v3/src/fetchStartPageToken.php renamed to drive/snippets/drive_v3/src/DriveFetchStartPageToken.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
# [START drive_fetch_start_page_token]
17+
// [START drive_fetch_start_page_token]
1818
use Google\Client;
1919
use Google\Service\Drive;
2020
# TODO - PHP client currently chokes on fetching start page token
@@ -33,8 +33,6 @@ function fetchStartPageToken()
3333
}
3434

3535
}
36+
// [END drive_fetch_start_page_token]
3637
require_once 'vendor/autoload.php';
37-
# [END drive_fetch_start_page_token]
38-
fetchStartPageToken();
39-
40-
?>
38+
fetchStartPageToken();

drive/snippets/drive_v3/src/listAppData.php renamed to drive/snippets/drive_v3/src/DriveListAppData.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ function listAppData()
3939
}
4040

4141
}
42-
require_once 'vendor/autoload.php';
4342
// [END drive_list_appdata]
43+
require_once 'vendor/autoload.php';
4444
listAppData();
45-
?>

drive/snippets/drive_v3/src/moveFileToFolder.php renamed to drive/snippets/drive_v3/src/DriveMoveFileToFolder.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,14 @@
1818
use Google\Client;
1919
use Google\Service\Drive;
2020
use Google\Service\Drive\DriveFile;
21-
function moveFileToFolder()
21+
function moveFileToFolder($fileId,$folderId)
2222
{
2323
try {
2424
$client = new Client();
2525
$client->useApplicationDefaultCredentials();
2626
$client->addScope(Drive::DRIVE);
2727
$driveService = new Drive($client);
28-
$realFileId = readline("Enter File Id: ");
29-
$realFolderId = readline("Enter Folder Id: ");
30-
$fileId = '1sTWaJ_j7PkjzaBWtNc3IzovK5hQf21FbOw9yLeeLPNQ';
31-
$folderId = '0BwwA4oUTeiV1TGRPeTVjaWRDY1E';
3228
$emptyFileMetadata = new DriveFile();
33-
$fileId = $realFileId;
34-
$folderId = $realFolderId;
3529
// Retrieve the existing parents to remove
3630
$file = $driveService->files->get($fileId, array(['fields' => 'parents']));
3731
$previousParents = join(',', $file->parents);
@@ -44,10 +38,7 @@ function moveFileToFolder()
4438
} catch(Exception $e) {
4539
echo "Error Message: ".$e;
4640
}
47-
48-
4941
}
42+
// [END drive_move_file_to_folder]
5043
require_once 'vendor/autoload.php';
51-
// [END drive_move_file_to_folder]
52-
moveFileToFolder();
53-
?>
44+
moveFileToFolder();

0 commit comments

Comments
 (0)