Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit c086040

Browse files
Fix require autoload.php statement.
1 parent 875d380 commit c086040

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

php/quickstart.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<?php
22

3-
// Sample PHP code for user authorization
4-
53
// Call set_include_path() as needed to point to your client library.
6-
require_once 'Google/autoload.php';
7-
require_once 'Google/Client.php';
8-
require_once 'Google/Service/YouTube.php';
4+
if (!file_exists($file = __DIR__ . '/vendor/autoload.php')) {
5+
throw new \Exception('please run "composer require google/apiclient:~2.0" in "' . __DIR__ .'"');
6+
}
7+
require_once __DIR__ . '/vendor/autoload.php';
98
session_start();
109

1110
/*
@@ -22,7 +21,7 @@ function getClient() {
2221
// Set to valid redirect URI for your project.
2322
$client->setRedirectUri('http://localhost');
2423

25-
$client->addScope(GOOGLE_SERVICE_YOUTUBE::YOUTUBE_READONLY);
24+
$client->addScope(Google_Service_YouTube::YOUTUBE_READONLY);
2625
$client->setAccessType('offline');
2726

2827
// Load previously authorized credentials from a file.

0 commit comments

Comments
 (0)