[imp] IMP and POP3 support (fwd)

Andrew Morgan morgan@orst.edu
Tue Nov 5 17:20:22 2002


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---------------------- multipart/mixed attachment

I'm resending this because I didn't get a response last week...  Jon, your
thoughts on questions 1 and 2 below would be very appreciated!  :)

	Andy

---------- Forwarded message ----------
Date: Tue, 29 Oct 2002 14:13:23 -0800 (PST)
From: Andrew Morgan <morgan@orst.edu>
To: Jon Parise <jon@horde.org>
Cc: imp@lists.horde.org
Subject: Re: [imp] IMP and POP3 support



On Mon, 28 Oct 2002, Jon Parise wrote:

> On Sun, Oct 27, 2002 at 08:53:02PM -0800, Andrew Morgan wrote:
>
> > I've been looking into adding support for MySQL based sessions.  Maybe
> > I'll get to that this week.  Has anyone else out there done this?
>
> I've run sessions from an PostgreSQL database for quite a while.  My
> handler is located here:
>
>     http://www.csh.rit.edu/~jon/projects/pgsql_session_handler/
>
> I'm certain there are similar implementations for MySQL.

I ended up writing a cross between your pgsql session handler and Ying
Zhang's mysql session handler.  My version is attached to this message.

I have a few questions about your session handler:

1. Doesn't using addslashes($val) on the session write modify the session
data?  Does PHP automatically remove the slashes later when the
application tries to use the session data?

2. Why do you add a session if one is not found in session_read?


How do I integrate this with my Horde installation?  Should I add this to
auto_prepend_file in php.ini?

Thanks,
	Andy

---------------------- multipart/mixed attachment
PD9waHANCi8qKg0KICogTXlTUUwgU2Vzc2lvbiBIYW5kbGVyIGZvciBQSFAN
CiAqDQogKiBDb3B5cmlnaHQgMjAwMC0yMDAyIEpvbiBQYXJpc2UgPGpvbkBj
c2gucml0LmVkdT4uICBBbGwgcmlnaHRzIHJlc2VydmVkLg0KICoNCiAqICBS
ZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZv
cm1zLCB3aXRoIG9yIHdpdGhvdXQNCiAqICBtb2RpZmljYXRpb24sIGFyZSB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3RhYmxl
IFdIRVJFIGxhc3RfYWN0aXZlIDwgJGV4cGlyeSI7DQogICAgJHFpZCA9IG15
c3FsX3F1ZXJ5KCRxdWVyeSwgJG15c3FsX3Nlc3Npb25faGFuZGxlKTsNCg0K
ICAgIHJldHVybiBteXNxbF9hZmZlY3RlZF9yb3dzKCRteXNxbF9zZXNzaW9u
X2hhbmRsZSk7DQp9DQoNCi8qIFJlZ2lzdGVyIHRoZSBzZXNzaW9uIGhhbmRs
aW5nIGZ1bmN0aW9ucyB3aXRoIFBIUC4gKi8NCnNlc3Npb25fc2V0X3NhdmVf
aGFuZGxlcigNCiAgICAnbXlzcWxfc2Vzc2lvbl9vcGVuJywNCiAgICAnbXlz
cWxfc2Vzc2lvbl9jbG9zZScsDQogICAgJ215c3FsX3Nlc3Npb25fcmVhZCcs
DQogICAgJ215c3FsX3Nlc3Npb25fd3JpdGUnLA0KICAgICdteXNxbF9zZXNz
aW9uX2Rlc3Ryb3knLA0KICAgICdteXNxbF9zZXNzaW9uX2djJw0KKTsNCg0K
Pz4NCg==
---------------------- multipart/mixed attachment

-- 
IMP mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: imp-unsubscribe@lists.horde.org

---------------------- multipart/mixed attachment--


More information about the imp mailing list