amazOOP amazOOP
[ class tree: amazOOP ] [ index: amazOOP ] [ all elements ]
< Prev Up Next >
Installation Getting Started Using amazOOP

Configuration

Configuring amazOOP shouldn't take more than 10 minutes...

Mauricio Diaz Orlich
Copyright 2004, Mauricio Diaz
(amazOOP 0.2)

Summary

This document will guide you through the configuration file of amazOOP. If you followed the instruction on the previous page to install amazOOP, your configuration file should be located in the following path: c:\path\to\amazoop\config.inc.php

We will use the same conventions as in the previous page, i.e. Throughout this documentation we will assume that your test server is running Microsoft Windows and your site is stored in directory c:\path\to. Your definitive server will be running a flavor of UNIX and your site will be stored in directory /path/to. This is a practical decision to show the syntax that should be used on both types of operating systems.

You can find documentation specific to the configuration file here.

The config.inc.php file

The config.inc.php file is basically divided in two sections:

  • one you must modify in order for amazOOP to work on your server. This is the section that will be described in this document.
  • The second part of config.inc.php should only be modified if you are confident you know what you are doing. This part is covered in the advanced settings section.

Server

First you must setup the domain names of your servers. You may also use an IP address, for example if your test server is not associated with any domain name.

  1. $testServer = "test.server.com";
  2.  
  3. $defServer = "www.server.com";

Based on your server's OS, you also have to specify the character(s) that separete files. Remember that our test server is running Windows, and our definitive server is running Linux or another UNIX-like OS.

  1. if($_SERVER['SERVER_NAME'] == $testServer)
  2. $fileSeparator = "\\";
  3. else
  4. $fileSeparator = "/";

Page type

Next you must indicate some characteristics of your pages.

You must indicate which character(s) are used to close individual tags. If your pages are written in XHTML you should use " />", otherwise you should use " >". Given the success XML has had lately, I suggest you start coding your pages in XHTML if you don't do so yet.

Now you must indicate whether your pages are encoded in UTF-8 or not. By default, AWS feeds are encoded in UTF-8 since they can include characters in Japanese and other languages, but if you choose not to use UTF-8, all data will be transformed into ISO-8859-1. I suggest using UTF-8 in your pages, specially if you are going to display information from Amazon.co.jp.

  1. /**
  2. * Set this to " />" if your pages are in XHTML, or " >" otherwise.
  3. */
  4. $tagClose = " />";
  5.  
  6. /**
  7. * Set this to true if your pages are UTF-8 encoded, or false otherwise
  8. */
  9. $UTF_8 = true;

Logging

You must now decide whether you want amazOOP to log errors and requests.

Set these variables to true if you want to enable logging, or false if you do not require logging.

  1. $logErrors = true;
  2. $logRequests = true;

You must set a size for your log files, whether you are using them or not. If you are not using log files these values will be ignored. The size is set in number of lines. I have these values set to 2000 lines which seems to be enough in terms of time and the files should not exceed 160KB.

  1. $requestLogSize = 2000;
  2.  
  3. $errorLogSize = 2000;

You must obviously specify where your logs will be written. The file you downloaded from SourceForge already contains an error log and a request log. Of course, you may choose to use any other file, as long as it amazOOP has write permissions for it.

The variable that holds the name of the request log is $logFile and the variable that holds the name of the error log is $errorLog.

  1. if($_SERVER['SERVER_NAME'] == $testServer)
  2. $logFile = "c:\\path\\to\\amazoop\\requests.log";
  3. else
  4. $logFile = "/path/to/amazoop/requests.log";
  5. if($_SERVER['SERVER_NAME'] == $testServer)
  6. $errorLog = "c:\\path\\to\\amazoop\\error.log";
  7. else
  8. $errorLog = "/path/to/amazoop/error.log";

Associates IDs

You can earn money from the sales you make using amazOOP. For this you have to apply to Amazon's different associate programs around the world. When you get accepted in an associate program, you receive an associate ID, wich you should add to amazOOP.

You do not have to request associate IDs from every Amazon site. You can request IDs only for the sites you intend to sell products from and leave the rest with the default value which is "webservices-20"

The addresses to the different associate program are:

French and Canadian Web Services are not available as of release 0.2. According to AWS they should be available sometime during mid-2004

  1. $assocIDs = array( "us" => "usId-20",
  2. "uk" => "ukId-21",
  3. "fr" => "frId-22",
  4. "de" => "deId-23",
  5. "jp" => "jpId-24",
  6. "ca" => "caId-25"
  7. );

