Previous Up Next
A real example Getting Started with CpmFetch In depth explanations

Upgrading version 1.6.x to 2.0

A quick guide to make your conversion painless (or less painful)

Table of Contents

Overview

All in all, version 2.0 of CpmFetch is not much different. It's just different enough to cause you a good headache and a bit of frusteration if you don't see what is coming. In a nutshell, the differences are: There is an install program you need to run. The way to start the CpmFetch object has changed. The *From functions have had parameters change. I will cover these in detail below - but beyond this, not much has changed that will affect your existing code.

Run the install program

The install.php program is required to create your configuration file. If you do not run this, you will not get much farther. It basically outputs a configuration file that you call from CpmFetch.

For more information see the getting started section on installing.

Starting CpmFetch

With 1.6.4 and before, you passed the CpmFetch object a path to your gallery. With CpmFetch 2.0 and beyond, you pass it a relative path and filename that is your CpmFetch config file. This allows you to have more than one configuration.

So if you had this before:


<?php 
include_once "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
?>
You would now have something like:

<?php 
include_once "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
?>
Note that the new cpm parameter is the relative, or full path to the config file

From functions have changed

I know it was a mean thing to do, but linguistically I could not take it anymore. Any function that ends in "From" such as: cpm_viewRandomMediaFrom cpm_viewLastAddedMediaFrom cpm_getAlbumListFrom ...and possibly some others now take the $source as the first parameter. If you do not want to limit the results, simply pass a "" (two quotes) to represent this.

Previous Up Next
A real example Getting Started with CpmFetch In depth explanations

Documentation generated on Tue, 10 Apr 2007 23:00:31 -0400 by phpDocumentor 1.3.0