Re: [PHP] free allocated memory: HOW ?
Couple of questions come to mind... 1. How big is this template that you're loading? Not sure why almost any HTML file would take up 300+ meg of memory when loaded into a variable. Are you loading images and other content in as well or just the HTML file? 2. Replacing the placeholders with actual data increases memory that much? Damn.. maybe I'm just ignorant of how PHP maintains things in memory, but that seems kind of nuts too 3. Do you have to store each newsletter in memory at each loop or can you send them out then move to the next one without storing them in an array or whatever you're doing? 4. Please tell us these 'newsletters' don't contain information on "male enhancement products" or "govt seized puppies"..hah -TG = = = Original message = = = I am using PHP version 5.1.2. on my dev machine. The same problem with PHP 5.2.1 on webserver. I am generating mails based on a HTML Template. After reading the template with fread() memory_get_usage() says ~386 MB in use... Then the placeholders in the read template are replaced by customized values within a loop. The size of the used memory grows permanently in each loop by approx 30 MB (100 newsletters are generated per loop). any ideas what i am doing wrong and where i [ab]use php? ^^ Jochem Maas schrieb: > Arthur Erd~s wrote: >> Hello all, >> >> is there a way to free memory allocated by variables in PHP?? This is a >> very important issue concerning long running scripts... > > this is a recurrent problem - not much can be done about it AFAIK ... I'd > be very glad to be proved wrong. > >> I have a script that generates > 5000 Newsletters and when the script >> finishes it uses 1.8 GB (!!) of RAM. Although I am using unset() to >> clean up variables (tried with $var = null too). > > okay this does suggest your doing something else very wrong - I personally > have code that regularly generates upto 20,000 individualised newsletters > without > going anywhere near this ammount of memory - granted I've hit my memory limit > a couple of times and had to jack it up to 128Megs (in practice the script > grab just over > 64Megs when it's doing it's worst). > > what version of php are you [ab]using? > >> I've read sth about php not giving the allocated memory back to the OS >> until a script finishes, is that right?? Is it possible to free the >> memory "by hand"? >> >> Any suggestion is appreciated! >> >> thx in advance >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] WWE in Stamford, CT needs a kick ass PHP Developer!
Thanks for the insight Tedd. It's good to get real feedback (unlike some of these guys busting my stones here - lol). I can take the blame on putting that Dreamweaver component in there, not our Development team. Gotta remember a lot of times you are dealing with a job spec developed from HR and we don't get the nuances of the space like you folks do. Basically the Dreamweaver is listed there because there is a lot of interdepartmental work that goes on and the less apt employees who are more "Creative" in nature work well in the Dreamweaver application (think Magazine Editors and Photo Departments and such, all of the folks who are more content than anything else). So I need someone who can play both sides, our developers are all excellent and I'd put them up with anyone in terms of ability. So thanks everyone for taking the time to see what World Wrestling Entertainment is all about. I'd really appreciate you keeping us in mind if you hear of anyone who is looking. Thx - Pat -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Bullcrap! If you think that nested tables gets you in the "ballpark" quicker, then you haven't a clue as to what css is used for. My advice, replace your Dreamweaver experience requirement with someone who really knows css and you'll be a lot better off in both reducing time to develop and subsequent compliance issues. IMO, anyone who states that they produce "dynamic and cutting edge web sites" using a WYSIWYG editor is highly suspect and any employer who asks for that experience is doing his business and his clients a disservice. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] scandir and ftp wrapper
Still can't get it to work, seems to be a problem generally with the ftp wrapper. If I try something really basic like echo file_get_contents('ftp://user:[EMAIL PROTECTED]/file.txt'); I get an empty string with no error messages. If I copy and paste the ftp url string into firefox it displays the file, so the url is correct If I try this echo file_get_contents('http://www.google.com'); I get the html displayed. I have been testing this code using the php cli if that makes any difference. Really could use some suggestions on this one Thanks J. On 4/2/07, j <[EMAIL PROTECTED]> wrote: Hi I have a question about scandir I have been trying to track down problems after upgrading from 5.1.6 to 5.2.1. I have been getting errors with a section of code that does something similar to the following $fileList=scandir("ftp://user:[EMAIL PROTECTED]/"); I get the following error. Warning: scandir(ftp://[EMAIL PROTECTED]/): failed to open dir: not implemented in /path/to/file.php on line 9 I checked phpinfo and ftp is included in the registered streams list. allow_url_fopen is set to on. Any suggestions why this code is not working? Thanks j. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] free allocated memory: HOW ?
Zoltán Németh wrote: > 2007. 04. 12, csütörtök keltezéssel 15.52-kor Jochem Maas ezt írta: >> Arthur Erdös wrote: >>> I am using PHP version 5.1.2. on my dev machine. The same problem with >>> PHP 5.2.1 on webserver. >>> >>> I am generating mails based on a HTML Template. After reading the >>> template with fread() memory_get_usage() says ~386 MB in use... >> WTF - 386 megs for an html file??? somehow I doubt this is >> the correct number ... are you reading the memory consumption >> correctly? >> >> exactly how much ram does the server in question have that you can >> allow a single script to schlock up almost 2gigs ?? >> >>> Then the placeholders in the read template are replaced by customized >>> values within a loop. The size of the used memory grows permanently in >>> each loop by approx 30 MB (100 newsletters are generated per loop). >> if the values are customized I can't fathom why you would generate >> 100 emails per loop. >> >>> any ideas what i am doing wrong and where i [ab]use php? ^^ >> no not really - but it's rather ironic that you sent the same email/reply 3 >> times. >> >> with showing code there is nothing anybody can do to help. > > I think you meant "without showing code" in the above line ;) I don't think I didn't ;-) sorry for the typooh. > > greets > Zoltán Németh > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] free allocated memory: HOW ?
2007. 04. 12, csütörtök keltezéssel 15.52-kor Jochem Maas ezt írta: > Arthur Erdös wrote: > > I am using PHP version 5.1.2. on my dev machine. The same problem with > > PHP 5.2.1 on webserver. > > > > I am generating mails based on a HTML Template. After reading the > > template with fread() memory_get_usage() says ~386 MB in use... > > WTF - 386 megs for an html file??? somehow I doubt this is > the correct number ... are you reading the memory consumption > correctly? > > exactly how much ram does the server in question have that you can > allow a single script to schlock up almost 2gigs ?? > > > > > Then the placeholders in the read template are replaced by customized > > values within a loop. The size of the used memory grows permanently in > > each loop by approx 30 MB (100 newsletters are generated per loop). > > if the values are customized I can't fathom why you would generate > 100 emails per loop. > > > > > any ideas what i am doing wrong and where i [ab]use php? ^^ > > no not really - but it's rather ironic that you sent the same email/reply 3 > times. > > with showing code there is nothing anybody can do to help. I think you meant "without showing code" in the above line ;) greets Zoltán Németh > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] free allocated memory: HOW ?
Arthur Erdös wrote: > I am using PHP version 5.1.2. on my dev machine. The same problem with > PHP 5.2.1 on webserver. > > I am generating mails based on a HTML Template. After reading the > template with fread() memory_get_usage() says ~386 MB in use... WTF - 386 megs for an html file??? somehow I doubt this is the correct number ... are you reading the memory consumption correctly? exactly how much ram does the server in question have that you can allow a single script to schlock up almost 2gigs ?? > > Then the placeholders in the read template are replaced by customized > values within a loop. The size of the used memory grows permanently in > each loop by approx 30 MB (100 newsletters are generated per loop). if the values are customized I can't fathom why you would generate 100 emails per loop. > > any ideas what i am doing wrong and where i [ab]use php? ^^ no not really - but it's rather ironic that you sent the same email/reply 3 times. with showing code there is nothing anybody can do to help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WWE in Stamford, CT needs a kick ass PHP Developer!
At 9:14 PM -0400 4/11/07, Jarrel Cobb wrote: You have to save the HTML file to see the changes with a browser refresh. You can use the design view to make sure you are atleast in the ballpark before saving and using the IE/Firefox preview. I know most people go with CSS layout now a days, but this was insanely useful for complicated table layouts involving many nested tables/col and row spans, etc. Also good for detailing sliced photoshop templates...again not so useful for "good" design but nice for a quick and dirty fix. There are some rendering bugs in the design view but it does get you in the ballpark atleast. (no offense meant) Bullcrap! If you think that nested tables gets you in the "ballpark" quicker, then you haven't a clue as to what css is used for. My advice, replace your Dreamweaver experience requirement with someone who really knows css and you'll be a lot better off in both reducing time to develop and subsequent compliance issues. IMO, anyone who states that they produce "dynamic and cutting edge web sites" using a WYSIWYG editor is highly suspect and any employer who asks for that experience is doing his business and his clients a disservice. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] location of the PHP executable
Em Quarta 11 Abril 2007 19:38, Buesching, Logan J escreveu: > IF db not exists THEN > locate -u > END-IF > > I'd hate to see the time it'd take to create a first-time database... > this could take awhile to run. > _maybe_ locate -u is faster than ls / -Rv... Need to test before said anything... =P # df -h Sist. Arq.Tam Usad Disp Uso% Montado em /dev/hda3 18G 16G 473M 98% / udev 506M 752K 506M 1% /dev cachedir 18G 16G 473M 98% /lib/splash/cache shm 506M 0 506M 0% /dev/shm /dev/sda1 112G 112G 249M 100% /mnt/win2 /dev/sdb1 150G 132G 18G 89% /mnt/win3 /dev/hdb1 75G 37G 39G 49% /mnt/win1 maybe I test both here... XD # time locate -u && time locate combate.php real23m19.453s user0m6.600s sys 0m20.200s /mnt/win1/Documents and Settings/Davi/Desktop/stellar/codigo/php/combate.php /mnt/win1/Documents and Settings/Davi/Meus documentos/stellar/codigo/php/combate.php /mnt/win3/backup 021106/Desktop/jogos/combate.php /mnt/win3/backup 021106/Desktop/stellar/combate.php /mnt/win3/backup 021106/Desktop/stellar/stellar/combate.php /mnt/win3/backup 021106/Desktop/stellar/stellar/site/combate.php /home/davi/stellar/codigo/php/combate.php real0m1.680s user0m0.520s sys 0m0.060s I'm trying to find anything using ls... ls / -Rv | grep -iE "combate.php$" But I can't retrieve the entire path yet... u.u' But time seen to be the same... Sorry poor english... []s -- Davi Vidal [EMAIL PROTECTED] [EMAIL PROTECTED] -- Agora com fortune: "Never trust an operating system you don't have sources for." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] free allocated memory: HOW ?
I am using PHP version 5.1.2. on my dev machine. The same problem with PHP 5.2.1 on webserver. I am generating mails based on a HTML Template. After reading the template with fread() memory_get_usage() says ~386 MB in use... Then the placeholders in the read template are replaced by customized values within a loop. The size of the used memory grows permanently in each loop by approx 30 MB (100 newsletters are generated per loop). any ideas what i am doing wrong and where i [ab]use php? ^^ > Arthur Erdös wrote: > > Hello all, > > > > is there a way to free memory allocated by variables in PHP?? This is a > > very important issue concerning long running scripts... > > this is a recurrent problem - not much can be done about it AFAIK ... I'd > be very glad to be proved wrong. > > > > > I have a script that generates > 5000 Newsletters and when the script > > finishes it uses 1.8 GB (!!) of RAM. Although I am using unset() to > > clean up variables (tried with $var = null too). > > okay this does suggest your doing something else very wrong - I personally > have code that regularly generates upto 20,000 individualised newsletters > without > going anywhere near this ammount of memory - granted I've hit my memory limit > a couple of times and had to jack it up to 128Megs (in practice the script > grab just over > 64Megs when it's doing it's worst). > > what version of php are you [ab]using? > > > > > I've read sth about php not giving the allocated memory back to the OS > > until a script finishes, is that right?? Is it possible to free the > > memory "by hand"? > > > > Any suggestion is appreciated! > > > > thx in advance > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] free allocated memory: HOW ?
I am using PHP version 5.1.2. on my dev machine. The same problem with PHP 5.2.1 on webserver. I am generating mails based on a HTML Template. After reading the template with fread() memory_get_usage() says ~386 MB in use... Then the placeholders in the read template are replaced by customized values within a loop. The size of the used memory grows permanently in each loop by approx 30 MB (100 newsletters are generated per loop). any ideas what i am doing wrong and where i [ab]use php? ^^ Jochem Maas schrieb: Arthur Erdös wrote: Hello all, is there a way to free memory allocated by variables in PHP?? This is a very important issue concerning long running scripts... this is a recurrent problem - not much can be done about it AFAIK ... I'd be very glad to be proved wrong. I have a script that generates > 5000 Newsletters and when the script finishes it uses 1.8 GB (!!) of RAM. Although I am using unset() to clean up variables (tried with $var = null too). okay this does suggest your doing something else very wrong - I personally have code that regularly generates upto 20,000 individualised newsletters without going anywhere near this ammount of memory - granted I've hit my memory limit a couple of times and had to jack it up to 128Megs (in practice the script grab just over 64Megs when it's doing it's worst). what version of php are you [ab]using? I've read sth about php not giving the allocated memory back to the OS until a script finishes, is that right?? Is it possible to free the memory "by hand"? Any suggestion is appreciated! thx in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] free allocated memory: HOW ?
I am using PHP version 5.1.2. on my dev machine. The same problem with PHP 5.2.1 on webserver. I am generating mails based on a HTML Template. If you look at the appended screenshot you'll see that after reading the template with fread() memory_get_usage() says ~386 MB in use... Then the placeholders in the read template are replaced by customized values within a loop. The size of the used memory grows permanently in each loop by approx 30 MB. any ideas what i am doing wrong and where i [ab]use php? ^^ Jochem Maas schrieb: Arthur Erdös wrote: Hello all, is there a way to free memory allocated by variables in PHP?? This is a very important issue concerning long running scripts... this is a recurrent problem - not much can be done about it AFAIK ... I'd be very glad to be proved wrong. I have a script that generates > 5000 Newsletters and when the script finishes it uses 1.8 GB (!!) of RAM. Although I am using unset() to clean up variables (tried with $var = null too). okay this does suggest your doing something else very wrong - I personally have code that regularly generates upto 20,000 individualised newsletters without going anywhere near this ammount of memory - granted I've hit my memory limit a couple of times and had to jack it up to 128Megs (in practice the script grab just over 64Megs when it's doing it's worst). what version of php are you [ab]using? I've read sth about php not giving the allocated memory back to the OS until a script finishes, is that right?? Is it possible to free the memory "by hand"? Any suggestion is appreciated! thx in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 'lang' file editor ...
- Original Message - From: "Jochem Maas" <[EMAIL PROTECTED]> Satyam wrote: maybe I should consider moving my 'shit' into gettext format. That was just what I was going to sugest: using gettext format. yeah, but I curerntly have 30 odd files each with upwards of 2000 strings in them, and it would also require changing the code base to use gettext (which is the easy part since I already use a wrap function for all the string/translation grabbing) Nevertheless, I find php-gettext far more flexible and, since it is in source format, you might want to modifiy the part that reads in the you mean this?: http://savannah.nongnu.org/projects/php-gettext/ I'm not sure I want to use userland code that does what gettext extension does [faster] (I'm quite happy to install/configure gettext and all the relevant locales) especially given that the author begins with "I don't like php much" ... but none the less I'll check it out. It is the gettext used by Wordpress and some other software that doesn't rely on people being happy installing and configuring gettext, so I guess it will be supported well beyond the likes or dislikes of the original developer. Nevertheless, since you already have the part of wrapping the translatable strings done, you might also want to check the PHP Compiler: http://phpcompiler.org/ as an alternative way of finding tokens. compiled translation file and use it to read in whatever format you find suits your needs. Satyam -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.2.0/757 - Release Date: 11/04/2007 17:14 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 'lang' file editor ...
I just played around with token_get_all() and token_name() and by the looks of the output it's going to be quite easy to create something that can rewrite the contents of a file and or augment it ... the only really tricky thing that I can't get my head round right away is handling the following in a nice way: $Lang['foo'] = 'bar'; $Lang['foo'] = 'my '.$Lang['bar'].' really hurts'; but part of the answer/solution to that problem lies in what I would like to present (and/or require from0 the person who will use the lang file 'editor' it's been a pleasure talking to myself ;-) Jochem Maas wrote: > anyone know of a decent script (or something I can rip out of an existing OS > tool) > that is capable of comparing, editing and saving 'old skool' lang files - you > know > the ones which define tons of array elements e.g.: > > $Lang['foo'] = 'bar'; > > I'm looking for something that can handle quotes properly and 'weird' array > keys > (that include constants, for instance) as well as sprintf markers in the > 'translation' > text (e.g. "my %s hurts") and if at all possible the abiltiy to recognise and > not f'up > stuff like: > > $Lang['foo'] = 'my '.$Lang['bar'].' really hurts'; > > and I'd prefer it to be able to keep file formatting, item ordering and > comments > as they were when saving back into the file. > > I can't find anything really useful - the firefox 'php lang file' editor > plugin, is, > for instance, not up to the job. > > tar, > Jochem > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] WWE in Stamford, CT needs a kick ass PHP Developer!
[snip] agreed, Dreamweaver is not the tool for you. But I've found it to be useful for whipping up quick HTML newsletters from slice photoshop layouts. And I like to see incremental change so if I used the browser refresh technique trying to tweak the crappy table layouts photoshop spits out, I'd be pressing "CTRL+S, ALT+TAB, CTRL+R" 100+ times! [/snip] That explains the top posting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] free allocated memory: HOW ?
Arthur Erdös wrote: > Hello all, > > is there a way to free memory allocated by variables in PHP?? This is a > very important issue concerning long running scripts... this is a recurrent problem - not much can be done about it AFAIK ... I'd be very glad to be proved wrong. > > I have a script that generates > 5000 Newsletters and when the script > finishes it uses 1.8 GB (!!) of RAM. Although I am using unset() to > clean up variables (tried with $var = null too). okay this does suggest your doing something else very wrong - I personally have code that regularly generates upto 20,000 individualised newsletters without going anywhere near this ammount of memory - granted I've hit my memory limit a couple of times and had to jack it up to 128Megs (in practice the script grab just over 64Megs when it's doing it's worst). what version of php are you [ab]using? > > I've read sth about php not giving the allocated memory back to the OS > until a script finishes, is that right?? Is it possible to free the > memory "by hand"? > > Any suggestion is appreciated! > > thx in advance > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] free allocated memory: HOW ?
Hello all, is there a way to free memory allocated by variables in PHP?? This is a very important issue concerning long running scripts... I have a script that generates > 5000 Newsletters and when the script finishes it uses 1.8 GB (!!) of RAM. Although I am using unset() to clean up variables (tried with $var = null too). I've read sth about php not giving the allocated memory back to the OS until a script finishes, is that right?? Is it possible to free the memory "by hand"? Any suggestion is appreciated! thx in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 'lang' file editor ...
Satyam wrote: >> >> maybe I should consider moving my 'shit' into gettext format. > > That was just what I was going to sugest: using gettext format. yeah, but I curerntly have 30 odd files each with upwards of 2000 strings in them, and it would also require changing the code base to use gettext (which is the easy part since I already use a wrap function for all the string/translation grabbing) > Nevertheless, I find php-gettext far more flexible and, since it is in > source format, you might want to modifiy the part that reads in the you mean this?: http://savannah.nongnu.org/projects/php-gettext/ I'm not sure I want to use userland code that does what gettext extension does [faster] (I'm quite happy to install/configure gettext and all the relevant locales) especially given that the author begins with "I don't like php much" ... but none the less I'll check it out. > compiled translation file and use it to read in whatever format you find > suits your needs. > > Satyam > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 'lang' file editor ...
maybe I should consider moving my 'shit' into gettext format. That was just what I was going to sugest: using gettext format. Nevertheless, I find php-gettext far more flexible and, since it is in source format, you might want to modifiy the part that reads in the compiled translation file and use it to read in whatever format you find suits your needs. Satyam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session Authentication
> -Message d'origine- > De : Tijnema ! [mailto:[EMAIL PROTECTED] > Envoyé : lundi 9 avril 2007 17:55 > À : Peter Lauri > Cc : Martin Marques; Ólafur Waage; [EMAIL PROTECTED] > Objet : Re: [PHP] Session Authentication > > On 4/9/07, Peter Lauri <[EMAIL PROTECTED]> wrote: > > > > > > > -Original Message- > > > From: Tijnema ! [mailto:[EMAIL PROTECTED] > > > Sent: Monday, April 09, 2007 5:38 PM > > > To: Martin Marques > > > Cc: Ólafur Waage; [EMAIL PROTECTED] > > > Subject: Re: [PHP] Session Authentication > > > > > > On 4/9/07, Martin Marques <[EMAIL PROTECTED]> wrote: > > > > Tijnema ! escribió: > > > > > On 4/9/07, Martin Marques <[EMAIL PROTECTED]> wrote: > > > > >> > > > > >> Yes: > > > > >> > > > > >> Don't use transparent session id, or even better, save the > > > > >> authentication in a cookie on the client (seperated from the > > > > >> session array). > > > > > > > > > > And then the user would crack the cookie > > > > > I know they are encrypted, but trust me, cookies can > be edited. > > > > > > > > So what? The user authenticated himself, so what is he > gonna crack? > > > Yes, but i guess you're not only storing if the user has > > > authenticated, also storing a username? > > > > > > And if that's not the case, then you could authenticate > by creating > > > a cookie where it says authenticated = yes, and you're > authenticated... > > > > > > Tijnema > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) To unsubscribe, > > > visit: http://www.php.net/unsub.php > > > > [Peter Lauri - DWS Asia] > > > > If cookies were that unsecured so you could create your own cookies > > that easily, then would cookies exist? > > > > Best regards, > > Peter Lauri > > Cookies are old, so in the time they were introduced, today > it is possible to create and modify cookies with some good > tools. These tools are illegal, but every cracker is 99% > illegal right? But that means i can't give you these tools to > proof it, but it is possible. > > Tijnema Whatever, really your bosting for nothing IMO, ethereal is available to everyone for sniffing cookie info, so is firefox cookie editor, and http live headers... What is so "hideous" about these tools? I use all of them to trouble shoot my websites while under developpment... Really the way to securing web application is learning to hack them or learning what hacks are possible.. And stop feeling superior sir! Regards, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session Authentication
> -Message d'origine- > De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part > de Ólafur Waage > Envoyé : lundi 9 avril 2007 14:40 > À : [EMAIL PROTECTED] > Objet : [PHP] Session Authentication > > Lets say i have a login system. This system authenticates the > user via mysql, when the user is authenticated, i set a > session variable to let the system know the user is > authenticated. ie. $_SESSION["authenticated"] = true; > > Lets also say i know that's how the system works, that a > session variable within my browser is set to true. Could i do > this if i knew all this info and "authenticate" myself by > setting the variable from the client side? $_SESSION['variables'] are stored server side and can only be set during script execution, not by the browser. > If it is possible, what can i do to prevent this or increase security? > What is possible here is called session hijacking, imagine this scenario: You are an innocent tourist, and go into a cyber café to check your mail, let's assume when you authenticate to your mail system, it is not encrypted. The owner of the cyber café is sniffing all incoming, and outgoing data, and just happened to know that you logged in. The SESSION_ID that is stored in a cookie on your computer is what links you to your authenticated session on the server. So the owner manages to sniff that SESSION_ID, knowing you are still logged on, he goes to the same site you are on, and edits the cookie that was generated by that site, to have the same SESSION_ID as the one he sniffed over the network. The owner has now owned/hijacked your session and is authenticated as yourself. Depending on the logoff mechanism involved he may or maynot be able to continue using your session when you logoff. So, to conclude on how to optimize your security, your authentication system should be encrypted, as in log in using https:// . Hope this helps, P.S You can try this at home by opening your same siteon two different computers and editing the session cookie on the one your not authenticated on with the session_id from the one you are authenticated on. It's quite suprising how it just "logs in" without credentials ;) Regards, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 'lang' file editor ...
what I'm looking for is something that will make it possible for an end user to merge [the contents] existing language files (that contain the items for the same language) *and* perform translations between languages in a visual/easy way (i.e. without opening a text editor) but end up with lang files that still formatted and commented when I'm done. it's a three step process: 1. 'parse' 2 files: a 'reference' and a 'translation' file 2. display an editing interface for the 2 files (textareas, filtering [e.g. show only untranslated items], sorting, etc) 3. write out a merged/updated file. probably the merging of 2 existing lang files of the same language will require a seperate interface than the translation/comparison of 2 files containing different languages. I have made a half-assed attempt to do this some years ago and it worked ok but wasn't quite the level of sophistication I desired - If no one has anything like this lying around then I guess it's time for me to hack up a new thingummy, using var_export()/print_r() [and running the code to merge, etc] won't cut it (I've been down that road already) so probably I'm looking at using either the tokenizer (although how exactly is something I'd have to look into) or a combination of preg_match()/preg_replace() (which is something I am confident I can now do to the required level - when I tried before my regexp skills sucked too much). I'm quite sure I make it work, but I'd be surprised if no-one has gone before me - there must be tons of projects out there with the same kind of language file structure ... maybe I should consider moving my 'shit' into gettext format. Jim Lucas wrote: > Richard Lynch wrote: >> Seems to me you'd be better off just running the PHP code and dumping >> the arrays out with var_dump or print_r "like" function to generate >> your new language files... >> >> Otherwise, you're writing a fairly big chunk of the PHP parser, which >> is already in PHP, so you re-invent the wheel... >> >> On Wed, April 11, 2007 9:07 pm, Jochem Maas wrote: >>> anyone know of a decent script (or something I can rip out of an >>> existing OS tool) >>> that is capable of comparing, editing and saving 'old skool' lang >>> files - you know >>> the ones which define tons of array elements e.g.: >>> >>> $Lang['foo'] = 'bar'; >>> >>> I'm looking for something that can handle quotes properly and 'weird' >>> array keys >>> (that include constants, for instance) as well as sprintf markers in >>> the 'translation' >>> text (e.g. "my %s hurts") and if at all possible the abiltiy to >>> recognise and not f'up >>> stuff like: >>> >>> $Lang['foo'] = 'my '.$Lang['bar'].' really hurts'; >>> >>> and I'd prefer it to be able to keep file formatting, item ordering >>> and comments >>> as they were when saving back into the file. >>> >>> I can't find anything really useful - the firefox 'php lang file' >>> editor plugin, is, >>> for instance, not up to the job. >>> >>> tar, >>> Jochem >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >> >> > From what he said, I read that he want to rip the contents out of the > file, not actually parse it. > > for example, if he parsed this out: > $Lang['foo'] = 'my '.$Lang['bar'].' really hurts'; > > You would get the completed string, not a line that has the variable > call in it. > > Maybe I took it wrong, but that is what I thought he wanted. > > a reader, not a parser. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: SQL Source Control
2007. 04. 11, szerda keltezéssel 21.43-kor Colin Guthrie ezt írta: > Zoltán Németh wrote: > > yeah I have the same problem ;) > > > > I have two kind of SQL files: > > 1) SQL of the complete, blank DB structure - I store it for each main > > version (I should store it for each version if I wouldn't be so > > lazy... ;) ) > > 2) SQL instructions to upgrade from a DB version to another - I need > > these to upgrade working databases > > > > however I have no real solution for rollback, and if something is broken > > in a new version and I have to revert a working DB to an older state, > > well that's real serious trouble (and usually a lot of cursing and stuff > > like that) > > > > so, if anyone has a good solution I also would like to hear it :) > > No technical solution, but just put a "Swear Box" in the office and that > way when a borkage happens you'll all have to put a £/$/€ in the tub > with each curse you utter... It wont help but at least come Friday night > you can all enjoy a few extra beers in the pub ;) heh good idea, I think I will implement it in the next version ;) greets Zoltán Németh > > Col > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Outlook task via email
Chris Boget wrote: > I've done some searching on Google but haven't been able to come up with > anything helpful. Has anyone on the list done any work on sending an > Outlook Task as part of an email? Or does anyone know of a good > resource that shows how this can be done? I'm going to be using PHP's > mail() to actually send and I'm familiar with attaching files to such > emails but I'm just not sure how a task can be attached. While I've not looked into it myself, I'd imagine it is just a VCALENDAR attachment with the correct (or perhaps M$ bastardised) MIME type. If you have an IMAP server you can use, send the mail to Outlook and drag the message to the IMAP server then use the shell or e.g. Thunderbird to look at the Message Source that Outlook inexplicably keeps so secret and guarded from you!! It should be obvious from that how to copy it (unless it's wrapped up in the evil package of a "winmail.dat" file - eugh TNEF sux s bad) Col. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php5 oop question
# [EMAIL PROTECTED] / 2007-04-11 23:44:16 -0700: > Paul Scott wrote: > >On Wed, 2007-04-11 at 23:22 -0700, Jim Lucas wrote: > > > >>Has anybody else seen this style of syntax? > >> > >http://5ive.uwc.ac.za/index.php?module=blog&action=viewsingle&postid=init_8059_1163957717&userid=5729061010 > > > >I don't think that its really useful for anything, except maybe creating > >overly complex SQL queries. > well, I guess the better question is, is why when I talk others about oop, > they say that this style of syntax is OOP, and anything else is not. *What* style of syntax? "Syntax" is grammar, a set of rules, the "visible" part of a programming language, something you either follow or you get a parse error. To which grammar are you referring? > be it dot notation or the pointers (->) in php. Having "primitive" types, including literals, behave like instances of a class helps writing object-oriented code, because you don't have to special case. It's not required, however. You can write o-o code in today's PHP, it just won't be purely "objective". > I heard it called messaging at one point in the past. > > the passing up of information in the tree. Different people use different metaphors. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php5 oop question
# [EMAIL PROTECTED] / 2007-04-11 23:36:56 -0700: > Paul Scott wrote: > >On Wed, 2007-04-11 at 23:22 -0700, Jim Lucas wrote: > >>Has anybody else seen this style of syntax? > > >I don't think that its really useful for anything, except maybe creating > >overly complex SQL queries. > > What about using it for math? > class Math { > function __construct() { > } > function in($num=null) { > if ( is_null($num) ) { > echo "A number was not given on initialization."; > exit; > } > $this->value = $num; > return $this; > } > function out() { > echo $this->value; > } > function get() { > return $this->value; > } > function add($n) { > $this->value += $n; > return $this; > } > function subtract($n) { > $this->value -= $n; > return $this; > } > function multiply($n) { > $this->value *= $n; > return $this; > } > function divide($n) { > $this->value /= $n; > return $this; > } > } > > $mObj = new Math(); > $mObj->in(10)->add(90)->divide(5.3)->multiply(10)->out(); The class really represents a number, not "Math", that's too abstract (pun intended) for an instantiable class. Besides, you're mixing together two responsibilities, Math should really be called Number, it should be immutable, and you'll spare someone from a terrible debugging session caused by someone doing $math = new math; $ten = $math->in(10); $five = $ten->subtract(5); $fifty = $ten->add(40); ($fifty is actually 45, because $ten is 5 after the subtract() call) -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php