0

I'm attempting to write a simple script to read from and write to a Google Spreadsheet. I cannot seem to get the correct Zend include paths to work.

I began by using this walkthrough, kindly provided by a fellow developer: http://www.farinspace.com/saving-form-data-to-google-spreadsheets/

I have been using different permutations of the location of the Zend GData library (downloaded directly from the Zend website), which claims it is supposed to work without the entire framework.

I have tried the following:

1) Zend library folder ZendGdata-1.12.17 right off the web root (since the code provided uses the following convention)

set_include_path(get_include_path() . PATH_SEPARATOR . "$_SERVER[DOCUMENT_ROOT]/ZendGdata-1.8.1/library");

I, of course switched the directory to the correct one, so that I use the following:

set_include_path(get_include_path() . PATH_SEPARATOR . "$_SERVER[DOCUMENT_ROOT]/ZendGdata-1.12.17/library");

This results in this message:

Fatal error: require_once(): Failed opening required 'Zend/Http/Header/HeaderValue.php' (include_path='.:/usr/lib/php5.5:/kunden/homepages/40/USERNAME/htdocs/network/ZendGdata-1.12.17/library') in /homepages/40/USERNAME/htdocs/network/ZendGdata-1.12.17/library/Zend/Http/Client.php on line 45

2) Putting the include path in a php.ini file.

3) Putting the include path in .htaccess

4) Using other set_include_path statements

5) Uploading the Xml folder to the Zend library folder (per another answer)

It seems that I can get the initial loader to load Zend, but in the Google_Spreadsheet.php file it loads several of the classes:

    Zend_Loader::loadClass('Zend_Http_Client');
    Zend_Loader::loadClass('Zend_Gdata');
    Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
    Zend_Loader::loadClass('Zend_Gdata_Spreadsheets');

I've tried putting the Zend GData library into a directory on the same level as the webroot, and still get errors.

I do not have access to SSH or very much past simple control panel functionality (no include path access in php.ini).

Other answers I have looked at:

Zend Gdata include path issue (Loader.php)

Zend Framework include path

ZendGdata framework path set error

AND MANY MORE.

Community
  • 1
  • 1
Rick Scolaro
  • 485
  • 1
  • 10
  • 28

1 Answers1

0

What would happen if you just create script.php in the folder where Zend folder is, so it looks like:

[Zend]
script.php

and inside script.php do this:

<?php
require_once(dirname(__FILE__).'/Zend/Loader/Autoloader.php');

$loader = Zend_Loader_Autoloader::getInstance();

$spreadsheet = new Zend_Gdata_Spreadsheets();

var_dump($spreadsheet);

will it instantiate Zend_Gdata_Spreadsheets object and dump it without errors?

Alexey
  • 3,414
  • 7
  • 26
  • 44