File tree Expand file tree Collapse file tree 10 files changed +20
-26
lines changed
Expand file tree Collapse file tree 10 files changed +20
-26
lines changed Original file line number Diff line number Diff line change 1+ .DS_Store
12phpunit.xml
23composer.lock
34vendor
Original file line number Diff line number Diff line change 3434$ client ->setApplicationName ("Client_Library_Examples " );
3535$ apiKey = "<YOUR_API_KEY> " ; // Change to your API key.
3636// Warn if the API key isn't changed!
37- if ($ apiKey == ' <YOUR_API_KEY> ' ) {
37+ if (strpos ( $ apiKey, " < " ) ! == false ) {
3838 echo missingApiKeyWarning ();
39+ exit ;
3940} else {
4041 $ client ->setDeveloperKey ($ apiKey );
4142
Original file line number Diff line number Diff line change 109109 fclose ($ handle );
110110}
111111echo pageHeader ("File Upload - Uploading a large file " );
112- if (
113- $ client_id == '<YOUR_CLIENT_ID> '
114- || $ client_secret == '<YOUR_CLIENT_SECRET> '
115- || $ redirect_uri == '<YOUR_REDIRECT_URI> ' ) {
112+ if (strpos ($ client_id , "googleusercontent " ) == false ) {
116113 echo missingClientSecretsWarning ();
114+ exit ;
117115}
118116?>
119117<div class="box">
Original file line number Diff line number Diff line change @@ -79,11 +79,9 @@ function. We store the resultant access token
7979}
8080
8181echo pageHeader ("User Query - Retrieving An Id Token " );
82- if (
83- $ client_id == '<YOUR_CLIENT_ID> '
84- || $ client_secret == '<YOUR_CLIENT_SECRET> '
85- || $ redirect_uri == '<YOUR_REDIRECT_URI> ' ) {
82+ if (strpos ($ client_id , "googleusercontent " ) == false ) {
8683 echo missingClientSecretsWarning ();
84+ exit ;
8785}
8886?>
8987<div class="box">
Original file line number Diff line number Diff line change 8888}
8989
9090echo pageHeader ("User Query - Multiple APIs " );
91- if (
92- $ client_id == '<YOUR_CLIENT_ID> '
93- || $ client_secret == '<YOUR_CLIENT_SECRET> '
94- || $ redirect_uri == '<YOUR_REDIRECT_URI> ' ) {
91+ if (strpos ($ client_id , "googleusercontent " ) == false ) {
9592 echo missingClientSecretsWarning ();
93+ exit ;
9694}
9795?>
9896<div class="box">
Original file line number Diff line number Diff line change 4141$ key_file_location = '' ; //key.p12
4242
4343echo pageHeader ("Service Account Access " );
44- if ($ client_id == ' <YOUR_CLIENT_ID> '
44+ if (strpos ( $ client_id, " googleusercontent " ) == false
4545 || !strlen ($ service_account_name )
4646 || !strlen ($ key_file_location )) {
4747 echo missingServiceAccountDetailsWarning ();
48+ exit ;
4849}
4950
5051$ client = new Google_Client ();
Original file line number Diff line number Diff line change 3737$ client ->setApplicationName ("Client_Library_Examples " );
3838$ apiKey = "<YOUR_API_KEY> " ; // Change this line.
3939// Warn if the API key isn't changed.
40- if ($ apiKey == ' <YOUR_API_KEY> ' ) {
40+ if (strpos ( $ apiKey, " < " ) ! == false ) {
4141 echo missingApiKeyWarning ();
42+ exit ;
4243}
4344$ client ->setDeveloperKey ($ apiKey );
4445
Original file line number Diff line number Diff line change 9696}
9797
9898echo pageHeader ("File Upload - Uploading a small file " );
99- if (
100- $ client_id == '<YOUR_CLIENT_ID> '
101- || $ client_secret == '<YOUR_CLIENT_SECRET> '
102- || $ redirect_uri == '<YOUR_REDIRECT_URI> ' ) {
99+ if (strpos ($ client_id , "googleusercontent " ) == false ) {
103100 echo missingClientSecretsWarning ();
101+ exit ;
104102}
105103?>
106104<div class="box">
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ function missingApiKeyWarning()
5252 </h3> " ;
5353 } else {
5454 $ ret = "Warning: You need to set a Simple API Access key from the Google API console: " ;
55- $ ret .= "\nhttp://developers.google.com/console " ;
55+ $ ret .= "\nhttp://developers.google.com/console \n " ;
5656 }
5757 return $ ret ;
5858}
@@ -68,7 +68,7 @@ function missingClientSecretsWarning()
6868 </h3> " ;
6969 } else {
7070 $ ret = "Warning: You need to set Client ID, Client Secret and Redirect URI from the " ;
71- $ ret .= "Google API console: \nhttp://developers.google.com/console " ;
71+ $ ret .= " Google API console: \nhttp://developers.google.com/console \n " ;
7272 }
7373 return $ ret ;
7474}
@@ -84,7 +84,7 @@ function missingServiceAccountDetailsWarning()
8484 </h3> " ;
8585 } else {
8686 $ ret = "Warning: You need to set Client ID, Email address and the location of the Key from the " ;
87- $ ret .= "Google API console: \nhttp://developers.google.com/console " ;
87+ $ ret .= " Google API console: \nhttp://developers.google.com/console \n " ;
8888 }
8989 return $ ret ;
9090}
Original file line number Diff line number Diff line change @@ -98,11 +98,9 @@ function. We store the resultant access token
9898}
9999
100100echo pageHeader ("User Query - URL Shortener " );
101- if (
102- $ client_id == '<YOUR_CLIENT_ID> '
103- || $ client_secret == '<YOUR_CLIENT_SECRET> '
104- || $ redirect_uri == '<YOUR_REDIRECT_URI> ' ) {
101+ if (strpos ($ client_id , "googleusercontent " ) == false ) {
105102 echo missingClientSecretsWarning ();
103+ exit ;
106104}
107105?>
108106<div class="box">
You can’t perform that action at this time.
0 commit comments