[phplib-dev] Fw discussion 2: [phplib] PHPlib session using PHP4 sessions implementation: the code From: R.B. Scholtus (regiment <email protected>)
Date: 11/30/00

----- Original Message -----
From: R.B. Scholtus <regiment <email protected>>
To: Max Derkachev <kot <email protected>>; <phplib <email protected>>
Sent: Thursday, November 30, 2000 5:23 PM
Subject: Re: [phplib] PHPlib session using PHP4 sessions implementation: the
code

> Hoi Max,
>
> Wow, you have another lets say port of phplib. hihihi we have 3 of them
now
> :-)
> The first one is written about 2 months ago. The second was written by me,
6
> weeks ago. and now you have the third one.
>
> Your port is still using a lot of old session stuff right? did you manage
to
> make it compatible?
>
> Well, whatever, my extension is 100% compatible and is completely
> transparent. you can make a existing php3 + phplib site use php4 sessions
> within seconds. the API is the same. i have some good documentation on how
> to 'install' and use it. its works quite well for some people already. i
> dont know about its performance but it should be as fast as php4 sessions.
> please check it, its on the CVS and available at
http://phplib-4.myip.org/.
> the only thing i want to make it do is to decide for itself wheter it
> should use php4 native or phplib sessions. this would make it even easier
to
> install. i dont know when a new version of phplib will come out, im
> wondering.
>
> byebye,
>
> brian
>
>
>
> ----- Original Message -----
> From: Max Derkachev <kot <email protected>>
> To: <phplib <email protected>>
> Sent: Thursday, November 30, 2000 1:46 PM
> Subject: [phplib] PHPlib session using PHP4 sessions implementation: the
> code
>
>
> > I've made an implementation of PHPLib's Session class that uses PHP4
> > native sessions.
> > It uses PHPLib's CT_* custom storage containers, and functioning just
> > like good old PHPLib (I guess :)). It is almost fully compatible with
> > PHPLib 7.2 distribution.
> > For me, it works pretty well, my benchmark (script execution timing)
> > showed almost 2x performance boost (Pentium200 Linux Debian 2.2 box), I
> > guess because of using session_encode in serialize() method instead of
> > serialize() written in php. Also there is no need now in using eval() in
> > thaw(), since php now takes care for it.
> > To use it, copy the files to PHPLib's directory and make appropriate
> > changes in prepend.php.
> > I haven't got the sense of using $sess->in property, and did not
> > included complete support for it, and you should change something in
> > auto_init file, if you use auto_init, since it is called every time the
> > script is executed. I use Cart class, and changed my setup.inc that way:
> >
> > <?php
> > global $sess, $cart;
> > if (!$sess->is_registered('cart')) $cart = new My_Cart;
> > $cart->start();
> > ?>
> > to make sure that the $cart object won't be reinitialized and all cart
> > data lost, if the object is a registered session variable.
> >
> > $sess->freeze is excluded from page_close() since php takes care of
> > saving session data, and there is no need to call page_close anymore, if
> > you're not using User class, I guess.
> >
> > I tested it with an existing application built with PHPLib 7. It works
> > here at php-4.0.3pl1 as Apache module, CT_Sql container and mysql's
> > DB_Sql. All the classes except Session remain unchanged. No changes in
> > the database. Some changes made to page.inc (page_open() and
> > page_close()). I tried it with php4.0.2, but there was a weird error -
> > it seemed that prepend.php was cached somewhere, and php issued an error
> > (trying to redeclare classes from files require()'d by prepend.php). I
> > swear I did not included that files twice :). I did even try to hack
> > prepend.php to change require() to require_once(), include_once() or
> > die(), etc. No luck. With php4.0.3pl1, however, it works perfectly.
> > I'm not sure that User class will work with that implementation, I guess
> > some changes to the User class should be done (methods freeze() and
> > thaw(), I suppose), but I did not look through it since I don't use the
> > User class currently.
> >
> > I'd be very appreciated if someone send me a
> > note/corrections/improvements/etc. I'd be happy to see my code in CVS
> > tree also :). Good luck.
> >
> > --
> > Best regards,
> > Max A. Derkachev mailto:kot <email protected>
> > Symbol-Plus Publishing Ltd.
> > phone: +7 (812) 324-5353
> > http://www.Books.Ru -- All Books of Russia
> >
> >
> >
>
>
> --------------------------------------------------------------------------

--
> ----
>
>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> > For additional commands, e-mail: phplib-help <email protected>
>

--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-dev-unsubscribe <email protected> For additional commands, e-mail: phplib-dev-help <email protected>