Re: [PHP] 'God' has spoken... :-)
Matthew Weier O'Phinney wrote: * Sebastian [EMAIL PROTECTED] : Matthew Weier O'Phinney wrote: * Sebastian [EMAIL PROTECTED] : why php6 and not php5? look how long it took to get to php4 (with php5 just starting to rolling out) and people are already talking about php6? My observation was that more people jumped to PHP4 from PHP3 than have so far from PHP4 to PHP5. And PHP5 has hardly just started to roll out; the official 5.0.0 release was over a year ago. sure it is just a 'versioning' thing, but right now huge numbers of php users aren't using php5 (including me) on production environments, let alone start talking about php 6. And why aren't you using PHP5? Is there any specific reason? Is it because your service provider doesn't offer it? If so, ask them why -- and report it here. As soon as PHP5 hit stable, I started using it, and I've never looked back. Performance is better, and there are many features -- exceptions, the new OOP model, autoload, iterators, etc. -- that simply have no analogs in PHP4. anyway, i think i will be with php4 for a long time to come. Please tell the list why -- what does PHP4 offer over PHP5 for you? I honestly want to know, and I'm sure there are others who would be interested to see why people are not making the switch i spent hundreds of hours building my site on php4, im not about to rewrite any of it to make it 'compatible' with php5. Don't rewrite it to make it compatible with PHP5 -- rewrite it to take advantage of PHP5's better performance and new features. Besides, you probably will not need to rewrite any code -- probably just do some cleanup and a few changes. More below. maybe my impressions of php5 are wrong, but last i heard apps built on php4 may or may not work right under php5 - meaning you would have to rewrite code. am i wrong? I've converted quite a bit of PHP4 code to PHP5, and I've had very few problems. Typically, I find that I get a few notices about deprecated functions or some warnings -- and the warnings are usually about things that should have generated warnings in PHP4, didn't, but now do in PHP5 (things like declaring a class property twice, for instance). The fixes for these are typically not rewrites, but, as I said, fixes -- if anything, they make the code better. Additionally, it's fairly easy to make such code backwards compatible with PHP4, if you feel the need to do so. so i am 'afraid' of going with php5 in fear it will break my website. The only way to find out if it will break is to try it. I'm willing to wager that your code, if written well, will not only *not* break, but likely perform better. The only thing I had to change to make my [3 lines of code, OOP] project PHP5 compatible was that I couldn't use the word exception, because it was reserved in PHP5. Right now I have better performance (around 50% better), and the system uses less memory [ probably caused by the fact that objects are passed by reference ] Maybe we can make a list of things you have to think about before migrating from PHP4 to 5. Right now the only ones I can think of are: * New reserved words * If you rely on PHP4's object passing behaviour, your code will break Anything else? Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Strange notation to create object
Robert Cummings wrote: On Thu, 2005-06-23 at 13:36, Matthew Weier O'Phinney wrote: * Robert Cummings [EMAIL PROTECTED] : On Thu, 2005-06-23 at 11:32, Matthew Weier O'Phinney wrote: The above notation is unnecessary when developing in PHP5, as objects in PHP5 are passed by reference by default. However, in PHP4, this was Not entirely, there's still a subtle difference in PHP5 between assigning an object with = versus assigning with = . Would you mind explaining the difference? I've seen nothing in the docs, to indicate that assigning objects with = in PHP5 is necessary, or even desired. My experience with PHP5 hasn't shown this either. I'd be interested to know to what you refer. See for yourself when running the following script: Cheers, Rob. I am stunned! Since I try to make my code working for both PHP4 and PHP5 I try to never rely on PHP4's standard cloning behaviour, and use where I can, so I have never really encountered this, but this will propably save my a lot of frustration when the rest of the world says goodbye to PHP4. (I remember when I first encountered the 'references in constructor'-issue) excellent stuff! grt, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fastest templating mechanism
Joe Wollard wrote: Evert, Have you looked at smarty (http://smarty.php.net) ? It doesn't do exactly what you're talking about but it seems to be the Fastest templating mechanism that I've tested; probably one of the most versatile as well. Cheers! -Joe www.joewollard.com Evert | Rooftop Solutions wrote: Hi all, I'm working on a template system which works a bit like a text translation block. The data looks for example like: beginblock div class=block endblock /div beginauthor span class=author endauthor /div The list is going to be very large, it will have several overlays and not all pages need all items in the list. (usually just a fraction) What will be the smartest way to implement this? I need a low-memory cost and fast solution I can do it with a php script, like: $list = array( 'beginblock' = 'div class=block', etc. ); but this will use up too much memory. I could additionally do it with a textfile, but if I need to loop through it at every lookup it will be slow.. What are your suggestions? regards, Evert Hi everyone, Thanks for your replies. I Think I haven't been very clear about what I really need. First of all, I don't need an existing templating system, because I am working on my own templating system. And regarding Satyam's post. This looks a lot like what I'm developing right now, but also not my issue =) What I really need is a fast lookup mechanism, to 'translate' statements. For example: setOutputType('xhtml'); echo(translate('authorstart')); the function translate opens xhtml.data, which contains: authorstart : span class=author authorend : /span so, the translate function looks 'authorstart' up and returns 'span class=author' or if you had specified 'wml' as the outputtype, the file could like like: authorstart : b authorend : /b and the function would return 'b' This is all no problem, except that these lists can be pretty big. And I wouldn't like to load them all into the memory, or have to loop through the file every time translate is called. So I need a very fast mechanism to overcome this problem. Any ideas? grt, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fastest templating mechanism
[EMAIL PROTECTED] wrote: On 8 May 2005 Evert | Rooftop Solutions wrote: What I really need is a fast lookup mechanism, to 'translate' statements. For example: setOutputType('xhtml'); echo(translate('authorstart')); the function translate opens xhtml.data, which contains: authorstart : span class=author authorend : /span so, the translate function looks 'authorstart' up and returns 'span class=author' or if you had specified 'wml' as the outputtype, the file could like like: authorstart : b authorend : /b and the function would return 'b' This is all no problem, except that these lists can be pretty big. And I wouldn't like to load them all into the memory, or have to loop through the file every time translate is called. So I need a very fast mechanism to overcome this problem. I think it's called a database. The fields are outputtype, key, and text to output, with an index on outputtype + key, then you do something like this: select OutputText from TranslateTable where OutputType = 'wml' and key = 'authorstart'; I wonder how many of these you really have. If on each script invocation you will be looking up many of them (dozens or hundreds) it might be more efficient to load all the ones for the outputtype you are using into a PHP array at the start, whether that's in a hard-coded array or loaded from the database. If you're only looking up a couple then a separate database lookup for each one is probably more efficient. Yes I thought of this, but in my case a flat file would be better. The same problem applies though: [quote] This is all no problem, except that these lists can be pretty big. And I wouldn't like to load them all into the memory, or have to loop through the file every time translate is called. [/quote] I don't know how much lookups there will be (can either be many or some) and I need the fastest solution there is, because the function _can_ be called loads of times. I think it will be hundreds per page, and thousands in total. I'm already thinking of cache mechanisms, because it has to work efficiently on very high loads. Incidentally I would say this is not a templating problem. It's simply a translation or lookup problem. True =) grt, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fastest templating mechanism
Hi all, I'm working on a template system which works a bit like a text translation block. The data looks for example like: beginblock div class=block endblock /div beginauthor span class=author endauthor /div The list is going to be very large, it will have several overlays and not all pages need all items in the list. (usually just a fraction) What will be the smartest way to implement this? I need a low-memory cost and fast solution I can do it with a php script, like: $list = array( 'beginblock' = 'div class=block', etc. ); but this will use up too much memory. I could additionally do it with a textfile, but if I need to loop through it at every lookup it will be slow.. What are your suggestions? regards, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] automatic PHP Template engine
Hi, I'm working on a template engine, and I want my template engine to be automaticly started when a .stl file is called from the browser. I know this can be done with mod_rewrite, but I really need a platform-independant solution. Has anybody some ideas on how to make it work everywhere (preferable also on hosts where you don't have access to configuration/shared hosting). regards, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] automatic PHP Template engine
Richard Lynch wrote: On Sun, May 1, 2005 12:54 pm, Evert | Rooftop Solutions said: I'm working on a template engine, and I want my template engine to be automaticly started when a .stl file is called from the browser. I know this can be done with mod_rewrite, but I really need a platform-independant solution. Has anybody some ideas on how to make it work everywhere (preferable also on hosts where you don't have access to configuration/shared hosting). At one end of the scale, you could write a Module for Apache, *just* like PHP is. At the other end, you could give documentation to users about using httpd.conf and/or .htaccess and Apache's ForceType directive to fire up PHP. Somewhere in the middle, I guess you could create an extension of PHP, just like php_mysql.[so|dll] and that *might* maybe give you the ability to hack enough things, including the installer/configure scripts that would do what you want... Probably not though, now that I think about it. I think the most realistic approach, honestly, is to just educate users/hosts how to easily send all your .stl scripts through PHP. If your .stl becomes even moderately popular, they'll do that, certainly *long* before they'll install your STL module to Apache. [snip] I've should have mentioned: The template format is primairily going to be used by inside developers and partners. They want to be able to use it for every client they encounter, but are sometimes restricted by the clients (shared-)host. Thank you for your big explaination, I think I know enough to dive into the subject. regards, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Ryan A wrote: So just because you use smarty you think you are smart and have the right to be smart..who the hell do you think you are?? Sorry, just giving an example of how a jackass with extreme opinions would write on this holy war's volatile topic. no offense meant :-) Cheers, Ryan I would go for a xml-style template engine (start flaming right below this thread) grt, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Andre Dubuc wrote: On Thursday 28 April 2005 02:05 pm, John Nichel wrote: Jason Barnett wrote: snip Humor is on my TODO list. Making a TODO list is on my TODO list. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] Just out of curiosity, are there any templating engines out there that would automatically generate and then fill in values for a TODO list? IATOL, Andre Not yet, but it is non my TODO list grt, Ever -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Ryan A wrote: I would go for a xml-style template engine (start flaming right below this thread) Hey Rob, I sorry for the mix up but the above (however obvious) was *not* meant to be a flame, I was *only* joking with the guy. Is it just me or is joking becoming outlawed on the list? Most of us are geeks or classified as geeks on the lista little geek humour please? programming is a serious business and i find myself getting quite stressed sometimesusing a little humour or reading others humourous replies helps IMHO. Cheers, -Ryan Yes, and that's how I read this reply =) About the subject, I'm working on a xml-based templating system, which caches all the steps it does, so it overcomes the slowness =) And ofcource because I like xml and all the neith things you can do with it. grt, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Hi Ryan, The XML basics are really simple and can be learned in 15 minutes, so I suppose you already know this. I personally think www.xml.com has some good resources, and they don't just keep it with theory and translate the stuff to practical situations. Also google for stuff like namespaces (along with DTD's) and XSL/XSLT. I guess I learned most of it by keeping track of W3C mailinglist and after that just googling to people who had some subjects about it. I personally fully support the Semantic web idea, the rise of RSS proofs that (it's sad there are so many standards instead of just the W3c RDF/RSS standard). In ways of communicating between webservices it's the future (either that or microsofts vision, I fear the longhorn). grt, Evert Ryan A wrote: /* I'm working on a xml-based templating system, which caches all the steps it does, so it overcomes the slowness =) And ofcource because I like xml and all the neith things you can do with it. */ Sounds like you are pretty good with xml... i know very little of XML, do you have a link I can read up on to learn the language? My knowledge of the subject is pretty shameful :-( Thanks, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Jason Barnett wrote: Evert | Rooftop Solutions wrote: Yes, and that's how I read this reply =) About the subject, I'm working on a xml-based templating system, which caches all the steps it does, so it overcomes the slowness =) And ofcource because I like xml and all the neith things you can do with it. grt, Evert OK so besides the geek factor involved, what makes an xml-based template system that much better? The main benefit that I've ever heard was it can make it easier for producing output for heterogenous displays... http://www.w3.org/MarkUp/Forms/ The most obvious answer example that comes to my mind is Mozilla / IBM, but then again XForms is also on my Little Dog Too list. The geek factor is very important for my projects first of all =) The second also applies (output for multiple purposes). You really hit the nail here, because I am also using it with XUL, XForms and some other markups. grt, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Templating engines
Jason Barnett wrote: Evert | Rooftop Solutions wrote: Yes, and that's how I read this reply =) About the subject, I'm working on a xml-based templating system, which caches all the steps it does, so it overcomes the slowness =) And ofcource because I like xml and all the neith things you can do with it. grt, Evert OK so besides the geek factor involved, what makes an xml-based template system that much better? The main benefit that I've ever heard was it can make it easier for producing output for heterogenous displays... http://www.w3.org/MarkUp/Forms/ The most obvious answer example that comes to my mind is Mozilla / IBM, but then again XForms is also on my Little Dog Too list. The geek factor is very important for my projects first of all =) The second also applies (output for multiple purposes). You really hit the nail here, because I am also using it with XUL, XForms and some other markups. grt, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Classes, Constructors, References and Recursion
Hi, I have this piece of code: class test1 { var $data = 'hi', $node = false; function test1() { $this-node = new test2($this); } } class test2 { var $data = 'yoyo', $root = false; function test2($root) { $this-root = $root; } } $test = new test1(); echo('pre'); print_r($test); echo('/pre'); And it outputs: test1 Object ( [data] = hi [node] = test2 Object ( [data] = yoyo [root] = test1 Object ( [data] = hi [node] = *RECURSION* ) ) ) while it should output: test1 Object ( [data] = hi [node] = test2 Object ( [data] = yoyo [root] = *RECURSION* ) ) I know there are some difficulties using references in constructors, but I think this should be right.. I'm using PHP/4.3.11. Can anyone tell me what is wrong with this code or why PHP behaves this way? regards, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Classes, Constructors, References and Recursion
Jochem Maas wrote: also I believe print_r() and var_dump() have a few odditities regarding display of recursion with regard to objects... internals mailinglist archive might tell you more on that. I think I have the answer, when I pass a var to print_r it isn't passed by reference, so there will be a copy made immediately. go for php5 if you can, you'll have alot more fun with object then :-) no more ''s for starters. God I wish I could! The thing is, most hosting company's don't support it yet, and since I'm making a product that should run (and is already running) at various places, I have to use PHP4 :( thanx man, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] secure document : solution wanted
If anyone is interested, I found this document which appears to provide more details... http://support.microsoft.com/kb/834489 Is it just me, or is this a case of MS breaking a protocol because their no its not you :-). stupid interface was hiding information it shouldn't have hidden in the first place? Oh well. Actually, the reason they did is because of fishing. A malicious guy could construct an url like http://www.mybank.com/[EMAIL PROTECTED]/ Firefox prompts before it opens an url like this, a much better way to handle it =) grt, Evert -- Rooftop Solutions - Web Applications on Demand tel. (+31)628962319 fax. (+31)842242474 [EMAIL PROTECTED] http://www.rooftopsolutions.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Possible problem with EXPAT functions
Hi People, I'm working on some complex PHP4 OOP Scripts and at a really unusual point I'm getting the following error in my apache errorlog: *** glibc detected *** double free or corruption (!prev): 0x0828c510 *** [Tue Mar 29 07:09:27 2005] [notice] child pid 9110 exit signal Aborted (6) This doesn't seem as a error I should be able to cause. I'm using: PHP 4.3.10 Apache 1.3.33 Slackware 10 packages The latest Zend Optimizer This has only happened so far after an EXPAT xml parse. The reproduce code is below. If someone can confirm this error I can report it as a bug.. I just wanted to make sure it is one :) regards, Evert ? class sParser { function onStartElement($parser,$name,$attribs) { return false; } function onEndElement($parser,$name) { return false; } function onCDATA($parser,$data) { return false; } function onProcessInstruction($parser,$target,$data) { return false; } function onXMLError($line,$errorcode,$errorstring) { return false; } function xmlparse($data) { $this-parser = xml_parser_create('UTF-8'); xml_parser_set_option($this-parser,XML_OPTION_CASE_FOLDING,false); xml_set_element_handler($this-parser,array($this, 'onStartElement'),array($this,'onEndElement')); xml_set_character_data_handler($this-parser,array($this,'onCDATA')); xml_set_processing_instruction_handler($this-parser,array($this,'onProcessInstruction')); if (!xml_parse($this-parser,$data)) { $this-onXMLError(xml_get_current_line_number($this-parser), xml_get_error_code($this-parser), xml_error_string(xml_get_error_code($ this-parser))); return false; } else return $this-parsedData; } function execute($data) { return $this-xmlparse($data); } } $disp = new sParser(); $disp-execute(file_get_contents('test')); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] world write access
Hi people, I'm trying to think of a way to make an auto-updater for my distributed scripts. If I wanted to do this, I'd have to give write access to the php scripts to the apache user or world. Everywhere I read that you shouldn't to that, but I'm thinking that if you script your stuff right, there shouldn't be any problem. The numerous places I read that I shouldn't do that gives me certain doubts though. any comments on this? regards, Evert -- Rooftop Solutions - Web Applications on Demand tel. (+31)628962319 fax. (+31)842242474 http://www.rooftopsolutions.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] world write access
Thanx Johannes, how about making the webserver the owner of the files? Would that be a good idea? The problem is that I have a framework deployed at several clients. Because this are some big clients and demand high security they won't give me a login to their ftp or consoles. Understandable, but everytime there's an update I need to mail the files and they have to install it. Imagine how much time that costs when there's a problem after the update and they need files again. Very annoying. I consider myself a good php scripter and I will be able to make my scripts secure, so I need a good reason not to build in the auto-updater. I can tell the server is a dedicated server for my project, only has a webserver running (apache). Argue with me :) grt, Evert Johannes Findeisen wrote: Hello, It is generally not a good idea to make scripts to everybody writeable. I think that if you're implementing auto-update features in PHP scripts they only could be insecure. Okay, you have one more feature but what if this feature goes out of control? Be really carefull when writing such applications. Maybe there are nice and secure solutions which maybe work but you really should set a focus on security. More info: http://www.php.net/manual/en/function.chmod.php Regards hanez -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] auto appending .php extension
Hi Folks, I'm using PHP 4.3.10, the Zend Optimizer and Apache 1.3.33. Somehow, if I want to open for example /dikkerapper.php, it is also possible to access it through /dikkerapper (without the .php extension) I haven't seen this before, but when I checked it also occurs on my other servers. The thing is, it causes some big problems with mod_rewrite. For example: the contents of the dir: /dikkerapper.php /dispatcher.php And the mod_rewrite directives are set like this: /hello - /dispatcher.php?a=hello /how/are/you - /dispatcher.php?a=how/are/you but when /dikkerapper is requested, it first (apperently) finds dikkerapper.php is found in the directory, and the url is rewritten to: /dispatcher.php?a=dikkerapper.php This might be an apache issue, but can also be related to php.ini I guess. Any ideas? I don't get any replies on the apache configuration newsgroups. I'm using slackware packages for php and apache. regards, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] class and global
pooly wrote: I'm trying to use a global object (declared at a upper level), but all I got is : Call to a member function on a non-object in /home/pooly/public_html/templeet/modules/freedb.php on line 16 part of the code is : $freedb = new freedbaxs(); Function return_freedb_search($array) { global $freedb; [snip] $freedb-freedb_search($txt); I don't see an error in this code, perhaps you should give us a bit more information. grt, Evert -- Rooftop Solutions - Web Applications on Demand tel. (+31)628962319 fax. (+31)842242474 [EMAIL PROTECTED] http://www.rooftopsolutions.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5.0.4RC1 and PHP 4.3.11RC1 rolled
Zeev Suraski wrote: Everyone, We've rolled initial release candidates for PHP 5.0.4 and 4.3.11. As usual, these 3rd digit releases include a variety of bug fixes and minor updates. PHP 5.0.4RC1 source: http://downloads.php.net/zeev/php-5.0.4RC1.tar.bz2 http://downloads.php.net/zeev/php-5.0.4RC1.tar.gz PHP 4.3.11RC1 source: http://downloads.php.net/ilia/php-4.3.11RC1.tar.bz2 http://downloads.php.net/ilia/php-4.3.11RC1.tar.gz Windows binaries will be posted and announced soon. Changes in PHP 5.0.4RC1: http://cvs.php.net/co.php/php-src/NEWS?r=1.1760.2.286 Changes in PHP 4.3.11RC1: http://cvs.php.net/co.php/php-src/NEWS?r=1.1247.2.854 Any help in testing these release candidates would be appreciated! Zeev Is there a roadmap available for PHP? I have to wait for the final release to put it live, And I've been waiting for .11 for a while. It would be nice if there's a way to check when the next version is expected to be released. Thanx for your great work, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Imap and attachments
Jim Plush wrote: here is a script I use to get jpg attachments with IMAP.. good luck ?php [snip] Thanx Jim, Unfortunaly some e-mail clients send the headers in ways the imap-functions can't read. So I figured something out using regular expressions. If anyone needs this, mail me (in total it's a big script, so I won't post it here) grt, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Imap and attachments
Hi, I started using the IMAP functions and ran into a problem with some headers for attachments. The first one is: Content-type: image/psd; x-unix-mode=0644; name=FinalVersion6.psd Content-transfer-encoding: base64 Content-disposition: inline; filename=FinalVersion6.psd Generated by Mac Mail. The filename wont show up in the result of for example imap_fetchstructure. The second is: Content-Type: text/plain Content-Disposition: attachment; filename=Video(019).3gp Content-Transfer-Encoding: base64 I suspect this one has something to do with the linebreak. It's generated by a modern nokia (7650 I think) I additionaly found a problem calling imap_fetchbody with a non-existent msg number. This will result in a segfault. grt, Evert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cache engine
Hi people, I have written an extensive web application frameworks, and I keep seeing my execution time and memory-usage growing. Right now it is not a problem, but before it get's out of hands I will need to create a good cache engine. My cache engine requires that I can cache method results, based on multiple parameters. What would be a good way to implement this? I know this propably a well-formed question, but before I start, I want to be sure I'll do it the right way. Has anyone got any experience with this, or can anyone give me some pointers on where to start looking? thanks in forward, Evert -- Rooftop Solutions - Web Applications on Demand tel. (+31)628962319 fax. (+31)842242474 http://www.rooftopsolutions.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cache engine
Chris Smith wrote: I have seen some people using stornig cached items in shared memory. This is explained in some detail here: http://www.danga.com/memcached/ I heard that shared memory is actually slower than writing and reading a file and it is not available on windows systems. There are PHP client APIs available. Alternatively PEAR offers some interesting caching solutions although i have not investigated them thoroughly ( http://pear.php.net/ ) Caching brings all sorts of wierdness out in applications due to multiple states of data being present in different layers in a system, so be careful. Thanks I will check it out. Hope this helps, Chris Smith Ninja Labs http://www.ninjalabs.co.uk/ greetings, Evert -- Rooftop Solutions - Web Applications on Demand tel. (+31)628962319 fax. (+31)842242474 [EMAIL PROTECTED] http://www.rooftopsolutions.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cache engine
Mark Charette wrote: Evert - Rooftop Solutions wrote: I heard that shared memory is actually slower than writing and reading a file and it is not available on windows systems. Hmmm ... that's an interesting thing you heard concerning shared memory. Care to share _who_ told you that? I'd like to make sure I don't hire him/her in the future. http://www.onlamp.com/pub/a/php/2001/10/11/pearcache.html Check it out, is in old article, but it says |shm| -- The |shm| container stores the cached data in the shared memory. Benchmarks indicate that the current implementation of this container is much slower than the |file| container. It is a bit outdated, but I haven't seen any recent benchmarks. grt, Evert -- Rooftop Solutions - Web Applications on Demand tel. (+31)628962319 fax. (+31)842242474 [EMAIL PROTECTED] http://www.rooftopsolutions.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php