RE: [PHP] URL modification
Thnks, H... made a quick look into it. Seems to be apache compatible. I'm designing a site to be hosted on an IIS Server. Does it still works there? Regards, Xavier de Lapeyre Web Developer Enterprise Data Services 24, Dr Roux Street, Rose Hill Office: (230) 465 17 00 Fax: (230) 465 29 00 Site: www.eds.mu Email: [EMAIL PROTECTED] Please consider the environment before printing this mail note. -Original Message- From: Andrés Robinet [mailto:[EMAIL PROTECTED] Sent: vendredi 22 février 2008 11:48 To: php-general@lists.php.net Subject: RE: [PHP] URL modification -Original Message- From: Xavier de Lapeyre [mailto:[EMAIL PROTECTED] Sent: Friday, February 22, 2008 2:09 AM To: php-general@lists.php.net Subject: [PHP] URL modification Importance: High Hi all, I saw on some websites that modifies the links to access the webpages. Something like: http://www.example.com/login/ instead of http://www.example.com/login.php Does anyone knows how this works or how its call / which PHP library performs this action? Xavier de Lapeyre That's called URI/URL Routing and it's usually performed as part of every MVC Framework I know of (CodeIgniter, CakePHP, Symfony, Zend Framework... just to name a few). It's usually implemented through Apache's mod_rewrite module, but you can get close without that module, if you allow for something like: http://www.example.com/index.php/myaccount/profile (that is, you don't need mod_rewrite unless you want to remove the index.php part of the URI path) However, if you have an existing website, migrating it to use one of the MVC frameworks (or just using a stand-alone URI Routing class) may not be the path you want to follow. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.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] URL modification
Quoting Xavier de Lapeyre [EMAIL PROTECTED]: Thnks, H... made a quick look into it. Seems to be apache compatible. I'm designing a site to be hosted on an IIS Server. Does it still works there? Regards, Xavier de Lapeyre Web Developer Enterprise Data Services 24, Dr Roux Street, Rose Hill Office: (230) 465 17 00 Fax: (230) 465 29 00 Site: www.eds.mu Email: [EMAIL PROTECTED] Please consider the environment before printing this mail note. -Original Message- From: Andrés Robinet [mailto:[EMAIL PROTECTED] Sent: vendredi 22 février 2008 11:48 To: php-general@lists.php.net Subject: RE: [PHP] URL modification -Original Message- From: Xavier de Lapeyre [mailto:[EMAIL PROTECTED] Sent: Friday, February 22, 2008 2:09 AM To: php-general@lists.php.net Subject: [PHP] URL modification Importance: High Hi all, I saw on some websites that modifies the links to access the webpages. Something like: http://www.example.com/login/ instead of http://www.example.com/login.php Does anyone knows how this works or how its call / which PHP library performs this action? Xavier de Lapeyre That's called URI/URL Routing and it's usually performed as part of every MVC Framework I know of (CodeIgniter, CakePHP, Symfony, Zend Framework... just to name a few). It's usually implemented through Apache's mod_rewrite module, but you can get close without that module, if you allow for something like: http://www.example.com/index.php/myaccount/profile (that is, you don't need mod_rewrite unless you want to remove the index.php part of the URI path) However, if you have an existing website, migrating it to use one of the MVC frameworks (or just using a stand-alone URI Routing class) may not be the path you want to follow. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com There are rewrite modules for IIS also. Just google for IIS rewrite. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL modification
H... made a quick look into it. Seems to be apache compatible. I'm designing a site to be hosted on an IIS Server. Does it still works there? On IIS I belive the default document is default.htm Though you should be able to modify this to whatever you please. On Apache it is index.html or index.php (for example). Regardless you want this to be parsed by PHP, and then you can stick the following in it: ?php header('http://www.example.com/login.php'); ? Place this file in your login directory and then you'll be able to publish URLs such as http://www.example.com/login The trailing slash is not necessary if login is a directory. For example: http://www.websupportsolutions.co.uk/demo -- Richard Heyes http://www.phpguru.org Free PHP and Javascript code -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL modification
Xavier de Lapeyre wrote: Hi all, I saw on some websites that modifies the links to access the webpages. Something like: http://www.example.com/login/ instead of http://www.example.com/login.php Does anyone knows how this works or how its call / which PHP library performs this action? It could be apache content negotiation that does it. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] All Survey leading to PHP
I am aware that reverse engineering can be done to every program, and no one may bother to really take too much trouble to reverse engineer it. All the same I do not want it to be as simple as a java decompiler wherein the code is regenerated from a jar file to perfection. Not so easy to break a Delphi Exe. I am not used to such fantastic support. Good team work out here. Thanks. Regards Allan Fernandes Matty Sarro [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] You can attempt to protect your code with Zend guard or a couple other utilities. I believe theres also some php obfuscation utilities out there - consult google. Ultimately though, even with compiled code you will never stop someone who wants to see your code, decompilers are commonplace. As mentioned in a previous response, a clear cut contract is your best bet here (especially since things like zend guard require additional software, which will in turn decrease performance). On Thu, Feb 21, 2008 at 12:07 PM, Andrés Robinet [EMAIL PROTECTED] wrote: -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 11:36 AM To: Allan Fernandes Cc: php-general@lists.php.net Subject: Re: [PHP] All Survey leading to PHP On Thu, February 21, 2008 6:29 am, Allan Fernandes wrote: 1) Is there any method to protect source code of my applications even when deployed at the clients Server. Have a good, clear contract and relationship with the client. You can also attempt to encode them with any number of PHP encoders, all of which have been and can be cracked by a determined user. 2) Can I call Delphi Dll's You may be able to use COM objects. http://php.net/com -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- I assume you will be deploying your applications on a windows server, right? Otherwise, COM is NOT an option (probably .Net is ???). Just curious, why would you want to call a Delphi DLL (which is no different than any DLL)? Just curious (x2) has anybody tried Delphi 4 PHP (http://www.codegear.com/products/delphi/php)? As a Delphi fan... if you are moving to PHP development, I'd say you forget all you know about Delphi (or .Net for that matter) except the very generic programming and OOP concepts. If you plan to target Linux... forget about DLLs. However, if you will always use your own server for deployment, you could try *migrating* your existing codebase as a set of modules and cgi programs (I don't know, it depends on what you are trying to do). Check out Freepascal (http://www.freepascal.org/). Anyway, if you are deploying PHP web applications for *all* OSs, you'd better off forgetting about Delphi and get good tutorials/courses/books on PHP. And if you want a Delphi-like IDE... be prepared for deception, only Delphi4PHP gets somewhere close to that (and I don't know how high are the runtime requirements to run PHP-VCL applications). There are very good PHP IDEs, such as Zend Studio, PHPDesigner, and NuSphere, etc... but forget about clicking and dragging components on a form if that's your choice. Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.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
[PHP] Re: AMP installer
Ryan A escreveu: Hey! Need to reinstall Apache PHP and MySql for personal development use on my new laptop... I usually used phpdev in the past but now I want php5 compatability... can anyone recommend any such all in one installer. And yes, I know its good experience and so on to do each one manually... but dont have the time to pure over help docs for hours or days. Am on Win Vista premium. Thanks! Ryan --- http://www.educar.pro.br/en/ -- zerof http://www.educar.pro.br/ Apache - PHP - MySQL - Boolean Logics - Project Management -- You must hear, always, one second opinion! In all cases. -- Let the people know if this info was useful for you! -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Prado IDE
Hi there. Does anyone knows a good IDE for developing prado? I would prefer an eclipse plug in if it's possible. Thanks in Advance! HJRocha
Re: [PHP] APC __autoload webclusters
Nathan Nobbe schreef: On Thu, Feb 21, 2008 at 12:01 PM, Jochem Maas [EMAIL PROTECTED] wrote: Richard Lynch schreef: If it's that inter-tangled, then I would hazard a WILD GUESS that the __autoload will still end up loading everything... but not on every request ;-) ... I do use output caching, and I know not everything is actually used in every request. i think youre good to go w/ autoload not loading everything up, but what about existing include / require directives? if the code doesnt already use __autoload() its almost certainly strewn w/ these. so i think if you want the boost from __autoload, not loading up everything, youll at least have to strip these out. I know, I have ... I wrote the code in the first :-) I know - but it's a rubbish solution because it offer no control as to what is cleared from the APC cache, sometimes I want to clear opcodes, sometimes user-data, sometimes both ... graceful means being forced to clear everything. you can pass a parameter to apc_clear_cache() http://www.php.net/manual/en/function.apc-clear-cache.php that distinguishes what you want to clear; user data or cached opcode. obviously calling it from the cli will not clear the webserver user cache though. I know apc_clear_cache() ... the whole problem is doing it on multiple servers. your statement about not being able to do it from the CLI (which I know) is half correct AFAICT - you can't clear anything cached in APC via mod_php from the CLI ... which is my whole problem in a nutshell :-) One would think that there was something like this indeed - I cannot find it, but then there must be something ... I assume, for instance, that Yahoo!** occassionally see fit to clear APC caches on more than one machine and I doubt Rasmus sits there and opens a browser to run apc.php on each one ;-) i dont know how yahoo does it, but i do know a little about how facebook does it; they had 3 speakers at the dc php conference last year. i think you might find these slides helpful, (sorry for the ridiculuus url) http://www.google.com/url?sa=tct=rescd=1url=http%3A%2F%2Ftekrat.com%2Ftalks_files%2Fphpdc2007%2Fapc%40facebook.pdfei=tce9R9T4FqrszATeiZG6CAusg=AFQjCNF_1Ecm2cL1EINgRQG9k3fTEclzpAsig2=ifrJK545M2liBdXbRrHrIw thanks for that link - it gives me a few angles and ideas to work on! you can use capistrano to deploy the new files; but it may be more convenient to use php and http requests to update all the server caches; *just a thought*. I'm not using capistrano for file deployment (files are stored centrally on a GFS volume to which all servers have access) ... I am (will be) using capistrano in order to run commands symultaneously on all webservers ... one of which will have to be some kind of cache control mechanism, which is the case of apc will probably be a php script that hits apc.php on the local machines webserver (but I want to be able to run said php script on multiple machines at once, or at least without having to log in to every machine ... and I see no reason to duplicate the functionality of capistrano, I just write a php script to do the actual apc.php interaction on the local webserver that cap can call on each machine. there are optimizations that are possible as well, such as setting, apc.stat=0 and got that one set already. :-) using apc_compile_file() rather than clearing the entire cache, but these techniques add I read the facebook story about preloading the cache (using memory dumping/loading) in combination with apc_compile_file() ... which is cool but a little too much effort given the time/budget I have to complete this (my client doesn't have X billion to burn ... but funnily enough they do have a viable business model ... but that's another story ;-) complexity. it sounds like you just want to get a decent bumb w/o too much additional complexity, so i wouldnt recommend them here, but i thought id mention them in passing.. apart from writing some kind of management cli script to [remote] control the apc cache of each webserver I'm also going [to have to] incorporate memcache functionality into my current caching stuff - many thanks for that PDF link (I hadn't come accross it before in my searching, although I had discovered various other facebook+apc/memcache/caching related presentations) it's given me jsut enough code and ideas to hang myself with ... er I mean write a transparent memcache layer into my app :-) -nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL modification
On Feb 22, 2008, at 2:09 AM, Xavier de Lapeyre wrote: Hi all, I saw on some websites that modifies the links to access the webpages. Something like: http://www.example.com/login/ instead of http://www.example.com/login.php Does anyone knows how this works or how its call / which PHP library performs this action? I do a version of this simply by creating a directory and then put a default file in... I have Apache set to recognize index.php, index.shtml, index.html etc. etc. etc. as default files, so when someone goes to www.raoset.com/contact/ the page that loads is: www.raoset.com/contact/index.shtml For my purposes it works great :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] All Survey leading to PHP
At 3:43 AM +0530 2/22/08, Allan Fernandes wrote: I am aware that reverse engineering can be done to every program, and no one may bother to really take too much trouble to reverse engineer it. All the same I do not want it to be as simple as a java decompiler wherein the code is regenerated from a jar file to perfection. Not so easy to break a Delphi Exe. I am not used to such fantastic support. Good team work out here. Thanks. Regards Allan Fernandes I, for one, don't care if someone steals my code or not. If a client hires me to do something, whatever code I write is his -- that's simple enough. I wasted more years than I am willing to admit trying to protect code, there's no doing it. And this is especially true on the net where you can't even guarantee that a password is safe. So, my advice -- write good code, pick up your check, and move one to the next client. Stop worrying about protecting your code and hope that you get good enough that someone wants to steal it. 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] All Survey leading to PHP
On Fri, 2008-02-22 at 09:33 -0500, tedd wrote: At 3:43 AM +0530 2/22/08, Allan Fernandes wrote: I am aware that reverse engineering can be done to every program, and no one may bother to really take too much trouble to reverse engineer it. All the same I do not want it to be as simple as a java decompiler wherein the code is regenerated from a jar file to perfection. Not so easy to break a Delphi Exe. I am not used to such fantastic support. Good team work out here. Thanks. Regards Allan Fernandes I, for one, don't care if someone steals my code or not. If a client hires me to do something, whatever code I write is his -- that's simple enough. I wasted more years than I am willing to admit trying to protect code, there's no doing it. And this is especially true on the net where you can't even guarantee that a password is safe. So, my advice -- write good code, pick up your check, and move one to the next client. Stop worrying about protecting your code and hope that you get good enough that someone wants to steal it. BAD IDEA BUSTER!!! Always backup your code so it's protected from crashes!! ;) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] All Survey leading to PHP
At 9:42 AM -0500 2/22/08, Robert Cummings wrote: On Fri, 2008-02-22 at 09:33 -0500, tedd wrote: At 3:43 AM +0530 2/22/08, Allan Fernandes wrote: I am aware that reverse engineering can be done to every program, and no one may bother to really take too much trouble to reverse engineer it. All the same I do not want it to be as simple as a java decompiler wherein the code is regenerated from a jar file to perfection. Not so easy to break a Delphi Exe. I am not used to such fantastic support. Good team work out here. Thanks. Regards Allan Fernandes I, for one, don't care if someone steals my code or not. If a client hires me to do something, whatever code I write is his -- that's simple enough. I wasted more years than I am willing to admit trying to protect code, there's no doing it. And this is especially true on the net where you can't even guarantee that a password is safe. So, my advice -- write good code, pick up your check, and move one to the next client. Stop worrying about protecting your code and hope that you get good enough that someone wants to steal it. BAD IDEA BUSTER!!! Always backup your code so it's protected from crashes!! ;) Rob: Did you forget to take your meds this morning? I'm not talking about backup. :-) But you did raise a point I forgot to mention. When I write something for a client, it's his. But, it's also mine to be reused as I see fit. I am not above selling the same code to several different clients. 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] Deleting all rows in a database every 24 hours?
On Fri, Feb 22, 2008 at 1:28 AM, Zoran Bogdanov [EMAIL PROTECTED] wrote: The title says it all, how do I perform an action every 24 hours? Another question better answered on Google. PHP Script: ? $sql = TRUNCATE TABLE `tablename`; mysql_query($sql); ? Crontab Entry: 40 3 * * * `which php` /path/to/your/script.php That will run every morning at 3:40a server time with the path-preferred PHP. If you're on Windows, look up Scheduled Tasks. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL modification
Richard Heyes wrote: H... made a quick look into it. Seems to be apache compatible. I'm designing a site to be hosted on an IIS Server. Does it still works there? On IIS I belive the default document is default.htm Though you should be able to modify this to whatever you please. On Apache it is index.html or index.php (for example). Regardless you want this to be parsed by PHP, and then you can stick the following in it: ?php header('http://www.example.com/login.php'); ? Place this file in your login directory and then you'll be able to publish URLs such as http://www.example.com/login The trailing slash is not necessary if login is a directory. For example: http://www.websupportsolutions.co.uk/demo To use url's like http://domain.com/login/ as opposed to http://domain.com/login.php you can take multiple approaches. The first and simplest is to simply save your login.php as /login/index.php to use this approach you need to ensure that index.php is listed as a default page. In IIS you can set the default page(s) to be whatever you like: - Open IIS Manager - Server - Websites - Right Click [properties] - select Documents tab - ensure Enable default content page is ticked - ensure index.php is listed - if not then click [add] and enter index.php - continue to add any other default pages [index.html, index.shtml etc] The second common solution [and I'd advise to get used to it asap] is to use URL rewriting. In short url rewriting involves defining rules which the web server uses to direct http requests to resources on the server. eg: direct domain.com/all_our_news to /index.php?newsitem=all a quick intro guide can be found here: http://www.sitepoint.com/article/guide-url-rewriting For URL rewriting in IIS use ISAPI Rewrite - http://www.isapirewrite.com/ in apache use mod_rewrite [apache1.3] httpd.apache.org/docs/1.3/mod/mod_rewrite.html [apache2.0] httpd.apache.org/docs/2.0/mod/mod_rewrite.html Both are pretty much identical when it comes to the end rewrite rules. Hope that helps a little Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: temporary error
At 4:08 PM +0100 2/21/08, Mirco Soderi wrote: In the original code there were no sintax errors, Ah crap -- they're taxing that now?! 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] All Survey leading to PHP
On Fri, Feb 22, 2008 at 9:42 AM, Robert Cummings [EMAIL PROTECTED] wrote: BAD IDEA BUSTER!!! Always backup your code so it's protected from crashes!! And here, I thought that backups were to recover from crashes, not to protect from them. I learn something new every day. ;-P -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: temporary error
At 9:59 AM -0500 2/22/08, Robert Cummings wrote: On Fri, 2008-02-22 at 09:49 -0500, tedd wrote: Outside of a reasonable need for readability, variables should not be used for documentation. Who needs documentation when variables and functions are self-documenting? Cheers, Rob. Rob: Please, medication first, reading email second. :-) 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] Re: temporary error
snip=100% Call me old-fashioned, old, or a bastard, but I still prefer: for($i=0;$icount($whatever);$i++) { } For what do I need to remember the name of the counter increment? Not only do I not care what it's name is, because it's disposable at that moment, but I won't even be reusing it. And not just because I won't be reusing it --- I can't reuse it. Another reason not to care. Secondly, while Nate R. makes an excellent point about placing some documentation in the head of the script, I still find that some of my favorite characters often go far underused. And they are: // # /* and */ -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: temporary error
[snip] In the original code there were no sintax errors [/snip] Is that irony? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: temporary error
On Fri, Feb 22, 2008 at 10:01 AM, tedd [EMAIL PROTECTED] wrote: At 4:08 PM +0100 2/21/08, Mirco Soderi wrote: In the original code there were no sintax errors, Ah crap -- they're taxing that now?! http://www.insidervlv.com/taxgeneralinfo.html -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: temporary error
On Fri, 2008-02-22 at 09:49 -0500, tedd wrote: If you wan to shorten a bit you can use a constant as the counter increment like so: define('Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter', 1); $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter = $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter + Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter; -Shawn -Shawn: Not that you wrote that verbose crap, but my personal choice would be: //Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter = $a //Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter = $b $a += $b; Outside of a reasonable need for readability, variables should not be used for documentation. Who needs documentation when variables and functions are self-documenting? Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: temporary error
If you wan to shorten a bit you can use a constant as the counter increment like so: define('Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter', 1); $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter = $Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter + Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter; -Shawn -Shawn: Not that you wrote that verbose crap, but my personal choice would be: //Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter = $a //Increment_Super_Cala_Fraga_Listic_Ex_Peal_Ado_Tio_Us_Counter = $b $a += $b; Outside of a reasonable need for readability, variables should not be used for documentation. 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] Deleting all rows in a database every 24 hours?
cron bastien To: php-general@lists.php.net From: [EMAIL PROTECTED] Date: Fri, 22 Feb 2008 07:28:58 +0100 Subject: [PHP] Deleting all rows in a database every 24 hours? The title says it all, how do I perform an action every 24 hours? Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _
Re: [PHP] All Survey leading to PHP
I personally never sell my code... everything I create is released as open source under GPL. However I do sell support, and server management, and occasionally server hardware to run everything :o) (Richard Stallman actually gave me the idea a few years ago when I emailed him about ways to make a profit while still providing open source code free-as-in-free-beer-and-speech). I do warn my customers though that if they break it by modifying code its their responsibility and it lies outside of my responsibility to fix it. Its worked out wonderfully so far. On Fri, Feb 22, 2008 at 10:01 AM, Daniel Brown [EMAIL PROTECTED] wrote: On Fri, Feb 22, 2008 at 9:42 AM, Robert Cummings [EMAIL PROTECTED] wrote: BAD IDEA BUSTER!!! Always backup your code so it's protected from crashes!! And here, I thought that backups were to recover from crashes, not to protect from them. I learn something new every day. ;-P -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] All Survey leading to PHP
On Fri, 2008-02-22 at 09:57 -0500, tedd wrote: So, my advice -- write good code, pick up your check, and move one to the next client. Stop worrying about protecting your code and hope that you get good enough that someone wants to steal it. BAD IDEA BUSTER!!! Always backup your code so it's protected from crashes!! ;) Rob: Did you forget to take your meds this morning? I'm not talking about backup. :-) Hey.. there's a winkie there. I was just being funny. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XML encoding variable simpleXML on Linux
I am using PHP on Linux to communicate with an XML peer. I pull and push documents from and to their server. On the console I use UTF-8 as far as I can tell. When I send these documents should my leading tag read: ?xml versionnn=1.0 encoding=UTF-8? or is the encoding done by PHP and how do I know what it is encoded to? TIA Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL modification
Nathan Rixham wrote: To use url's like http://domain.com/login/ as opposed to http://domain.com/login.php you can take multiple approaches. [big snip] Seriously, this is all overkill. Apache content negotiation does it all automagically and with minimal effort. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] All Survey leading to PHP
On Fri, 2008-02-22 at 15:49 +, Nathan Rixham wrote: One further point: I develop on a windows server 2003 machine I think Mr. T. said it best... I pity da fool! Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL modification
On Fri, Feb 22, 2008 at 10:53 AM, Per Jessen [EMAIL PROTECTED] wrote: Nathan Rixham wrote: To use url's like http://domain.com/login/ as opposed to http://domain.com/login.php you can take multiple approaches. [big snip] Seriously, this is all overkill. Apache content negotiation does it all automagically and with minimal effort. Yes it does but the OP is using IIS. ;-P -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] All Survey leading to PHP
On Fri, Feb 22, 2008 at 10:58 AM, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2008-02-22 at 15:49 +, Nathan Rixham wrote: One further point: I develop on a windows server 2003 machine I think Mr. T. said it best... I pity da fool! Must be Friday. ;-P -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] All Survey leading to PHP
Robert Cummings wrote: On Fri, 2008-02-22 at 15:49 +, Nathan Rixham wrote: One further point: I develop on a windows server 2003 machine I think Mr. T. said it best... I pity da fool! Cheers, Rob. Indeed, purely because I need to check functionality in IIS and indeed layout in IE *poor excuse* [convincing myself] thank the good lord for putty and ssh. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
On Fri, 2008-02-22 at 09:50 -0600, Greg Donald wrote: On 2/21/08, Nick Stinemates [EMAIL PROTECTED] wrote: I'm glad you're literate enough to understand what *indication* and *usually* mean. I know perfectly well what they mean, both words in fact. What I, and many others I can only assume, are waiting for, is one shred of an example to back up your obviously immature and uninformed claim. Oh wait.. I am indeed waiting, where's your code? When, and under what circumstances exactly, is getting back an array of objects from a function or method call poor design ? Please, do tell. You must have missed his highly persuasive post regarding wrapping everything in a collection object layer. I for one have begun reworking all of my code. It's been going great so far... I feel so purist having objects everywhere. I've even implemented wrapper objects for base datatypes in case someday, a year or 50 from now, I want to perform an action on an integer. In fact it's great, I've reimplemented all of the array functions (shuffle, merge, splice, etc) to work on my collections-- they were super fast as PHP functions but the usability was just plain crap. Obviously I couldn't apply them to collections of integers without forcing any future developers into difficulty. And who knew how much more versatile strings could be as collections of character objects. In fact, I'm thinking characters should be collections of bit objects. We'll see about that one though, I'm already suffering severe performance issues. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL modification
Daniel Brown wrote: On Fri, Feb 22, 2008 at 10:53 AM, Per Jessen [EMAIL PROTECTED] wrote: Nathan Rixham wrote: To use url's like http://domain.com/login/ as opposed to http://domain.com/login.php you can take multiple approaches. [big snip] Seriously, this is all overkill. Apache content negotiation does it all automagically and with minimal effort. Yes it does but the OP is using IIS. ;-P Oops, I missed that completely. Sorry. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
On 2/21/08, Nick Stinemates [EMAIL PROTECTED] wrote: I'm glad you're literate enough to understand what *indication* and *usually* mean. I know perfectly well what they mean, both words in fact. What I, and many others I can only assume, are waiting for, is one shred of an example to back up your obviously immature and uninformed claim. Oh wait.. I am indeed waiting, where's your code? When, and under what circumstances exactly, is getting back an array of objects from a function or method call poor design ? Please, do tell. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Prado IDE
On Fri, Feb 22, 2008 at 7:34 AM, Hélio Rocha [EMAIL PROTECTED] wrote: Hi there. Does anyone knows a good IDE for developing prado? I would prefer an eclipse plug in if it's possible. http://www.google.com/search?q=prado+editor -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] All Survey leading to PHP
On Fri, 2008-02-22 at 10:01 -0500, Daniel Brown wrote: On Fri, Feb 22, 2008 at 9:42 AM, Robert Cummings [EMAIL PROTECTED] wrote: BAD IDEA BUSTER!!! Always backup your code so it's protected from crashes!! And here, I thought that backups were to recover from crashes, not to protect from them. Sure, but if you have no backup, there's nothing to recover, and you'll wish you had protected your code by making a backup for recovery ;) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML encoding variable simpleXML on Linux
encoding=UTF-8 doesn't guarantee that XML is encoded in UTF-8 its only purpose is to tell XML parser how to decode that XML document . it is responsibility of document creator to ensure that XML is proper UTF-8 document . on PHP side when creating XML there are number of functions to ensure UTF-8 strings though there are some issues in PHP5 , and one of the main features of upcoming PHP6 is to address UTF-8 Issues that current PHP has. some of UTF functions utf8_encode — Encodes an ISO-8859-1 string to UTF-8 string utf8_encode ( string $data ) On Feb 22, 2008, at 4:52 PM, Larry Brown wrote: I am using PHP on Linux to communicate with an XML peer. I pull and push documents from and to their server. On the console I use UTF-8 as far as I can tell. When I send these documents should my leading tag read: ?xml versionnn=1.0 encoding=UTF-8? or is the encoding done by PHP and how do I know what it is encoded to? TIA Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bojan Tesanovic http://www.classicio.com/ http://www.real-estates-sale.com/
Re: [PHP] All Survey leading to PHP
tedd wrote: At 9:42 AM -0500 2/22/08, Robert Cummings wrote: On Fri, 2008-02-22 at 09:33 -0500, tedd wrote: At 3:43 AM +0530 2/22/08, Allan Fernandes wrote: I am aware that reverse engineering can be done to every program, and no one may bother to really take too much trouble to reverse engineer it. All the same I do not want it to be as simple as a java decompiler wherein the code is regenerated from a jar file to perfection. Not so easy to break a Delphi Exe. I am not used to such fantastic support. Good team work out here. Thanks. Regards Allan Fernandes I, for one, don't care if someone steals my code or not. If a client hires me to do something, whatever code I write is his -- that's simple enough. I wasted more years than I am willing to admit trying to protect code, there's no doing it. And this is especially true on the net where you can't even guarantee that a password is safe. So, my advice -- write good code, pick up your check, and move one to the next client. Stop worrying about protecting your code and hope that you get good enough that someone wants to steal it. BAD IDEA BUSTER!!! Always backup your code so it's protected from crashes!! ;) Rob: Did you forget to take your meds this morning? I'm not talking about backup. :-) But you did raise a point I forgot to mention. When I write something for a client, it's his. But, it's also mine to be reused as I see fit. I am not above selling the same code to several different clients. Cheers, tedd I tend to follow the same pattern, however I say that the application or website as the clients call it is entirely there's, however all classes/objects/code snippets/javascripts [basically anything re-usable] remains property of your's truely with indefinate usage right's given to the client. Protecting source: I've got a very simple view point on this, I use linux servers, I can go into the source of everything on the entire machine and modify or copy it, so why then should my application built using open source software, running on an open source platform, through an open source web server with an open source database behind it choose to use closed source? I suppose one way of looking at it is, if your codes that good that people want to re-use it, then let them, help them and gain the credit and respect that goes with it. Just document it up, attribute credit where credit's due and GPL your code (or another more restricive license). Another simple solution is to host all app's on your own server to which only you have access - although odds are your still going to have to give the source to the clients so null and voided? I concurr completely, the support from the PHP community is fantastic, even the documentation is far superior to any other language that I've used. Help is a plenty, examples are everywhere, and there's code ready built on the net for almost everything. One further point: I develop on a windows server 2003 machine, I test locally in apache2 and IIS. I then upload to one of several linux machines [ubuntu, debian, rhel]. No recompiling, no messing about, just upload and run; as far as languages to make websites in go, you won't get much better bar possibly a python/xul combo but again I think php win's again due to the sheer amount of add-on's and open source scripts available. Just a random ramble, Nathan 14th March :D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] All Survey leading to PHP
On Fri, 2008-02-22 at 16:04 +, Nathan Rixham wrote: Robert Cummings wrote: On Fri, 2008-02-22 at 15:49 +, Nathan Rixham wrote: One further point: I develop on a windows server 2003 machine I think Mr. T. said it best... I pity da fool! Cheers, Rob. Indeed, purely because I need to check functionality in IIS and indeed layout in IE *poor excuse* [convincing myself] VMware is da bomb. Never boot up windows outside of a fitting sandbox again. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP: Ajax send()
Hi!! Im trying to sent data to and php with Ajax, so.. this is what im sending_url= table='historia'$'='$''$'string'$''; then i do: _url = _url.substring(0,_url.length-1) //quita el de sobra al final var ajax = nuevoAjax(); ajax.open(POST, atrapalo_x.php, true); ajax.setRequestHeader(Content-Type, aplication/x-www-form-urlencoded); ajax.send(_url); ajax.onreadystatechange = function() { if(ajax.readyState == 4) { alert(ajax.responseText) . . . .. and in the php i do: $datafield=explode($,str_replace(\',',$_POST[table])); $main_table=.str_replace(',,$datafield[0]).; $main_table=strtolower($main_table); but when i do and echo $datafield[0] or echo $main_table it returns nothing... just blank
Re: [PHP] URL modification
Per Jessen wrote: Daniel Brown wrote: On Fri, Feb 22, 2008 at 10:53 AM, Per Jessen [EMAIL PROTECTED] wrote: Nathan Rixham wrote: To use url's like http://domain.com/login/ as opposed to http://domain.com/login.php you can take multiple approaches. [big snip] Seriously, this is all overkill. Apache content negotiation does it all automagically and with minimal effort. Yes it does but the OP is using IIS. ;-P Oops, I missed that completely. Sorry. /Per Jessen, Zürich + rewrite is overkill for this, but long term it's worth implementing and getting used to - think of the post as a pre-emptive strike on the inevitable question in a couple of weeks: how can i make /profile/adam instead of profile.php?user=adam :) happy friday all -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Ajax send()
2008. 02. 22, péntek keltezéssel 12.03-kor germana ezt írta: Hi!! Im trying to sent data to and php with Ajax, so.. this is what im sending_url= table='historia'$'='$''$'string'$''; then i do: _url = _url.substring(0,_url.length-1) //quita el de sobra al final var ajax = nuevoAjax(); ajax.open(POST, atrapalo_x.php, true); ajax.setRequestHeader(Content-Type, aplication/x-www-form-urlencoded); ajax.send(_url); ajax.onreadystatechange = function() { if(ajax.readyState == 4) { alert(ajax.responseText) . . . .. and in the php i do: $datafield=explode($,str_replace(\',',$_POST[table])); $main_table=.str_replace(',,$datafield[0]).; $main_table=strtolower($main_table); but when i do and echo $datafield[0] or echo $main_table it returns nothing... just blank and if you var_dump($_POST) what does it show? greets Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL modification
+ rewrite is overkill for this, but long term it's worth implementing and getting used to - think of the post as a pre-emptive strike on the inevitable question in a couple of weeks: how can i make /profile/adam instead of profile.php?user=adam Have a directory in your htdocs called /profile/adam and in that place a default document redirecting. Still no need for mod_rewrite. Unless of course you want the url to remain in the addressbar, but personally I don't think that is as important as what the user has to type in initially. -- Richard Heyes http://www.phpguru.org Free PHP and Javascript code -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: temporary error
[snip] Is that irony? [/snip] no -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML encoding variable simpleXML on Linux
It is not that I want to generate the document in UTF-8. I just need to specify the correct encoding. My assumption that it was UTF-8 based on what my command line settings are is obviously incorrect. How can I tell what php is encoding in by default? Larry On Fri, 2008-02-22 at 17:20 +0100, Bojan Tesanovic wrote: encoding=UTF-8 doesn't guarantee that XML is encoded in UTF-8 its only purpose is to tell XML parser how to decode that XML document . it is responsibility of document creator to ensure that XML is proper UTF-8 document . on PHP side when creating XML there are number of functions to ensure UTF-8 strings though there are some issues in PHP5 , and one of the main features of upcoming PHP6 is to address UTF-8 Issues that current PHP has. some of UTF functions utf8_encode — Encodes an ISO-8859-1 string to UTF-8 string utf8_encode ( string $data ) On Feb 22, 2008, at 4:52 PM, Larry Brown wrote: I am using PHP on Linux to communicate with an XML peer. I pull and push documents from and to their server. On the console I use UTF-8 as far as I can tell. When I send these documents should my leading tag read: ?xml versionnn=1.0 encoding=UTF-8? or is the encoding done by PHP and how do I know what it is encoded to? TIA Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bojan Tesanovic http://www.classicio.com/ http://www.real-estates-sale.com/ -- Larry Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: temporary error
tedd wrote: At 4:08 PM +0100 2/21/08, Mirco Soderi wrote: In the original code there were no sintax errors, Ah crap -- they're taxing that now?! Cheers, tedd I never see errors in my sintax. Every tax on my beer, wine and cigars is calculated accurately every time and applied before purchase. -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] All Survey leading to PHP
At 10:48 AM -0500 2/22/08, Robert Cummings wrote: On Fri, 2008-02-22 at 09:57 -0500, tedd wrote: So, my advice -- write good code, pick up your check, and move one to the next client. Stop worrying about protecting your code and hope that you get good enough that someone wants to steal it. BAD IDEA BUSTER!!! Always backup your code so it's protected from crashes!! ;) Rob: Did you forget to take your meds this morning? I'm not talking about backup. :-) Hey.. there's a winkie there. I was just being funny. Cheers, Rob. Don't give up your day to do comedy. ;) 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] More than one values returned?
At 9:50 AM -0600 2/22/08, Greg Donald wrote: On 2/21/08, Nick Stinemates [EMAIL PROTECTED] wrote: -snip- for no importance I am indeed waiting, where's your code? When, and under what circumstances exactly, is getting back an array of objects from a function or method call poor design ? Please, do tell. This reminds me of when we first started adding 0's to our code. Before then, we just used 1's and surprisingly there were purist who claimed that using both was just poor design. We 10's (as we used to call ourselves) went on to digital stuff while the purist continued to build pyramids. Oddly enough, I don't see them around much anymore. 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] URL modification
Richard Heyes wrote: + rewrite is overkill for this, but long term it's worth implementing and getting used to - think of the post as a pre-emptive strike on the inevitable question in a couple of weeks: how can i make /profile/adam instead of profile.php?user=adam Have a directory in your htdocs called /profile/adam and in that place a default document redirecting. Still no need for mod_rewrite. Unless of course you want the url to remain in the addressbar, but personally I don't think that is as important as what the user has to type in initially. Never thought I'd have to find a way to explain the benefits of url re-writing. [snip] /profile/adam and in that place a default document redirecting. Still no need for mod_rewrite [/snip] Let's say we've got 2.5 million users :: weight up 2.5 million files vs 1 rewrite rule map: /rental/property/23425 to: /index.php?mod=propertysection=rentalspropertyid=23425 SEO :: not even going in to this one finally, do you honestly not use mod_rewrite in anything you've made? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL modification
Nathan Rixham wrote: + rewrite is overkill for this, but long term it's worth implementing and getting used to Completely agree. You've got to get to know url rewriting. I don't know how you can manage without it, even if it's far from always the right answer. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Date Function
Hi All, Greetings!! A small PHP Script for help ?php $date_format = '02/22/2008 14:00:00'; $start_date = date(Y-m-d h:i:s, strtotime($date_format)); echo $start_date; ? output is 2008-02-22 02:00:00 but not 2008-02-22 14:00:00 How can i get my output as 2008-02-22 14:00:00. Thanks V -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date Function
On Fri, Feb 22, 2008 at 2:48 PM, VamVan [EMAIL PROTECTED] wrote: Hi All, Greetings!! A small PHP Script for help ?php $date_format = '02/22/2008 14:00:00'; $start_date = date(Y-m-d h:i:s, strtotime($date_format)); echo $start_date; ? output is 2008-02-22 02:00:00 but not 2008-02-22 14:00:00 How can i get my output as 2008-02-22 14:00:00. Thanks V http://us3.php.net/date Change the 'h' in your format to a capital H. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date Function
2008. 02. 22, péntek keltezéssel 11.48-kor VamVan ezt írta: Hi All, Greetings!! A small PHP Script for help ?php $date_format = '02/22/2008 14:00:00'; $start_date = date(Y-m-d h:i:s, strtotime($date_format)); $start_date = date(Y-m-d H:i:s, strtotime($date_format)); RTFM: http://hu.php.net/date ;) greets Zoltán Németh echo $start_date; ? output is 2008-02-22 02:00:00 but not 2008-02-22 14:00:00 How can i get my output as 2008-02-22 14:00:00. Thanks V -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Ajax send()
please reply to the list also... 2008. 02. 22, péntek keltezéssel 15.25-kor germana ezt írta: nuevoAjax() is the name of the ajax object :P in spanish OK, but that does not tell me anything about what kind of ajax library you're using... anyway, maybe it's better to ask on an ajax list because this is clearly not a php problem greets Zoltán Németh On Fri, 2008-02-22 at 20:54 +0100, Zoltán Németh wrote: 2008. 02. 22, péntek keltezéssel 14.32-kor germana ezt írta: So... i was checking my localhost with wireshark (a sniffer) and i found that the DATA is send after the POST ¿¿¿ i dont understand why the data is not send completly. the problem must be in your ajax library... I don't know what kind of ajax scripts you use, I've never seen 'nuevoAjax' before, but its clearly a problem with your javascript, not php. correctly sent requests contain the post data, so $_POST is not empty if you send anything greets Zoltán Németh if i do var_dump($_POST) is: array(0){} On Fri, 2008-02-22 at 17:41 +0100, Zoltán Németh wrote: 2008. 02. 22, péntek keltezéssel 12.03-kor germana ezt írta: Hi!! Im trying to sent data to and php with Ajax, so.. this is what im sending_url= table='historia'$'='$''$'string'$''; then i do: _url = _url.substring(0,_url.length-1) //quita el de sobra al final var ajax = nuevoAjax(); ajax.open(POST, atrapalo_x.php, true); ajax.setRequestHeader(Content-Type, aplication/x-www-form-urlencoded); ajax.send(_url); ajax.onreadystatechange = function() { if(ajax.readyState == 4) { alert(ajax.responseText) . . . .. and in the php i do: $datafield=explode($,str_replace(\',',$_POST[table])); $main_table=.str_replace(',,$datafield[0]).; $main_table=strtolower($main_table); but when i do and echo $datafield[0] or echo $main_table it returns nothing... just blank and if you var_dump($_POST) what does it show? greets Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
On Fri, 2008-02-22 at 13:09 -0500, tedd wrote: At 9:50 AM -0600 2/22/08, Greg Donald wrote: On 2/21/08, Nick Stinemates [EMAIL PROTECTED] wrote: -snip- for no importance I am indeed waiting, where's your code? When, and under what circumstances exactly, is getting back an array of objects from a function or method call poor design ? Please, do tell. This reminds me of when we first started adding 0's to our code. Before then, we just used 1's and surprisingly there were purist who claimed that using both was just poor design. We 10's (as we used to call ourselves) went on to digital stuff while the purist continued to build pyramids. Oddly enough, I don't see them around much anymore. I for 1 think you're full of it :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
On Fri, Feb 22, 2008 at 3:05 PM, Robert Cummings [EMAIL PROTECTED] wrote: I for 1 think you're full of it :) Don't be a 0. ;-P -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: temporary error
[snip] no [/snip] yes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cross-Post: Installing on Palm Treo?
Hey, folks, I'm cross-posting on General and Install, and I'm wondering if anyone has yet attempted to install PHP (as well as Apache and MySQL, but PHP for now) on a Palm Treo. I'm considering picking up a 700wx tonight or tomorrow and finally switching over to Verizon. I was just wondering if anyone had tried the same, and if there was any success or stumbling blocks. Thanks. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP: Ajax send()
2008. 02. 22, péntek keltezéssel 14.32-kor germana ezt írta: So... i was checking my localhost with wireshark (a sniffer) and i found that the DATA is send after the POST ¿¿¿ i dont understand why the data is not send completly. the problem must be in your ajax library... I don't know what kind of ajax scripts you use, I've never seen 'nuevoAjax' before, but its clearly a problem with your javascript, not php. correctly sent requests contain the post data, so $_POST is not empty if you send anything greets Zoltán Németh if i do var_dump($_POST) is: array(0){} On Fri, 2008-02-22 at 17:41 +0100, Zoltán Németh wrote: 2008. 02. 22, péntek keltezéssel 12.03-kor germana ezt írta: Hi!! Im trying to sent data to and php with Ajax, so.. this is what im sending_url= table='historia'$'='$''$'string'$''; then i do: _url = _url.substring(0,_url.length-1) //quita el de sobra al final var ajax = nuevoAjax(); ajax.open(POST, atrapalo_x.php, true); ajax.setRequestHeader(Content-Type, aplication/x-www-form-urlencoded); ajax.send(_url); ajax.onreadystatechange = function() { if(ajax.readyState == 4) { alert(ajax.responseText) . . . .. and in the php i do: $datafield=explode($,str_replace(\',',$_POST[table])); $main_table=.str_replace(',,$datafield[0]).; $main_table=strtolower($main_table); but when i do and echo $datafield[0] or echo $main_table it returns nothing... just blank and if you var_dump($_POST) what does it show? greets Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
On Fri, 2008-02-22 at 15:11 -0500, Daniel Brown wrote: On Fri, Feb 22, 2008 at 3:05 PM, Robert Cummings [EMAIL PROTECTED] wrote: I for 1 think you're full of it :) Don't be a 0. ;-P I'm a 0 hero! :B Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: temporary error
On Fri, Feb 22, 2008 at 3:20 PM, Nathan Rixham [EMAIL PROTECTED] wrote: [snip] no [/snip] yes So help me God, if you two don't stop it, I'm going to come back there Don't make me turn this car around! ;-P -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RES: [PHP] Date Function
$start_date = date(Y-m-d H:i:s, strtotime($date_format)); echo $start_date; ? capital H should do it -Mensagem original- De: VamVan [mailto:[EMAIL PROTECTED] Enviada em: sexta-feira, 22 de fevereiro de 2008 16:48 Para: php-general@lists.php.net Assunto: [PHP] Date Function Hi All, Greetings!! A small PHP Script for help ?php $date_format = '02/22/2008 14:00:00'; $start_date = date(Y-m-d h:i:s, strtotime($date_format)); echo $start_date; ? output is 2008-02-22 02:00:00 but not 2008-02-22 14:00:00 How can i get my output as 2008-02-22 14:00:00. Thanks V -- 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] Date Function ][Resolved]
Thanks ALL who have replied On Fri, Feb 22, 2008 at 11:55 AM, Thiago Pojda [EMAIL PROTECTED] wrote: $start_date = date(Y-m-d H:i:s, strtotime($date_format)); echo $start_date; ? capital H should do it -Mensagem original- De: VamVan [mailto:[EMAIL PROTECTED] Enviada em: sexta-feira, 22 de fevereiro de 2008 16:48 Para: php-general@lists.php.net Assunto: [PHP] Date Function Hi All, Greetings!! A small PHP Script for help ?php $date_format = '02/22/2008 14:00:00'; $start_date = date(Y-m-d h:i:s, strtotime($date_format)); echo $start_date; ? output is 2008-02-22 02:00:00 but not 2008-02-22 14:00:00 How can i get my output as 2008-02-22 14:00:00. Thanks V -- 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] More than one values returned?
On Fri, Feb 22, 2008 at 3:27 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2008-02-22 at 15:11 -0500, Daniel Brown wrote: On Fri, Feb 22, 2008 at 3:05 PM, Robert Cummings [EMAIL PROTECTED] wrote: I for 1 think you're full of it :) Don't be a 0. ;-P I'm a 0 hero! :B And I'm an L7. J:-P -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
On Fri, 2008-02-22 at 15:29 -0500, Daniel Brown wrote: On Fri, Feb 22, 2008 at 3:27 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2008-02-22 at 15:11 -0500, Daniel Brown wrote: On Fri, Feb 22, 2008 at 3:05 PM, Robert Cummings [EMAIL PROTECTED] wrote: I for 1 think you're full of it :) Don't be a 0. ;-P I'm a 0 hero! :B And I'm an L7. With 0 percent success probability... once again 0 saves the day!! Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
On Fri, Feb 22, 2008 at 3:36 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2008-02-22 at 15:11 -0500, Daniel Brown wrote: And I'm an L7. With 0 percent success probability... once again 0 saves the day!! Ouch. You hit me right in the feel-bads. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
On Fri, 2008-02-22 at 15:36 -0500, Daniel Brown wrote: On Fri, Feb 22, 2008 at 3:36 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Fri, 2008-02-22 at 15:11 -0500, Daniel Brown wrote: And I'm an L7. With 0 percent success probability... once again 0 saves the day!! Ouch. You hit me right in the feel-bads. Is that the same as a very uncomfortable place? Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: temporary error
On 2/22/08, Daniel Brown [EMAIL PROTECTED] wrote: So help me God Speaking of imaginary things, check out this new site I built few weeks back: http://rewriteproject.com/ I do believe I am the first person to ever tag cloud a bible :) -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: temporary error
On Fri, 2008-02-22 at 14:49 -0600, Greg Donald wrote: On 2/22/08, Daniel Brown [EMAIL PROTECTED] wrote: So help me God Speaking of imaginary things, check out this new site I built few weeks back: http://rewriteproject.com/ I do believe I am the first person to ever tag cloud a bible :) That's pretty funny... but why rewrite a great fantasy? Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Posting Summary for Week Ending 22 February, 2008: php-general@lists.php.net
Posting Summary for PHP-General List Week Ending: Friday, 22 February, 2008 Messages| Bytes | Sender ++-- 536 (100%) 739991 (100%) EVERYONE 39 (7.3%) 47724 (6.4%) Richard Lynch ceo at l-i-e dot com 38 (7.1%) 32242 (4.4%) Daniel Brown parasane at gmail dot com 29 (5.4%) 34014 (4.6%) Shawn McKenzie nospam at mckenzies dot net 29 (5.4%) 60313 (8.2%) Nick Stinemates nick at stinemates dot org 26 (4.9%) 52919 (7.2%) Nathan Rixham nrixham at gmail dot com 24 (4.5%) 45637 (6.2%) Petrus Bastos petrusbastos at gmail dot com 24 (4.5%) 41976 (5.7%) Robert Cummings robert at interjinn dot com 20 (3.7%) 17507 (2.4%) tedd tedd dot sperling at gmail dot com 15 (2.8%) 13055 (1.8%) Chris dmagick at gmail dot com 11 (2.1%) 5627(0.8%) Greg Donald gdonald at gmail dot com 10 (1.9%) 9184(1.2%) Stut stuttle at gmail dot com 10 (1.9%) 25171 (3.4%) Jim Lucas lists at cmsws dot com 10 (1.9%) 25415 (3.4%) Andrés Robinet agrobinet at bestplace dot biz 9 (1.7%) 10959 (1.5%) Zoltán Németh znemeth at alterationx dot hu 9 (1.7%) 11768 (1.6%) Bastien Koert bastien_k at hotmail dot com 9 (1.7%) 11668 (1.6%) Andrew Ballard aballard at gmail dot com 9 (1.7%) 14142 (1.9%) Thiago Pojda thiago dot pojda at softpartech dot com dot br 8 (1.5%) 8525(1.2%) Wolf lonewolf at nc dot rr dot com 8 (1.5%) 3048(0.4%) Jay Blanchard jblanchard at pocket dot com 8 (1.5%) 5655(0.8%) Richard Heyes richardh at phpguru dot org 7 (1.3%) 10839 (1.5%) Graham Cossey graham dot cossey at gmail dot com 7 (1.3%) 12395 (1.7%) Nathan Nobbe quickshiftin at gmail dot com 7 (1.3%) 13602 (1.8%) Adil Drissi adil dot drissi at yahoo dot com 6 (1.1%) 11602 (1.6%) Jason Pruim japruim at raoset dot com 6 (1.1%) 3165(0.4%) Per Jessen per at computer dot org 6 (1.1%) 6638(0.9%) Paul Scott pscott at uwc dot ac dot za 6 (1.1%) 4732(0.6%) nihilism machine nihilismmachine at gmail dot com 5 (0.9%) 3007(0.4%) Mário Gamito gamito at gmail dot com 5 (0.9%) 5054(0.7%) Michal Maras maras dot michal at gmail dot com 5 (0.9%) 7435(1%)Casey heavyccasey at gmail dot com 5 (0.9%) 12945 (1.7%) Jochem Maas jochem at iamjochem dot com 4 (0.7%) 3199(0.4%) Børge Holen borge at arivene dot net 4 (0.7%) 5322(0.7%) Larry Garfield larry at garfieldtech dot com 4 (0.7%) 4772(0.6%) TS sunnrunner at gmail dot com 4 (0.7%) 8819(1.2%) Matty Sarro msarro at gmail dot com 3 (0.6%) 2213(0.3%) Valedol Valedol at goon dot ru 3 (0.6%) 1478(0.2%) Dan frozendice at gmail dot com 3 (0.6%) 6575(0.9%) Mirco Soderi m dot soderi at alice dot it 3 (0.6%) 2868(0.4%) Paul van Brouwershaven paul at vanbrouwershaven dot com 3 (0.6%) 1734(0.2%) Siegfried Gipp siegfried at rorkvell dot de 3 (0.6%) 1514(0.2%) Brady Mitchell mydarb at gmail dot com 2 (0.4%) 1418(0.2%) VamVan vamseevan at gmail dot com 2 (0.4%) 2853(0.4%) Børge Holen borge at arivene dot net 2 (0.4%) 1716(0.2%) admin at buskirkgraphics dot com 2 (0.4%) 1911(0.3%) Hamilton Turner hamiltont at gmail dot com 2 (0.4%) 4097(0.6%) Sylvain R dot sylvain at abstraction dot fr 2 (0.4%) 1497(0.2%) Mário Gamito gamito at gmail dot com 2 (0.4%) 2225(0.3%) Colin Guthrie gmane at colin dot guthr dot ie 2 (0.4%) 4597(0.6%) Allan Fernandes tech at ssmiths dot com 2 (0.4%) 3081(0.4%) Warren Vail warren at vailtech dot net 2 (0.4%) 10920 (1.5%) Michael McGlothlin michaelm at swplumb dot com 2 (0.4%) 1405(0.2%) julian correojulian33-php at yahoo dot es 2 (0.4%) 1177(0.2%) Christoph christoph dot boget at gmail dot com 2 (0.4%)
Re: [PHP] Re: temporary error
Greg Donald wrote: On 2/22/08, Daniel Brown [EMAIL PROTECTED] wrote: So help me God Speaking of imaginary things, check out this new site I built few weeks back: http://rewriteproject.com/ I do believe I am the first person to ever tag cloud a bible :) on that note, a few weeks back I made a short script that took peoples blog posts and swapped the most frequent phrase with a seperate phrase from google trends. the very first post generated by the system decided to use an extract of the bible [portion of genesis to be exact] and replace the word him with the phrase lindsay lohan's crotch and he said unto lindsay lohan's crotch, Behold, here am I first time a server made me laugh! 2nd was yesterday when reading man init at the foot it has see also bum - which meant i then had to bash man bum - sadly i didn't have it so had to think of a way to google man bum - after deciding that debian manual bum would be a good search, the first page i saw was a bug track saying that manual for bum is wrong because it reffers to bum as bum.in - this continued, I gave up. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] System errno in PHP
Hi, I also ran into the same issue with file and socket apis, and for now, I just hack it like ( for linux 2.6 systems ): class Errno { const EINTR= 4; const EIO = 5; const EINVAL = 22; const ENODATA = 61; const EBADMSG = 74; const EOPNOTSUPP = 95; const ECONNRESET = 104; const ENOTCONN = 107; const ETIMEDOUT= 110; const EALREADY = 114; const EINPROGRESS = 115; // useful static methods that use posix_strerror() // and socket_strerror() to return strings for logging purposes... . . } Clearly this is not portable, but I am betting that usually on the same kernel releases, they don't usually change these numbers around. Having PHP expose these useful constants in a portable manner would be a big plus. Thanks, Ravi On Thu, Feb 21, 2008 at 9:04 AM, Richard Lynch [EMAIL PROTECTED] wrote: On Wed, February 20, 2008 2:56 am, Michal Maras wrote: I have read http://php.net/fopen from top to bottom, but I could not find how to get system error number. With set_error_handler I can get string for example fopen(hmc_configuration.cfg) [function.fopenhttp://ds63450.mspr.detemobil.de/%7Emmaras/HMC/function.fopen]: failed to open stream: Permission denied but I need integer number not string, because string error messages depends on locale setting. Of course, I can test some conditions before fopen, but it is not enough for me. Put in a Feature Request to expose the error number from the OS, I guess... http://bugs.php.net/ It *seems* like it ought to be reasonable enough to this naive user. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- 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] More than one values returned?
i for one have mixed feelings on this issue. im tempted to agree w/ nick, but not entirely. my stance is this; implementing the iterator or related interfaces is transparent to client code; namely you can still use for each to traverse the collection. you also get to do things during the iteration, that would have to be done in client space otherwise. now, this isnt always appropriate, maybe not even most of the time, but this is handy in many occasions; here is such an example; http://propel.phpdb.org/docs/api/1.3/runtime/propel-util/CriterionIterator.html furthermore; i like the idea of a named group object; not to the point of absurdity; eg; implementing strings in php, rob; i get you point, but there are plenty of uses for an aggregate object within reason. what is the most trivial examples i can think of.. classes for a database table.. suppose you have 2 classes per table; one that represents a record, another that represents a group of records; which ideally is an iterator. it makes sense to me, and ill take it over an array of record objects in this case. because what is an array of the record objects; its data; an array like any other; its not an instance of a class that specifically represents a collection of said records; so in order to identify them; youll have to inspect the elements. and aggregate functions, how would you implement those? any ones specific to the collection would go in the group class of said hypothetical implementation. and btw; your narratives are are just damned hilarious rob ;) -nathan
Re: [PHP] APC __autoload webclusters
On Fri, Feb 22, 2008 at 8:25 AM, Jochem Maas [EMAIL PROTECTED] wrote: Nathan Nobbe schreef: On Thu, Feb 21, 2008 at 12:01 PM, Jochem Maas [EMAIL PROTECTED] wrote: Richard Lynch schreef: If it's that inter-tangled, then I would hazard a WILD GUESS that the __autoload will still end up loading everything... but not on every request ;-) ... I do use output caching, and I know not everything is actually used in every request. i think youre good to go w/ autoload not loading everything up, but what about existing include / require directives? if the code doesnt already use __autoload() its almost certainly strewn w/ these. so i think if you want the boost from __autoload, not loading up everything, youll at least have to strip these out. I know, I have ... I wrote the code in the first :-) I know - but it's a rubbish solution because it offer no control as to what is cleared from the APC cache, sometimes I want to clear opcodes, sometimes user-data, sometimes both ... graceful means being forced to clear everything. you can pass a parameter to apc_clear_cache() http://www.php.net/manual/en/function.apc-clear-cache.php that distinguishes what you want to clear; user data or cached opcode. obviously calling it from the cli will not clear the webserver user cache though. I know apc_clear_cache() ... the whole problem is doing it on multiple servers. your statement about not being able to do it from the CLI (which I know) is half correct AFAICT - you can't clear anything cached in APC via mod_php from the CLI ... which is my whole problem in a nutshell :-) One would think that there was something like this indeed - I cannot find it, but then there must be something ... I assume, for instance, that Yahoo!** occassionally see fit to clear APC caches on more than one machine and I doubt Rasmus sits there and opens a browser to run apc.php on each one ;-) i dont know how yahoo does it, but i do know a little about how facebook does it; they had 3 speakers at the dc php conference last year. i think you might find these slides helpful, (sorry for the ridiculuus url) http://www.google.com/url?sa=tct=rescd=1url=http%3A%2F%2Ftekrat.com%2Ftalks_files%2Fphpdc2007%2Fapc%40facebook.pdfei=tce9R9T4FqrszATeiZG6CAusg=AFQjCNF_1Ecm2cL1EINgRQG9k3fTEclzpAsig2=ifrJK545M2liBdXbRrHrIw thanks for that link - it gives me a few angles and ideas to work on! you can use capistrano to deploy the new files; but it may be more convenient to use php and http requests to update all the server caches; *just a thought*. I'm not using capistrano for file deployment (files are stored centrally on a GFS volume to which all servers have access) ... I am (will be) using capistrano in order to run commands symultaneously on all webservers ... one of which will have to be some kind of cache control mechanism, which is the case of apc will probably be a php script that hits apc.php on the local machines webserver (but I want to be able to run said php script on multiple machines at once, or at least without having to log in to every machine ... and I see no reason to duplicate the functionality of capistrano, I just write a php script to do the actual apc.php interaction on the local webserver that cap can call on each machine. there are optimizations that are possible as well, such as setting, apc.stat=0 and got that one set already. :-) using apc_compile_file() rather than clearing the entire cache, but these techniques add I read the facebook story about preloading the cache (using memory dumping/loading) in combination with apc_compile_file() ... which is cool but a little too much effort given the time/budget I have to complete this (my client doesn't have X billion to burn ... but funnily enough they do have a viable business model ... but that's another story ;-) complexity. it sounds like you just want to get a decent bumb w/o too much additional complexity, so i wouldnt recommend them here, but i thought id mention them in passing.. apart from writing some kind of management cli script to [remote] control the apc cache of each webserver I'm also going [to have to] incorporate memcache functionality into my current caching stuff - many thanks for that PDF link (I hadn't come accross it before in my searching, although I had discovered various other facebook+apc/memcache/caching related presentations) it's given me jsut enough code and ideas to hang myself with ... er I mean write a transparent memcache layer into my app :-) i assumed you had something pretty solid in place already; tossed the link out there, cause its about the only practical thing i know of (personally). it also sounds like youve got your hands on some projects a little bigger than mine; but just today, it looks like i might have my ticket into the big leagues; so hopefully sometime soon i wont be
Re: [PHP] More than one values returned?
Robert Cummings wrote: On Fri, 2008-02-22 at 15:11 -0500, Daniel Brown wrote: On Fri, Feb 22, 2008 at 3:05 PM, Robert Cummings [EMAIL PROTECTED] wrote: I for 1 think you're full of it :) Don't be a 0. ;-P I'm a 0 hero! :B Cheers, Rob. My daughter called me her Zero Hero when she got home from school one day. :) -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML encoding variable simpleXML on Linux
Larry Brown wrote: It is not that I want to generate the document in UTF-8. I just need to specify the correct encoding. My assumption that it was UTF-8 based on what my command line settings are is obviously incorrect. How can I tell what php is encoding in by default? Larry On Fri, 2008-02-22 at 17:20 +0100, Bojan Tesanovic wrote: encoding=UTF-8 doesn't guarantee that XML is encoded in UTF-8 its only purpose is to tell XML parser how to decode that XML document . it is responsibility of document creator to ensure that XML is proper UTF-8 document . on PHP side when creating XML there are number of functions to ensure UTF-8 strings though there are some issues in PHP5 , and one of the main features of upcoming PHP6 is to address UTF-8 Issues that current PHP has. some of UTF functions utf8_encode — Encodes an ISO-8859-1 string to UTF-8 string utf8_encode ( string $data ) On Feb 22, 2008, at 4:52 PM, Larry Brown wrote: I am using PHP on Linux to communicate with an XML peer. I pull and push documents from and to their server. On the console I use UTF-8 as far as I can tell. When I send these documents should my leading tag read: ?xml versionnn=1.0 encoding=UTF-8? or is the encoding done by PHP and how do I know what it is encoded to? TIA Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bojan Tesanovic http://www.classicio.com/ http://www.real-estates-sale.com/ simple xml uses the dom api [*i think*] - the dom api only works in utf-8 - thus your content should be utf-8 if it was created by php. really quick way to check is to stick a £ [GBP] sign in the xml, open it up in a browser, check the £ sign shows correctly and check the encoding settings [firefox: view charector encoding]. quite sure you could also if($xml === utf8_encode(utf8_decode($xml))) { #its utf-8 } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
On Fri, 2008-02-22 at 17:04 -0500, Nathan Nobbe wrote: i for one have mixed feelings on this issue. im tempted to agree w/ nick, but not entirely. my stance is this; implementing the iterator or related interfaces is transparent to client code; namely you can still use for each to traverse the collection. you also get to do things during the iteration, that would have to be done in client space otherwise. now, this isnt always appropriate, maybe not even most of the time, but this is handy in many occasions; here is such an example; http://propel.phpdb.org/docs/api/1.3/runtime/propel-util/CriterionIterator.html furthermore; i like the idea of a named group object; not to the point of absurdity; eg; implementing strings in php, rob; i get you point, but there are plenty of uses for an aggregate object within reason. I wholeheartedly agree that there are plenty of uses for aggregate objects, collections even. The argument though, is whether using arrays is poor design. I'll leave it at this since I don't disagree with the whole tenet of collections or grouping objects etc. I only disagree with the assertion about arrays. and btw; your narratives are are just damned hilarious rob ;) Take that Ted... I'm quitting my day job!! :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Posting Summary for Week Ending 22 February, 2008:
NOTE: Numbers may not add up to 100% due to M$ 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] More than one values returned?
At 5:27 PM -0500 2/22/08, Robert Cummings wrote: On Fri, 2008-02-22 at 17:04 -0500, Nathan Nobbe wrote: and btw; your narratives are are just damned hilarious rob ;) Take that Ted... I'm quitting my day job!! :) Cheers, Rob. Robb: -- note the addition of an extra 'b' for my loss of a 'd' He said your narratives, not your jokes. ;) Besides, if you gave up programming and took up comedy, both professions would suffer. How's that for a backhanded compliment? :-) 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] More than one values returned?
On Fri, Feb 22, 2008 at 6:13 PM, tedd [EMAIL PROTECTED] wrote: At 5:27 PM -0500 2/22/08, Robert Cummings wrote: On Fri, 2008-02-22 at 17:04 -0500, Nathan Nobbe wrote: and btw; your narratives are are just damned hilarious rob ;) Take that Ted... I'm quitting my day job!! :) Cheers, Rob. Robb: -- note the addition of an extra 'b' for my loss of a 'd' He said your narratives, not your jokes. ;) Besides, if you gave up programming and took up comedy, both professions would suffer. How's that for a backhanded compliment? :-) there you go; on php-general, among other things; you get to work on your wit as well :D im way behind, but im ready to soak up the insults to sharpen it up; put me in coach, i can really fly :) -nathan
Re: [PHP] Re: temporary error
At 3:58 PM -0500 2/22/08, Robert Cummings wrote: On Fri, 2008-02-22 at 14:49 -0600, Greg Donald wrote: On 2/22/08, Daniel Brown [EMAIL PROTECTED] wrote: So help me God Speaking of imaginary things, check out this new site I built few weeks back: http://rewriteproject.com/ I do believe I am the first person to ever tag cloud a bible :) That's pretty funny... but why rewrite a great fantasy? Not meaning to start a religious debate or what's real and what isn't with regard to the Bible, but the other day I was thinking about proof for God's existence. Shouldn't the reason why we ask if be sufficient proof that it is? Take the other side of that coin -- if God didn't exist, would we be asking? I imagine there are a great number of things that don't exist that we never mention -- so why this one? All rhetorical comments -- no need to reply. We all have different beliefs -- whatever gets you through. Just offered as food for thought. 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] redirect stdout to stderr
How can I implement in PHP, a script which redirects stdout to stderr, such that echo, etc. print to stderr instead of stdout? I can redirect stdout to stderr when invoking PHP like so: php script-name 2 However I want to perform this redirection within the script itself. The solution I currently use is output buffering: ob_start(); // Call library code fwrite(STDERR, ob_get_contents()); ob_end_clean(); However I wonder if there's a more efficient way, so that output appears on stderr immediately, rather than waiting for fwrite(STDERR, ob_get_contents()); My reason for wanting this is to create a Subversion pre-commit hook using PHP_CodeSniffer: http://pear.php.net/package/PHP_CodeSniffer I want: 1) Commits to our Subversion repository to be checked against our coding standard with PHP_CodeSniffer 2) Commits to fail when PHP_CodeSniffer returns an error 3) PHP_CodeSniffer's report to be displayed to the Subversion user, so they can fix any problems I achieved 1) and 2), but PHP_CodeSniffer prints its report to stdout and Subversion only displays stderr to the user, not stdout. So to make this pre-commit hook fool proof, I want it to redirect PHP_CodeSniffer's report to stderr. Anyone have better suggestions than output buffering? Much thanks, Jack signature.asc Description: This is a digitally signed message part
Re: [PHP] Re: temporary error
tedd wrote: At 3:58 PM -0500 2/22/08, Robert Cummings wrote: On Fri, 2008-02-22 at 14:49 -0600, Greg Donald wrote: On 2/22/08, Daniel Brown [EMAIL PROTECTED] wrote: So help me God Speaking of imaginary things, check out this new site I built few weeks back: http://rewriteproject.com/ I do believe I am the first person to ever tag cloud a bible :) That's pretty funny... but why rewrite a great fantasy? Not meaning to start a religious debate or what's real and what isn't with regard to the Bible, but the other day I was thinking about proof for God's existence. Shouldn't the reason why we ask if be sufficient proof that it is? Take the other side of that coin -- if God didn't exist, would we be asking? I imagine there are a great number of things that don't exist that we never mention -- so why this one? All rhetorical comments -- no need to reply. We all have different beliefs -- whatever gets you through. Just offered as food for thought. Cheers, tedd Going to reply anyways.. I think grass is proof, as in blades of grass - there are billions per square foot, and they are all grass, not half baked weird grass/*something else* mixes, but all grass - to me thats proof of creation, and therefore proof of a creator, thus god. god's like wind, can't see it but it still blows your bin over so you know it's there. shoulda posted on php-religion *shrugs* -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] redirect stdout to stderr
Hi Jack, here is a link that can be of help http://bugs.php.net/bug.php?id=22839 also you can use custom error handler function , catch errors and write to stderr function myErrorHandler($errno, $errstr, $errfile, $errline) { $ERROR=''; switch ($errno) { case E_USER_ERROR: $ERROR = bMy ERROR/b [$errno] $errstrbr /\n; $ERROR.= Fatal error on line $errline in file $errfile; $ERROR.= , PHP . PHP_VERSION . ( . PHP_OS . )br /\n; $ERROR.= Aborting...br /\n; break; case E_USER_WARNING: $ERROR= bMy WARNING/b [$errno] $errstrbr /\n; break; case E_USER_NOTICE: $ERROR= bMy NOTICE/b [$errno] $errstrbr /\n; break; default: $ERROR = echo Unknown error type: [$errno] $errstrbr /\n; break; } if($ERROR){ $stderr = fopen('php://stderr', 'w'); fwrite($stderr, $ERROR ); fclose($stderr); } /* Don't execute PHP internal error handler */ return true; } set_error_handler(myErrorHandler); //code . == I guess you can achieve what you need by one of those 2 concepts Cheers. On Feb 23, 2008, at 1:04 AM, Jack Bates wrote: How can I implement in PHP, a script which redirects stdout to stderr, such that echo, etc. print to stderr instead of stdout? I can redirect stdout to stderr when invoking PHP like so: php script-name 2 However I want to perform this redirection within the script itself. The solution I currently use is output buffering: ob_start(); // Call library code fwrite(STDERR, ob_get_contents()); ob_end_clean(); However I wonder if there's a more efficient way, so that output appears on stderr immediately, rather than waiting for fwrite(STDERR, ob_get_contents()); My reason for wanting this is to create a Subversion pre-commit hook using PHP_CodeSniffer: http://pear.php.net/package/PHP_CodeSniffer I want: 1) Commits to our Subversion repository to be checked against our coding standard with PHP_CodeSniffer 2) Commits to fail when PHP_CodeSniffer returns an error 3) PHP_CodeSniffer's report to be displayed to the Subversion user, so they can fix any problems I achieved 1) and 2), but PHP_CodeSniffer prints its report to stdout and Subversion only displays stderr to the user, not stdout. So to make this pre-commit hook fool proof, I want it to redirect PHP_CodeSniffer's report to stderr. Anyone have better suggestions than output buffering? Much thanks, Jack Bojan Tesanovic http://www.classicio.com/ http://www.carster.us/
RE: [PHP] Re: temporary error
To: php-general@lists.php.net Date: Sat, 23 Feb 2008 00:14:27 + From: [EMAIL PROTECTED] Subject: Re: [PHP] Re: temporary error tedd wrote: At 3:58 PM -0500 2/22/08, Robert Cummings wrote: On Fri, 2008-02-22 at 14:49 -0600, Greg Donald wrote: On 2/22/08, Daniel Brown wrote: So help me God Speaking of imaginary things, check out this new site I built few weeks back: http://rewriteproject.com/ I do believe I am the first person to ever tag cloud a bible :) That's pretty funny... but why rewrite a great fantasy? Not meaning to start a religious debate or what's real and what isn't with regard to the Bible, but the other day I was thinking about proof for God's existence. Shouldn't the reason why we ask if be sufficient proof that it is? Take the other side of that coin -- if God didn't exist, would we be asking? I imagine there are a great number of things that don't exist that we never mention -- so why this one? All rhetorical comments -- no need to reply. We all have different beliefs -- whatever gets you through. Just offered as food for thought. Cheers, tedd Going to reply anyways.. I think grass is proof, as in blades of grass - there are billions per square foot, and they are all grass, not half baked weird grass/*something else* mixes, but all grass - to me thats proof of creation, and therefore proof of a creator, thus god. god's like wind, can't see it but it still blows your bin over so you know it's there. shoulda posted on php-religion *shrugs* -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I think the existance of god is more like the MS interoperability proposals...everyone talks about it, but no one has any real proof ;-) bastien _ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Ignoring user cancel
Hello, I have a php process running on lighty that should continue even if the user presses cancel in his browser. The default behavior is that the web-server will kill the cgi process on user cancellation. Is there some way I can prevent the user cancel from interfering with the php process. Can I ignore the web-server's kill in php or is this a configuration that should be handled at the web-server? Any help is greatly appreciated. Thanks a lot in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Ignoring user cancel
On Feb 22, 2008, at 6:19 PM, K T Ligesh [EMAIL PROTECTED] wrote: Hello, I have a php process running on lighty that should continue even if the user presses cancel in his browser. The default behavior is that the web-server will kill the cgi process on user cancellation. Is there some way I can prevent the user cancel from interfering with the php process. Can I ignore the web-server's kill in php or is this a configuration that should be handled at the web-server? Any help is greatly appreciated. Thanks a lot in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ignore_user_abort(true); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Shopping Carts
Oh my gosh! I¹m scared to death to create a shopping, but was recently referred to some free shopping cart software. Though I am trying to learn code on my own ( X-HTML, HTML, CSS, PHP, etc.) I¹m not yet very good and am extremely nervous (originally became acquainted with PHP from a designers perspectiveThanks David Powers. I have one page on my website). I have a potential client and he needs a shopping cart. I¹m thinking about installing Zen-Cart. Is this a good idea? Does this mean that I should also download XAMPP for Mac OS X? My system is OS 10.4.11. (I haven¹t yet installed MySQL and I think the version of PHP that I installed last year needs to be updated.) I know someone is going to bite my head off for seeking the above information, but I don¹t know where else to start. I don¹t think I can learn enough PHP and MySQL in one week on my own. I don¹t want to lose this client. Kista -- Independent Artist Kista Tucker Dance http://kistatucker.com [EMAIL PROTECTED] Anakeko Productions http://anakeko.com [EMAIL PROTECTED]
[PHP] Re: Ignoring user cancel
Yes, that was what I was looking for. Searching google for 'php ignore user interrupt', got me links on CPU interrupt management. Thanks again. On Fri, Feb 22, 2008 at 05:56:45PM -0800, Casey wrote: ignore_user_abort(true); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shopping Carts
Hi, i have a problem with my animated web flash menu (+images+sounds). basically my menu in embedded into flash, and each time that i click on menu link, my flash is playing from start as it is integrated into each PHP pages. I know that this is not the topic of this forum, but i would like to know how you cope with such issue from PHP point of view ? i mean, did you play the flash menu on first page (like index.php e.g.) and after you have another menu, or do you use it through your complete website ? basically i found a lot of flash templates but nothing about PHP pages menu integration. I guess several of you have already done it so i need just your feedback on possible solutions. thanks a lot. -- Alain Windows XP SP2 PostgreSQL 8.2.4 / MS SQL server 2005 Apache 2.2.4 PHP 5.2.4 C# 2005-2008