gkhngcmn / google-api-php-client

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

adsense API example PHP_PDO database #118

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Step 1 and 2 from here: http://code.google.com/p/google-api-php-client/
2. Install DBO-sqlite for PHP
3.Attempt to run api/examples/adsense/examples/index.php

What is the expected output? What do you see instead?
Expected the example to complete.
The script failed silently.

What version of the product are you using? On what operating system?
Ubuntu 11.10

Please provide any additional information below.

It fails during AdSenseAuth.php line 104,
 $this->saveToken($dbh, true, $this->apiClient->getAccessToken());
probably because the database table is not created.

It dies in to AdSenseAuth.php->getToken($dbh)

Also when $dbh is created it uses a DSN like this
  'sqlite:examples.sqlite'

According to PHP DPO_SQLITE documentation, it should be an absolute path to the 
file.  The file should be writeable, and also possibly a log file in the same 
directory.

http://www.php.net/manual/en/ref.pdo-sqlite.connection.php

Original issue reported on code.google.com by kle...@fahrenheitmarketing.com on 26 Apr 2012 at 3:23

GoogleCodeExporter commented 8 years ago
Hi,

the instructions to create the sqlite database are in the source code of 
AdSenseAuth:
http://code.google.com/p/google-api-php-client/source/browse/trunk/examples/adse
nse/AdSenseAuth.php#29

I will move the instructions to a README file.

Original comment by silvano....@gmail.com on 26 Apr 2012 at 4:42

GoogleCodeExporter commented 8 years ago
Thank you Silvano,
I should have seen them
The README is better though
I noticed your email on the code so I should have just emailed you.
Kevin.

On Thu, Apr 26, 2012 at 11:42 AM, <google-api-php-client@googlecode.com>wrote:

Original comment by kle...@fahrenheitmarketing.com on 26 Apr 2012 at 4:54

GoogleCodeExporter commented 8 years ago
It will be good if you add example.sqlite file in 
\google-api-php-client\examples\adsense folder.

Original comment by nirbhaym...@gmail.com on 4 May 2012 at 7:24

Attachments:

GoogleCodeExporter commented 8 years ago
Hi Guys,

I am having a problem running the adsense examples aswell.

What is happening is that when i load the adsense/index.php th oauth screen 
appears fine.

When i click on the allow access button the page just reloads.

I tested through the oauth playground and it seems to return the results fine.

Has anyone incountered this?

Original comment by qlarso...@gmail.com on 18 Jul 2012 at 6:12

GoogleCodeExporter commented 8 years ago
Can't see outstanding work here, closing. 

Original comment by ianbar...@google.com on 22 Mar 2013 at 2:06