#28475 [Opn]: Variable dropping value with Sessions and PEAR::Log

From: Date: Sat, 12 Jun 2004 15:51:09 +0000
Subject: #28475 [Opn]: Variable dropping value with Sessions and PEAR::Log
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-60826@lists.php.net to get a copy of this message
ID: 28475 User updated by: m at saffitz dot com Reported By: m at saffitz dot com Status: Open Bug Type: Zend Engine 2 problem -PHP Version: 5CVS-2004-05-21 (dev) +PHP Version: PHP 5.0.0RC3 New Comment: Confirming that this bug is still present in PHP 5.0.0RC3. Previous Comments: ------------------------------------------------------------------------ [2004-05-21 19:09:37] m at saffitz dot com Description: ------------ I have a simple session handler which uses a postgres database for storage, and Pear::Log for logging. A script with all necessary code for reproduction is below. When I run the code as is (obviously adding in db parameters), the code runs without errors, but the path to the log is inserted as the id in the database instead of the session id. There are two independent changes I can make to avoid this behavior: 1) Use a shorter path for the log file. Using /log.log and the script functions as expected. 2) Switch lines 52 and 53, and 56 and 57, (i.e. to: $sql = "insert into sessions (id,datavalue) values ('$id','$val')"; $this->logger->log("Not found, inserting"); With the lines switched the script functions as expected. I've seen this bug on Mac OS X and Fedora Core 1. Reproduce code: --------------- http://www.saffitz.com/phperr.phps Session Table Definition: Table "public.sessions" Column | Type | Modifiers -------------------+------+---------------------- id | character varying(255) | not null created_date | date | not null default '2004-05-15'::date modification_date | timestamp without time zone | not null default '2004-05-15 00:35:58.094778'::timestamp without time zone datavalue | text | Indexes: sessions_pkey primary key btree (id) Expected result: ---------------- Session is populated correctly in the database (with correct id), and the count printed to the screen increments with each refresh. Actual result: -------------- Session is incorrectly populated in the database (path to log file is populated instead), and the count on the screen is not incremented. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28475&edit=1

« previous php.bugs (#60826) next »