PHP Classes
elePHPant
Icontem

PHP Base: Submit data files to the Google Base service

Recommend this page to a friend!
  Info   View files View files (13)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2006-01-09 (10 years ago) RSS 2.0 feedNot enough user ratingsTotal: 1,010 All time: 3,490 This week: 924Up
Version License Categories
phpbase 1.0GNU Lesser Genera...Files and Folders, Web services
Description Author

This class can be used to submit data files to the Google Base service.

It can validate the data before it is uploaded to the Google Base via FTP.

The class can be extended with plugin for defining attributes and supporting multiple schemes. Currently only the Housing scheme is supported.

Innovation Award
PHP Programming Innovation award nominee
December 2005
Number 2


Prize: One copy of DWeb Pro Lifetime License
Google Base is free service provided by Google. It lets anybody submit all sorts of content files for storage in the Google Base. It can attach additional attributes that better describes the submitted content, so it can be found more easily.

It provides a Web services API that can be used to submit content to the Google Base.

This class provides PHP API to make it easy to submit content to the Google Base using PHP scripts.

Manuel Lemos
Picture of Bermi Ferrer Martinez
Name: Bermi Ferrer Martinez <contact>
Classes: 4 packages by
Country: Spain Spain
Innovation award
Innovation award
Nominee: 2x

Details
PhpBase 0.1a (http://www.phpbase.org)

What is it?
PhpBase is a free PHP library useful for submitting you website
dynamic content to Google Base.

Features:
Common field validation according to http://google.com/base/tab_attributes.html
Default scheme definitions (actually only Housing)
FTP Client for submitting to Google Base


Usage:

You can start using this library by including in your source the file PhpBase.php.
require_once('phpbase/PhpBase.php');

$PhpBase =& new PhpBase('Housing');

Where Housing is the schema found at phpbase/schemes/Housing.php
$PhpBase->setDomain('example.com');

If a domain name is specified, it will be appended to the id attribute.
$my_properties = array(
'12-LKF' => 
'title'=>'Nice house on the beach', 
'description' => 'Nice house with views to bay, 
It has an enormous deck for up to 10 boats' ),
'14-LKF' => 
'title'=>'Apartment in San Francisco', 
'description' => 'Cute apartment for sublet in 
downtown San Francisco'),
//.........more properties here
);

if($PhpBase->addItems($my_properties)){
    if($PhpBase->send('username', 
    'password', 'filename')){
        echo "Data was submitted 
        successfully to Google Base";
    }else{
        echo "There was an error on 
        the FTP connection to Google Base";
    }
}else{
    echo "Ooops, there where some 
    problems when preparing the data feed. 
    These are the attributes 
    where we found the problems ";
    echo join($PhpBase->getAttributesWithProblems());
}

You can also add row by row like this
if(!$PhpBase->addItem($single_property_array)){
    echo "There was an error on ".
    $PhpBase->lastError();
}

and the send it normally data as on previous example using
$PhpBase->send('username', 
'password', 'filename');

In order to create you own schema have a look to schemes/Housing.php and to the attribute helpers in the attributes/ folder 



Please send bugs and suggestions to phpbase akelos com

Thanks for your interest.
  Files folder image Files  
File Role Description
Files folder imagePhpBase (4 files, 3 directories)
Accessible without login Plain text file LICENSE Lic. License
Plain text file PhpBase.php Class Main Class
Accessible without login Plain text file README Doc. README

  Files folder image Files  /  PhpBase  
File Role Description
Files folder imageattributes (1 file)
Files folder imagerenders (1 file)
Files folder imageschemes (4 files)
  Plain text file AkFtpClient.php Class FTP Client class
  Plain text file GoogleBaseItem.php Class Item class
  Plain text file GoogleBaseItemValidator.php Class Item validation class
  Plain text file GoogleBaseRender.php Class Base render class

  Files folder image Files  /  PhpBase  /  attributes  
File Role Description
  Accessible without login Plain text file README Data PLEASE READ THIS BEFORE DOWNLOADING

  Files folder image Files  /  PhpBase  /  renders  
File Role Description
  Plain text file Tabbed.php Class Tabbed render

  Files folder image Files  /  PhpBase  /  schemes  
File Role Description
  Accessible without login Plain text file Code.php Data Code schema
  Accessible without login Plain text file Default.php Data Default schema
  Accessible without login Plain text file Housing.php Data Housing schema
  Accessible without login Plain text file NewsAndArticles.php Aux. News and articles schema

 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,010
This week:0
All time:3,490
This week:924Up