Scodigo, Inc.

Log In | Register

Cart Items:
0

Zend Gdata library on Windows

I am not able to get Zend Gdata client library working on Windows (http://code.google.com/apis/gdata/articles/php_client_lib.html). The PHPx functions I have built on the Mac side to login / create / edit Google Calendar events don't return anything.

I realize this may be more of a straight PHP issue, not a plugin thing. I am curious if there is any basic issue I am missing such as PHP Extensions or PHP.ini settings.

-------------

Here is the Gdata code:

http://framework.zend.com/download/gdata/

-------------

The include path is working fine. It is loading the classes. I can run echo "hello"; from the top of each include and they work.

-------------

Google has a simple "Installation Checker" routine that works just fine from the Mac side. I drop this code into the functionMaker.fp7 file and it spits out success on the Mac side. Windows side = nothing.

http://framework.zend.com/svn/framework/standard/trunk/demos/Zend/Gdata/...

The routine tells me that everything loads fine, including these required extensions:

'ctype', 'dom', 'libxml', 'spl', 'standard', 'openssl'

-----------

The most simple example of loging into Google via the Client Login class:

    require_once 'Zend/Loader.php';
    Zend_Loader::loadClass('Zend_Gdata');
    Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
    Zend_Loader::loadClass('Zend_Gdata_Calendar');

    $user = 'blah@gmail.com';
    $pass = 'blah';
    $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined service name for calendar

    $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);

    $token = $client->getClientLoginToken();
    echo $token;

-----------

No echo "hi" or anything runs after the step $token = $client->getClientLoginToken();

It doesn't timeout, it just dies very quickly.

I can use TRY and catch the error as they do in the installation checker, but that doesn't output anything.

-------------

Any help is awesome.

Thanks,
Bill

Good news!

Micah Woods's picture

Take a look at post http://www.scodigo.com/forums/post/248. We finally got this one solved. I've tested the above code with my own Google credentials and do indeed get a token returned. Look for a new 2.0.1 version to be released shortly.

Regards,
Micah

Thanks for the Regex research

Micah,

Thanks for replicating the problem and for spotting the Regex issue. I'll subscribe to /post/248 and see what I can find on my end.

Thanks,
Bill

Regex issue is part of the problem

Micah Woods's picture

Hello Bill,

I'm able to get your example working on OSX. When I pass in valid credentials, I get back a token.

I did some troubleshooting and I think one major problem is an issue we have with regex on Windows. See this post for more details:

http://www.scodigo.com/forums/post/248

I added a try/catch and that allowed me to figure out where the errors were occurring:

try {
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
$token = $client->getClientLoginToken();
echo "token: " . $token;
} catch (Exception $e) {
echo $e;
}

I then commented out a few of the places were preg_match was used and was able to get through some of the exceptions but in the end the $client object wasn't getting created and it wasn't readily apparent as to why.

We're working on the regex issue which may solve this. For the time being, I'd recommend adding the try/catch and with a little more work you may be able to get it working. Wish I had a better answer.

Regards,
Micah

Trying Manual Approach

Micah,

I did some debugging and yep, I can see how the Regex is blowing things up. Some expressions work, but many others don't.

After some digging, it seems that Regex is the key to parsing the responses from Google. I commented out some things, but others are fundamental. I think rather than try to patch up Zend, I am going to build a manual POST/PUT function using CURL.

This make take some time, so if you think you are close to getting Regex sorted out, please let me know.

Best of luck,
Bill