Search code examples
phpgdata

Installing Zend Gdata Client library


Hi this is my first post on here. I am trying to install the Gdata Zend Client library without much success.

I have used these resources + scoured Stack Overflow.

https://developers.google.com/gdata/articles/php_client_lib

http://jeromejaglale.com/doc/php/google_calendar_api

I want to be able to add,edit etc events on google calendar via PHP. My problem/question is i really dont understand what the include_path settings are all about and how to set them in order to make the class work. Of course i checked php manual regarding this but still draw a blank.

I have downloaded the relevant class and uploaded it to my web root. In the past i would just include a class by using php include at the top of the page and this would suffice.

I am of the understanding that i need to change the php.ini file to show php where my class is. Does this mean that i have to put my class somewhere else other than the web root.

I am terribly confused about this step and i know that if i can get it installed, actually using the class should be relatively easy.

Thanks for any help.


Solution

  • Welcome! Your Q is about include files rather than ZF elements.

    Understanding where the include setting can be made (and subsequently overridden) is an absolute key bit of information.

    You need to find out where it is on the server you are working on.

    echo ini_get('include_path');

    Then dash off and really, really read the corresponding manual page.

    Try out including a very simple file with an echo statement, and you will regain your sanity and confidence.

    http://www.php.net/manual/en/function.include.php

    Get that working then have a play with this:

    http://www.php.net/manual/en/function.ini-set.php

    The experience how you can include a file from the same directory (not generally a good idea if that is a public webpage - inside your webroot)

    Then if you want to really chase this thing down, look at where you can set this in Apache and per-directory in .htaccess files.

    Finally, you can just include a file by telling include/require the exact path from the top of the tree;

    include /var/www/includes/libraries/and/so/on.php;

    There are SO many places you can set and override this that you are really best off finding out where the server thinks the include directory is and putting your compoenents in there:

    Now, when that comes to ZF stuff, I (on Deb and Ubuntu anyhow) put the contents of

    Zend Framworks version XYZ ZendFramework/lib/Zend <-that folder into:

    /usr/share/php/Zend <-into this place

    Then setup your autoloader and Robert is your mothers brother...