Images

You can use images in several places in amazOOP.

The most obvious place to start is with product images. These are usually provided by Amazon, but occassionally, some product do not have an image. You can specify default images to be used instead when this happens.

Since Amazon returns three image sizes, you must assign an image for each size. Of course, you can also assign one image to all three sizes.

Our site's images are stored in folder c:\path\to\images\ in our test server and in folder /path/to/images/ in our definitive server.

  1. $defaultImages = array( "small" => "/images/small.gif",
  2. "medium" => "/images/medium.gif",
  3. "large" => "/images/large.gif"
  4. );

Another place where you can use images, is for representing different platforms and supports, such as DVDs, VHS, PS2, etc.

  1. $media = array( "dvd" => "/images/platforms/dvd.gif",
  2. "vhs" => "/images/platforms/vhs.gif",
  3. "dreamcast" => "/images/platforms/dreamcast.gif",
  4. "gamecube" => "/images/platforms/gcube.gif",
  5. "linux" => "/images/platforms/linux.gif",
  6. "ps2" => "/images/platforms/ps2.gif",
  7. "windows" => "/images/platforms/windows.gif",
  8. "xbox" => "/images/platforms/xbox.gif"
  9. );

You can also specify images to be used instead of regular buttons when creating "Add to cart" forms.

  1. $buyNowImg = array ( "us" => "/images/mall/buttons/buyNowUS.gif",
  2. "uk" => "/images/mall/buttons/buyNowUK.gif",
  3. "de" => "/images/mall/buttons/buyNowDE.gif",
  4. "jp" => "/images/mall/buttons/buyNowJP.gif"
  5. );

Cache and Temporary Folders

To comply with the AWS Licese Agreement, and to improve performance, amazOOP requires to directories to be created. Normally, when you extract the amazOOP source files to your website's directory, these directories are automatically created.

You can use any other directories in your webserver as cache and temporary folder, as long as they have write permission for amazOOP.

  1. /**
  2. * Temporary directory
  3. */
  4. if($_SERVER['SERVER_NAME'] == $testServer)
  5. $tmpDir = "c:\\path\\to\\amazoop\\tmp";
  6. else
  7. $tmpDir = "/path/to/amazoop/tmp";
  8. /**
  9. * Cache Directory
  10. */
  11. if($_SERVER['SERVER_NAME'] == $testServer)
  12. $cacheDir = "c:\\path\\to\\amazoop\\cache";
  13. else
  14. $cacheDir = "/path/to/amazoop/cache";

RSS Feeds

You can use amazOOP to provide RSS feeds. In order to do this you have to indicate the path to the template to be used for the feed.

A sample template is included with amazOOP, but this feature is experimental and will probably change in future releases.

  1. if($_SERVER['SERVER_NAME'] == $testServer)
  2. $xmlTemplate = "c:\\path\\to\\amazoop\\feed.xml";
  3. else
  4. $xmlTemplate = "/path/to/amazoop/feed.xml";

You should also setup some information needed to fill in the RSS feed. You may, of course, leave this section empty if you don't plan to use RSS feeds.

  1. $rss = array( "xmlSchema" => "http://www.madd0.com/rss2m.xsd",
  2. "link" => "http://www.server.com/",
  3. "copyright" => "The content provided in this feed may be copyrighted.",
  4. "managingEditor" => "editor@server.com",
  5. "webMaster" => "webmaster@server.com",
  6. "author" => "author@server.com",
  7. "generator" => "amazOOP v0.2 (http://amazoop.sourceforge.net)",
  8. "docs" => "http://backend.userland.com/rss",
  9. "imageURL" => "http://www.server.com/images/logo_88x31.gif",
  10. "imageTitle" => "My Website",
  11. "imageLink" => "http://www.server.com",
  12. "imageWidth" => "88",
  13. "imageHeight" => "31",
  14. "title" => "My Website - ",
  15. "description" => ""
  16. );

Once this is configured, you are ready to start using amazOOP. AmazOOP can be further customized to fit your specific needs, however, you have to be confortable with PHP, and be armed with a lot of patience to understand the code. AmazOOP's advanced configuration is documented in the Advanced Settings section.

< Prev Up Next >
Installation Getting Started Using amazOOP
 
Documentation generated on Sat, 21 Aug 2004 17:39:33 +0200 by phpDocumentor 1.3.0RC3
hosted by
SourceForge.net Logo