NikosTsolakos / google-api-php-client

Automatically exported from code.google.com/p/google-api-php-client
Apache License 2.0
0 stars 0 forks source link

AdSense Reporting class unable to properly initialize #47

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
Fatal error: Uncaught exception 'apiException' with message 'Unknown function: 
adsense->reports->generate()' in apiServiceResource.php

What version of the product are you using? On what operating system?
PHP 5.3.8

Please provide any additional information below.
Related to this issue:  
http://code.google.com/p/google-api-php-client/issues/detail?id=42

The fix in the source did not fix it... the underlying problem is the JSON 
encoded method definition cannot be decoded.  If you take the JSON code (from 
trunk), you can see PHP is unable to decode the JSON...

print_r (json_decode('{"methods": {"generate": {"scopes": 
["https://www.googleapis.com/auth/adsense", 
"https://www.googleapis.com/auth/adsense.readonly"], "parameters": {"sort": 
{"pattern": "(\\+|-)?[a-zA-Z_]+", "repeated": true, "type": "string", 
"location": "query"}, "startDate": {"pattern": "\\d{4}-\\d{2}-\\d{2}", 
"required": true, "type": "string", "location": "query"}, "endDate": 
{"pattern": "\\d{4}-\\d{2}-\\d{2}", "required": true, "type": "string", 
"location": "query"}, "locale": {"pattern": "[a-zA-Z_]+", "type": "string", 
"location": "query"}, "metric": {"pattern": "[a-zA-Z_]+", "repeated": true, 
"type": "string", "location": "query"}, "maxResults": {"format": "int32", 
"maximum": "50000", "minimum": "0", "location": "query", "type": "integer"}, 
"filter": {"pattern": "[a-zA-Z_]+(==|=@).+", "repeated": true, "type": 
"string", "location": "query"}, "currency": {"pattern": "[a-zA-Z]+", "type": 
"string", "location": "query"}, "startIndex": {"format": "int32", "maximum": 
"5000", "minimum": "0", "location": "query", "type": "integer"}, "dimension": 
{"pattern": "[a-zA-Z_]+", "repeated": true, "type": "string", "location": 
"query"}}, "id": "adsense.reports.generate", "httpMethod": "GET", "path": 
"reports", "response": {"$ref": "AdsenseReportsGenerateResponse"}}}}', true));
json_last_error();

It gives a json last error of 4, which is JSON_ERROR_SYNTAX.

Original issue reported on code.google.com by digitalp...@gmail.com on 14 Dec 2011 at 11:38

GoogleCodeExporter commented 8 years ago
This is now fixed on TRUNK.
Thank you for reporting this issue!

Original comment by chirags@google.com on 15 Dec 2011 at 9:39

GoogleCodeExporter commented 8 years ago
Hi, It doesn't seem to be fixed: the same issue is being discussed at 
http://code.google.com/p/google-api-php-client/issues/detail?id=42#makechanges

Original comment by gotardog...@gmail.com on 6 Jan 2012 at 12:29