[PHPLIB] Cart documentation inconsistancy From: Mark Heintz (mh <email protected>)
Date: 12/13/99

I had to implement a shopping cart for a project today, and decided to
start from scratch using phplib 7.2 rather than reusing my extended cart
class from phplib 6.x. Upon hitting a slight snag (I had forgotten
auto_init) and referring to the documentation, I discovered a slight
inconsistancy. Specifically at
<http://phplib.netuse.de/documentation/documentation-4.html#ss4.1>, the
2nd code segment in section 4.1 says to add the following to setup.inc:

global $cart; ## $cart is a global variable.
$cart = new My_Cart; ## Make a My_Cart instance named $cart
$cart->start(); ## and have it register itself.

Whereas the ninth code segment offers the following for setup.inc:

global $cart;
$cart = new Example_Cart;
// $sess is already global
$sess->register("cart");

Although both these work fine (after all, $cart->start() simply performs
$sess->register("cart")), it is a bit confusing having these two code
segments just paragraphs away from each other without an explanation as to
the difference between the two. Is this just a covert way to get new
users to read the code? ;)

Thanks,
mh

-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.