phplib-users Mailing List for PHPLIB (Page 84)
Brought to you by:
nhruby,
richardarcher
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(106) |
Sep
(99) |
Oct
(44) |
Nov
(97) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(56) |
Feb
(81) |
Mar
(134) |
Apr
(69) |
May
(106) |
Jun
(122) |
Jul
(98) |
Aug
(52) |
Sep
(184) |
Oct
(219) |
Nov
(102) |
Dec
(106) |
2003 |
Jan
(88) |
Feb
(37) |
Mar
(46) |
Apr
(51) |
May
(30) |
Jun
(17) |
Jul
(45) |
Aug
(19) |
Sep
(5) |
Oct
(4) |
Nov
(12) |
Dec
(7) |
2004 |
Jan
(11) |
Feb
(7) |
Mar
|
Apr
(15) |
May
(17) |
Jun
(13) |
Jul
(5) |
Aug
|
Sep
(8) |
Oct
(6) |
Nov
(21) |
Dec
(13) |
2005 |
Jan
(4) |
Feb
(3) |
Mar
(7) |
Apr
(7) |
May
|
Jun
(11) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2006 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
(5) |
2007 |
Jan
(15) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
(3) |
Jul
(1) |
Aug
(19) |
Sep
(2) |
Oct
|
Nov
|
Dec
(6) |
2009 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
From: Ben C. <php...@be...> - 2001-11-05 17:13:14
|
I noticed this problem as well a while back when I first moved to php 4.0.6. What I did (and what I tell people to do when installing phpBugTracker) is patch page.inc, changing line 67 from if (isset($user)) { to if (isset($user) and $user) {. On Mon, Nov 05, 2001 at 08:57:37AM -0000, Taylor, Stewart wrote: > Not sure what is causing this. > Try calling var_dump($user) just before you call the page_close function? > Does this tell you anything? > > -Stewart. > > -----Original Message----- > From: Manuel Aristaran [mailto:mpa...@so...] > Sent: 05 November 2001 03:24 > To: php...@li... > Subject: [Phplib-users] Problem with "user" feature > > > Hello... > > I've run into a quite interesting problem.... > > None of the scripts on the system use the "user" feature, every page_open() > call on them look like this: > > page_open(array("sess" => "Gili_Session")); > > That is, i only use sessions :). But there's a script that complains about > calling a function on a non-object variable when i call page_close(). the > error occurs in page.inc line 68. > > function page_close() { > global $sess, $user; > > if (isset($sess)) { > $sess->freeze(); > if (isset($user)) { > $user->freeze(); <-- LINE 68 > } > } > } > > isset($user) should yield non-true, as i don't use the user feature. > There aren't any variables called $user on my scripts, as this might look > like two variables are clashing on a same namespace or something. > > Can anyone give me any pointer? this problem (bug?) is really annoying. > > > Manuel Aristar?n > mpa...@so... > > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Joe S. <jo...@be...> - 2001-11-05 14:33:13
|
If I remember right this error started turning up with php4.0.5. Joe On Mon, Nov 05, 2001 at 10:38:16AM -0300, Manuel Aristaran wrote: > At 12:44 05/11/01 +0100, you wrote: > >Hi, > > > >are you running PHPLib with PHP3 or PHP4? Maybe this depends on > >PHP-Version. I'm runnig PHP 4.01 PL on my local machine, using > >local4.inc, session4.inc and page4.inc. Everything is fine, no error. > >But with PHP 4.06, running on my providers server, the error described > >below occurs. > > I'm running php 4.0.6 on my local machine, and the server where the site > will be located is very likely to use a 4.0.6 or better... > > i'm checking out the cvs version, the problem described was happening with > the version from the phplib7.2 distribution.... > > Manuel Aristaran > mpa...@so... > > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Manuel A. <mpa...@so...> - 2001-11-05 13:45:22
|
At 12:44 05/11/01 +0100, you wrote: >Hi, > >are you running PHPLib with PHP3 or PHP4? Maybe this depends on >PHP-Version. I'm runnig PHP 4.01 PL on my local machine, using >local4.inc, session4.inc and page4.inc. Everything is fine, no error. >But with PHP 4.06, running on my providers server, the error described >below occurs. I'm running php 4.0.6 on my local machine, and the server where the site will be located is very likely to use a 4.0.6 or better... i'm checking out the cvs version, the problem described was happening with the version from the phplib7.2 distribution.... Manuel Aristaran mpa...@so... |
From: Taylor, S. <Ste...@uk...> - 2001-11-05 08:57:55
|
Not sure what is causing this. Try calling var_dump($user) just before you call the page_close = function? Does this tell you anything? -Stewart. -----Original Message----- From: Manuel Aristaran [mailto:mpa...@so...] Sent: 05 November 2001 03:24 To: php...@li... Subject: [Phplib-users] Problem with "user" feature Hello... I've run into a quite interesting problem.... None of the scripts on the system use the "user" feature, every = page_open()=20 call on them look like this: page_open(array("sess" =3D> "Gili_Session")); That is, i only use sessions :). But there's a script that complains = about=20 calling a function on a non-object variable when i call page_close(). = the=20 error occurs in page.inc line 68. function page_close() { global $sess, $user; if (isset($sess)) { $sess->freeze(); if (isset($user)) { $user->freeze(); <-- LINE 68 } } } isset($user) should yield non-true, as i don't use the user feature. There aren't any variables called $user on my scripts, as this might = look=20 like two variables are clashing on a same namespace or something. Can anyone give me any pointer? this problem (bug?) is really annoying. Manuel Aristar=E1n mpa...@so... _______________________________________________ Phplib-users mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Joe S. <jo...@be...> - 2001-11-05 06:14:20
|
Change if (isset($user)) { to: if (is_object($user)) { Joe On Mon, Nov 05, 2001 at 12:24:03AM -0300, Manuel Aristaran wrote: > Hello... > > I've run into a quite interesting problem.... > > None of the scripts on the system use the "user" feature, every page_open() > call on them look like this: > > page_open(array("sess" => "Gili_Session")); > > That is, i only use sessions :). But there's a script that complains about > calling a function on a non-object variable when i call page_close(). the > error occurs in page.inc line 68. > > function page_close() { > global $sess, $user; > > if (isset($sess)) { > $sess->freeze(); > if (isset($user)) { > $user->freeze(); <-- LINE 68 > } > } > } > > isset($user) should yield non-true, as i don't use the user feature. > There aren't any variables called $user on my scripts, as this might look > like two variables are clashing on a same namespace or something. > > Can anyone give me any pointer? this problem (bug?) is really annoying. > > > Manuel Aristarán > mpa...@so... > > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Manuel A. <mpa...@so...> - 2001-11-05 03:30:51
|
Hello... I've run into a quite interesting problem.... None of the scripts on the system use the "user" feature, every page_open()= =20 call on them look like this: page_open(array("sess" =3D> "Gili_Session")); That is, i only use sessions :). But there's a script that complains about= =20 calling a function on a non-object variable when i call page_close(). the=20 error occurs in page.inc line 68. function page_close() { global $sess, $user; if (isset($sess)) { $sess->freeze(); if (isset($user)) { $user->freeze(); <-- LINE 68 } } } isset($user) should yield non-true, as i don't use the user feature. There aren't any variables called $user on my scripts, as this might look=20 like two variables are clashing on a same namespace or something. Can anyone give me any pointer? this problem (bug?) is really annoying. Manuel Aristar=E1n mpa...@so... |
From: order t. c. <ke...@go...> - 2001-11-02 02:19:36
|
hi! one more... how do i get the variables from another session's stored values? i would need these for making statistics, and couldn't figure out a simple way to do this.. perhaps somebody did that :) or, simpler, to count number of users authenticated and active... thanks, keo -- don't believe everything you think. |
From: order t. c. <ke...@go...> - 2001-11-02 02:14:08
|
hi! i have some public pages using default auth, and an admin page where authentication is needed. i have athe following line just after page_open: $auth->login_if($auth->auth["uid"]=="nobody"); so when i load the admin page, the login screen comes up, everything is fine. then when i go back to the public pages, i am still authenticated. this is also fine. but then, i go get some coffee, the auth info expires, and when i reload my public page, a login screen appears, but it should authenticate me as nobody... so... how can i fix this, so i dont have a login form come up when it shouldn't? hope i was clear. :) thanks, keo -- don't believe everything you think. |
From: Stephen W. <wo...@me...> - 2001-11-01 23:37:55
|
IP address is bad, because everyone coming through a NAT device or a proxy server will have that devices IP, but it may be better then nothing. You could use the IP with salt and make an MD5 hash, if weren't for the problem above. -Steve Brian Popp wrote: > > An MD5 of the ethernet card hardware address would work well, but I'm not > sure if it's obtainable through PHP? IP address would be an alternative, but > would be fairly easy for someone to obtain for a given user, especially if > you display it on the site somewhere (next to posts, for example). > > -----Original Message----- > From: order through chaos [mailto:ke...@go...] > Sent: Thursday, November 01, 2001 4:53 PM > To: php...@li... > Subject: [Phplib-users] cookie stealing > > hi! > > did anyone code something that checks other infos beside cookies to check > session validity? (like az ip, and an md5 of some client info for eg.) > > coz anyone stealing the cookie could be logged in, so it's no matter if you > send the password in md5 or not.. :P > > anyone? > > keo > > -- > don't believe everything you think. > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Kevin F. <fre...@ip...> - 2001-11-01 23:32:58
|
I have tried to add this type of functionality to the authentication = process but with little success. If the user used AOL, CompuServe, etc. = one of the ISP that use proxy pre or post fetch caches, after authenticatio= n, the caching servers would try to access the site and collect data using = the cookie. This step would return a cookie from the wrong IP address and = invalidate the session One workaround was to tell the user to start IE or Netscape after logging = into the ISP so the caching/proxy system would not start. There is a whole = list of sites in Google (mostly university sites) that walk the user = through connection to the ISP and then starting IE/Netscape to fix this = type of problem. The final solution that I came up with was using an external system for = authentication over an https connection and "secure cookies". This would = then create another session object inside the data store and pass it back = to the user as session_id. All user validation would take place over https = and regular traffic over http. Most systems do not proxy the secure data = and thus allowed us to make sure the cookie is not stolen or moved by = using the IP address to revalidate the authentication session. In = addition, using SSL session caching and http connections when security = could be trusted we avoided the performance hit of using only an https = connection for each page transaction. Kevin Fredrick Software Technician Walter E. Helmke Library Indiana University - Purdue University Fort Wayne 219-481-5445 http://www.lib.ipfw.edu/ >>> "order through chaos" <ke...@go...> 11/01/01 05:53PM >>> hi! did anyone code something that checks other infos beside cookies to check session validity? (like az ip, and an md5 of some client info for eg.) coz anyone stealing the cookie could be logged in, so it's no matter if = you send the password in md5 or not.. :P anyone? keo -- don't believe everything you think. _______________________________________________ Phplib-users mailing list Php...@li...=20 https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Brian P. <bp...@ct...> - 2001-11-01 23:09:02
|
An MD5 of the ethernet card hardware address would work well, but I'm not sure if it's obtainable through PHP? IP address would be an alternative, but would be fairly easy for someone to obtain for a given user, especially if you display it on the site somewhere (next to posts, for example). -----Original Message----- From: order through chaos [mailto:ke...@go...] Sent: Thursday, November 01, 2001 4:53 PM To: php...@li... Subject: [Phplib-users] cookie stealing hi! did anyone code something that checks other infos beside cookies to check session validity? (like az ip, and an md5 of some client info for eg.) coz anyone stealing the cookie could be logged in, so it's no matter if you send the password in md5 or not.. :P anyone? keo -- don't believe everything you think. _______________________________________________ Phplib-users mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: order t. c. <ke...@go...> - 2001-11-01 22:53:37
|
hi! did anyone code something that checks other infos beside cookies to check session validity? (like az ip, and an md5 of some client info for eg.) coz anyone stealing the cookie could be logged in, so it's no matter if you send the password in md5 or not.. :P anyone? keo -- don't believe everything you think. |
From: Brian P. <bp...@ct...> - 2001-11-01 21:12:52
|
I misspoke, you would override the $auth->auth_preauth () function of your auth class. -----Original Message----- From: Brian Popp [mailto:bp...@ct...] Sent: Thursday, November 01, 2001 2:53 PM To: 'Daniel Bondurant' Cc: Phplib (E-mail) Subject: RE: [Phplib-users] permanent cookied login Daniel, you set a cookie manually using set_cookie() to the user's user_id. Technically you should probably encode it somehow first. Then you just check for the cookie in the auth->preauth() function (if it doesn't already exist, override it in your auth class.) Your preauth() function would look something like: (this assumes you are not encoding the cookie) function preauth() { if ( $HTTP_COOKIE_VARS[user_id] ) return $HTTP_COOKIE_VARS[user_id]; else return false; } if preauth() returns a valid user_id, the auth class will use it to login the user (without prompting for a password). BPopp - bpopp.net -----Original Message----- From: Daniel Bondurant [mailto:bo...@io...] Sent: Thursday, November 01, 2001 2:39 PM To: Php...@li... Subject: [Phplib-users] permanent cookied login How do I use phplib to set a permanent cookie for login. so, once a user logs in, I want to set a cookie so they never have to log in from that machine again. setting $lifetime = 0 does session cookies, but they expire when the browser is closed. thanks _______________________________________________ Phplib-users mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phplib-users _______________________________________________ Phplib-users mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Brian P. <bp...@ct...> - 2001-11-01 20:53:04
|
Daniel, you set a cookie manually using set_cookie() to the user's user_id. Technically you should probably encode it somehow first. Then you just check for the cookie in the auth->preauth() function (if it doesn't already exist, override it in your auth class.) Your preauth() function would look something like: (this assumes you are not encoding the cookie) function preauth() { if ( $HTTP_COOKIE_VARS[user_id] ) return $HTTP_COOKIE_VARS[user_id]; else return false; } if preauth() returns a valid user_id, the auth class will use it to login the user (without prompting for a password). BPopp - bpopp.net -----Original Message----- From: Daniel Bondurant [mailto:bo...@io...] Sent: Thursday, November 01, 2001 2:39 PM To: Php...@li... Subject: [Phplib-users] permanent cookied login How do I use phplib to set a permanent cookie for login. so, once a user logs in, I want to set a cookie so they never have to log in from that machine again. setting $lifetime = 0 does session cookies, but they expire when the browser is closed. thanks _______________________________________________ Phplib-users mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phplib-users |
From: Daniel B. <bo...@io...> - 2001-11-01 20:39:03
|
How do I use phplib to set a permanent cookie for login. so, once a user logs in, I want to set a cookie so they never have to log in from that machine again. setting $lifetime =3D 0 does session cookies, but they expire when the browser is closed. thanks |
From: Lazaro F. <la...@ii...> - 2001-11-01 09:28:01
|
Hi I know this is off topic, But I need your help, I'm sending a neswletter = to my WEB site visitors using PHP and the popular html_mime_email class = of Richard Heye The problem is that as long as I tested it locally using 3 email = addresses everthing was fine, but when I did the real thing sending a = newsletter to 105 email names (my customers) in a unique msg. It fails = cutting part of my 'TO ' email clause off, and sending the tail of the = 'TO' list as part of the msg, which in turn contains nothing but garbage = as its content Instead of getting my newsletter msg, the customer are getting a msg = from APACHE with the problems I mentioned below There is any idea on how to fix this, it is possivel to send an e-mail = with a large string (more than 100 email names ) recipient "TO" part, = which is the maximum lenght of the "TO" part ? Thanks a lot Lazaro |
From: Mike G. <mi...@op...> - 2001-10-31 02:22:05
|
Hi Nathan, As usual, you are right on the money: http://www.airdiv-cupe.org/union.php/General/77 Works fine now! Mike nathan r. hruby wrote: > Go thee to the php-lib-stable CVS: extract the template.inc from thither > and rejoyce! > > -n > > On Tue, 30 Oct 2001, Mike Gifford wrote: > > >>Hello, >> >>We're presently having difficulty with how template.inc manages $75 and >>are hoping that perhaps someone else has discovered and fixed this problem. >> >>If you look here: >> http://www.airdiv-cupe.org/union.php/General/77 >> >>You should see this displayed as HTML (in the midst of a whole lot of >>other stuff): >> >> test $75 test $7 $ 11 >> >> <br>test $b dollar $ b >> >> <br>test $75 dollar $ 75 >> >> >>Instead you get: >> >> <p>test test $ 11 >> >> <br>test $b dollar $ b >> >> <br>test dollar $ 75 >> >> >>We think this is a problem with the template.inc file however I've used >>the version that was packaged with phplib-7.2d on sf, but that didn't >>resolve the problem. >> >>There was another copy of this file being circulated but I've lost track >>of it. Is it stable, is it being incorporated in the next release? >>Would it fix this problem? >> >>This is btw used within: >> http://sourceforge.net/projects/back-end/ >> >>Which barely uses phplib in the present version, but will hopefully be >>using much more of it in the future. >> >>Thanks. >> >>Mike >> >> > -- Mike Gifford, OpenConcept Consulting, http://www.openconcept.ca Offering everything your organization needs for an effective web site. New PHP/MySQL Photogallery & Great Pictures http://genevilleneuve.com In all things it is better to hope than to despair.Wolfgang von Goethe |
From: James W. <jwi...@ma...> - 2001-10-30 22:27:00
|
At 4:19 PM -0500 10/30/01, nathan r. hruby wrote: >Go thee to the php-lib-stable CVS: extract the template.inc from thither >and rejoyce! I'm still experiencing the trouble mentioned here with version 1.8 of template.inc from CVS. I have resorted to manually placing $ in my templates for the time being, but unfortunately Dreamweaver seems to like to rewrite it as $ if a designer resaves the file. Some preg_replace love would be much appreciated. Code in question (starting line 164): function set_var($varname, $value = "") { if (!is_array($varname)) { if (!empty($varname)) { if ($this->debug) print "scalar: set *$varname* to *$value*<br>\n"; $value = preg_replace(array('/\$([0-9])/', '/\\\\([0-9])/'), array('$\1', '\\1'), $value); $this->varkeys[$varname] = "/".$this->varname($varname)."/"; $this->varvals[$varname] = $value; } } else { reset($varname); while(list($k, $v) = each($varname)) { if (!empty($k)) { if ($this->debug) print "array: set *$k* to *$v*<br>\n"; $v = preg_replace(array('/\$([0-9])/', '/\\\\([0-9])/'), array('$\1', '\\1'), $v); $this->varkeys[$k] = "/".$this->varname($k)."/"; $this->varvals[$k] = $v; } } } } Looks like it should work to me... |
From: nathan r. h. <na...@ds...> - 2001-10-30 21:18:40
|
Go thee to the php-lib-stable CVS: extract the template.inc from thither and rejoyce! -n On Tue, 30 Oct 2001, Mike Gifford wrote: > Hello, > > We're presently having difficulty with how template.inc manages $75 and > are hoping that perhaps someone else has discovered and fixed this problem. > > If you look here: > http://www.airdiv-cupe.org/union.php/General/77 > > You should see this displayed as HTML (in the midst of a whole lot of > other stuff): > > test $75 test $7 $ 11 > > <br>test $b dollar $ b > > <br>test $75 dollar $ 75 > > > Instead you get: > > <p>test test $ 11 > > <br>test $b dollar $ b > > <br>test dollar $ 75 > > > We think this is a problem with the template.inc file however I've used > the version that was packaged with phplib-7.2d on sf, but that didn't > resolve the problem. > > There was another copy of this file being circulated but I've lost track > of it. Is it stable, is it being incorporated in the next release? > Would it fix this problem? > > This is btw used within: > http://sourceforge.net/projects/back-end/ > > Which barely uses phplib in the present version, but will hopefully be > using much more of it in the future. > > Thanks. > > Mike > -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement na...@ds... http://www.dstatement.com/ Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
From: nathan r. h. <na...@ds...> - 2001-10-30 21:12:20
|
On Tue, 30 Oct 2001, Donncha O Caoimh wrote: > I'll send the patches on. > I did a lot more work at the weekend on it. But here are some results: > Without the cache reading 5,000 records takes 0.5 seconds every time. > With the cache reading the same number of records takes 4.5 seconds to > build the cache on the first run, and then 1.5 seconds each run after > that for the life of the cache. Nice... > Doing an eval() is expensive and with the larger dataset just chews > time. Hurm.. i would think it wouldn't be... Must be some remnant of perl still lurking in the back of my head.. I will drink it into oblvion the next chance I get :) > I started work on another project (a weblog, coming along nicely!) and Umm.. there are enough php weblogs. Help an exsisting project :) -n -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement na...@ds... http://www.dstatement.com/ Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
From: Mike G. <mi...@op...> - 2001-10-30 19:54:29
|
Hello, We're presently having difficulty with how template.inc manages $75 and are hoping that perhaps someone else has discovered and fixed this problem. If you look here: http://www.airdiv-cupe.org/union.php/General/77 You should see this displayed as HTML (in the midst of a whole lot of other stuff): test $75 test $7 $ 11 <br>test $b dollar $ b <br>test $75 dollar $ 75 Instead you get: <p>test test $ 11 <br>test $b dollar $ b <br>test dollar $ 75 We think this is a problem with the template.inc file however I've used the version that was packaged with phplib-7.2d on sf, but that didn't resolve the problem. There was another copy of this file being circulated but I've lost track of it. Is it stable, is it being incorporated in the next release? Would it fix this problem? This is btw used within: http://sourceforge.net/projects/back-end/ Which barely uses phplib in the present version, but will hopefully be using much more of it in the future. Thanks. Mike -- Mike Gifford, OpenConcept Consulting, http://www.openconcept.ca Offering everything your organization needs for an effective web site. New PHP/MySQL Photogallery & Great Pictures http://genevilleneuve.com In all things it is better to hope than to despair.Wolfgang von Goethe |
From: Donncha O C. <don...@tr...> - 2001-10-30 10:50:59
|
I'll send the patches on. I did a lot more work at the weekend on it. But here are some results: Without the cache reading 5,000 records takes 0.5 seconds every time. With the cache reading the same number of records takes 4.5 seconds to build the cache on the first run, and then 1.5 seconds each run after that for the life of the cache. Doing an eval() is expensive and with the larger dataset just chews time. I started work on another project (a weblog, coming along nicely!) and used the caching layer but it didn't seem very reliable. Results were returned or not sometimes. It could pay off if it was used in the context of a fetchall() function and/or if a long running query was cached. Some options: I rewrite the caching module so it creates files I can include(). This might be faster than doing an eval() on the data. Cache each row in a seperate file. I can't imagine this would be faster but it would decrease memory usage. I might mail the author of the caching class I used to see if he has any ideas or recommendations. Donncha. "nathan r. hruby" wrote: > > On Fri, 26 Oct 2001, Donncha O Caoimh wrote: > > > I prefer to use the filesystem also. I've almost got it going now but at > > the moment it hangs for a while before reading from the cache. I suspect > > the cache class I'm using is waiting for the cache file to close or > > something. *shrug* I'll keep at it for another half an hour, going home > > then, it's late here! > > > > If anyone wants my work in progress code mail me off list soon and I'll > > mail you. Or I could post it to the list if nobody objects to an > > attachment? > > > > Send it to the SF patch manager. We won't stick it in but everyone will > have access to it without those nasty quota issues on everyone's inbox :) > > -n |
From: nathan r. h. <na...@ds...> - 2001-10-26 17:02:34
|
On Fri, 26 Oct 2001, Donncha O Caoimh wrote: > I prefer to use the filesystem also. I've almost got it going now but at > the moment it hangs for a while before reading from the cache. I suspect > the cache class I'm using is waiting for the cache file to close or > something. *shrug* I'll keep at it for another half an hour, going home > then, it's late here! > > If anyone wants my work in progress code mail me off list soon and I'll > mail you. Or I could post it to the list if nobody objects to an > attachment? > Send it to the SF patch manager. We won't stick it in but everyone will have access to it without those nasty quota issues on everyone's inbox :) -n -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement na...@ds... http://www.dstatement.com/ Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
From: Donncha O C. <don...@tr...> - 2001-10-26 17:01:15
|
I prefer to use the filesystem also. I've almost got it going now but at the moment it hangs for a while before reading from the cache. I suspect the cache class I'm using is waiting for the cache file to close or something. *shrug* I'll keep at it for another half an hour, going home then, it's late here! If anyone wants my work in progress code mail me off list soon and I'll mail you. Or I could post it to the list if nobody objects to an attachment? Donncha. "nathan r. hruby" wrote: > > On Fri, 26 Oct 2001, Brian Popp wrote: > > > A database would obviously be the most portable. How about modifying > > page_open and page_close to include a database object (and it's > > corresponding cache) which gets restored/frozen at the start and finish of > > each page. I'm not sure if the additional overhead would offset any > > performance gains from the cache though? I guess it depends on the > > application. > > > > Isn't that what the session stuff does now? :) In theory your Cache class > shouldn't have to be stateful which means it wouldn't need to load at > start, and would be wasteful if you were laoding that extra info on pages > that don't need it. > > Files actually would be most portable (and depeding on your FS Caching and > disk speeds possibly fast enough -- certianly less meory / processor > overhead), but a shmem container would be the speediest, db I can't really > see as being useful if you're trying to speed up db queries, again, unless > they're really big queries and at that point you can cache stuff at the > application level. I'm probably biased though becasue MySQL is so fast nd > I try to make all my quries as amall as possible -- I tend to prefer to do > several small queries instead of one big one > > -n |
From: nathan r. h. <na...@ds...> - 2001-10-26 16:53:12
|
On Fri, 26 Oct 2001, Brian Popp wrote: > A database would obviously be the most portable. How about modifying > page_open and page_close to include a database object (and it's > corresponding cache) which gets restored/frozen at the start and finish of > each page. I'm not sure if the additional overhead would offset any > performance gains from the cache though? I guess it depends on the > application. > Isn't that what the session stuff does now? :) In theory your Cache class shouldn't have to be stateful which means it wouldn't need to load at start, and would be wasteful if you were laoding that extra info on pages that don't need it. Files actually would be most portable (and depeding on your FS Caching and disk speeds possibly fast enough -- certianly less meory / processor overhead), but a shmem container would be the speediest, db I can't really see as being useful if you're trying to speed up db queries, again, unless they're really big queries and at that point you can cache stuff at the application level. I'm probably biased though becasue MySQL is so fast nd I try to make all my quries as amall as possible -- I tend to prefer to do several small queries instead of one big one -n > -----Original Message----- > From: Donncha O Caoimh [mailto:don...@tr...] > Sent: Friday, October 26, 2001 10:36 AM > To: nathan r. hruby > Cc: Brian Popp; Phplib (E-mail) > Subject: Re: [Phplib-users] Caching MySQL queries > > > "nathan r. hruby" wrote: > > > > On Fri, 26 Oct 2001, Donncha O Caoimh wrote: > > > > > That's the simple explanation. I serialize the array and base64_encode > > > it before caching it and seperate each record by a "\n". When I read it > > > back I split the cache by "\n" and eval() the correct row. Not the best > > > way of doing it but it's the most obvious way I thought of and the > > > quickest to see if it'd work :) > > > > > > > I picked up on this late, so please shoot me if I'm straying or this has > > been covered. > > > > base64 encoding increases the size of stored vaules by a lot which could > > be part of the problem when working with large result sets. Unless you > > need base64 I'd say just to just serialize the mysql result arrays, add > > whatever delim you nedd and addslash() them then jsut stripslash(), > > split() and eval() > > Did that and it's easier to debug the cache now.. mimencode just makes > sure that things are def. not 8 bit characters.. > > > > > Question is what kind of metadata does the cache have to make sure the > > data is fresh and to determine a hit (looking back, md5 sums of the > > original sql query statement.. i see that should work) and where does this > > cache live? If it's living in a db, well, then what's the point except to > > speed up very complex queries. Now if it's living in a shmem ssegment, > > well, that's just darn fast.. With something like Zend cache, you may be > > able to use a file and let *that* cache engine take care of it too, if you > > don't feel like coding your own shmem functions > > I haven't even looked at that yet. All I'm doing is setting an arbitrary > timeout on every query. The cache gets stored in /tmp at the moment. > Again, I'm trying to get it to work first before I do anything exotic > with it. And also allowing for dropping in other caching scripts too. > > Donncha. > > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement na...@ds... http://www.dstatement.com/ Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |