php-general Digest 12 May 2010 16:09:15 -0000 Issue 6740
php-general Digest 12 May 2010 16:09:15 - Issue 6740 Topics (messages 305109 through 305128): Re: PHP Application Structre 305109 by: Kevin Kinsey 305111 by: Peter Lind 305124 by: Paul M Foster 305125 by: Kevin Kinsey 305126 by: Peter Lind 305127 by: Peter Lind Re: 2D barcodes 305110 by: Manuel Lemos Re: PHP Encoder like IonCube 305112 by: Pete Ford 305114 by: Pete Ford 305115 by: shiplu 305116 by: Peter Lind 305118 by: Pete Ford 305120 by: shiplu 305122 by: Peter Lind Re: regexp questions 305113 by: Ford, Mike 305128 by: Spud. Ivan. Re: __call and recursion 305117 by: Richard Quadling 305119 by: Lawrance Shepstone Generating PHP from WSDL 305121 by: Gary . 305123 by: Richard Quadling Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Ashley Sheridan wrote: On Tue, 2010-05-11 at 08:48 +0530, chetan rane wrote: Hi all, mod rewrite was actually inrduced to have search engne frendly urls. hnce if you want a seo site then you have to use options 1 2. using smarty or any templating engine for readibility is not total true. one of the major advantages of using template engines is caching I've read some {disparaging?) comments on option 2, but I've got a question, or point, about that. I'm not at all sure that you have to use mod_rewrite at all, can't you just use a FORCETYPE directive on your handler script(s)? I've certainly got some work in the form: somesite.com/scriptname/var1/var2/var3 that seems to work well with no use of the rewrite module. Aside from the fact that I've yet to find any actual evidence that search engines treat what most people consider 'search engine friendly' urls any different from the 'unfriendly dynamic' ones. Next time you search for something online have a look at the URLs and see how many belong to forums with dynamic URLs. More than you'd think I would imagine, but it does go a long way to prove that most search engines don't give much credence to the URL these days. Of course, it does help if your keywords are in the URL, but I've not noticed much of a difference between: somesite.com/page-about-subject and somesite.com/?page=page-about-subject I think that this may be an artifact of an earlier time. There was a time when SE's didn't do so well with query strings, but it'd be a little silly to think their owners didn't realize this and left things exactly the way they were back in 2002 ... wouldn't it? My $0.02, Kevin Kinsey ---End Message--- ---BeginMessage--- On 12 May 2010 07:10, Kevin Kinsey k...@daleco.biz wrote: Ashley Sheridan wrote: On Tue, 2010-05-11 at 08:48 +0530, chetan rane wrote: Hi all, mod rewrite was actually inrduced to have search engne frendly urls. hnce if you want a seo site then you have to use options 1 2. using smarty or any templating engine for readibility is not total true. one of the major advantages of using template engines is caching I've read some {disparaging?) comments on option 2, but I've got a question, or point, about that. I'm not at all sure that you have to use mod_rewrite at all, can't you just use a FORCETYPE directive on your handler script(s)? I've certainly got some work in the form: somesite.com/scriptname/var1/var2/var3 that seems to work well with no use of the rewrite module. And why wouldn't you want to use mod_rewrite? It's an extremely powerful tool that does the job really well. Regards Peter -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 /hype ---End Message--- ---BeginMessage--- On Wed, May 12, 2010 at 10:16:04AM +0200, Peter Lind wrote: On 12 May 2010 07:10, Kevin Kinsey k...@daleco.biz wrote: Ashley Sheridan wrote: On Tue, 2010-05-11 at 08:48 +0530, chetan rane wrote: Hi all, mod rewrite was actually inrduced to have search engne frendly urls. hnce if you want a seo site then you have to use options 1 2. using smarty or any templating engine for readibility is not total true. one of the major advantages of using template engines is caching I've read some {disparaging?) comments on option 2, but I've got a question, or point, about that. I'm not at all sure that you have to use mod_rewrite at all, can't you just use a FORCETYPE directive on your handler script(s)? I've certainly got some work in the form: somesite.com/scriptname/var1/var2/var3 that seems to work well with no use of the rewrite module. And why wouldn't you
[PHP] Re: 2D barcodes
Hello, on 05/11/2010 07:45 PM Brian Dunning said the following: I have a project where I need to add some 2D barcodes onto some PDF files. I plan to use fpdi, since I've used it before and am familiar with it, but I need a source to generate the 2D barcodes, preferably as a png or jpg. Anyone have a suggestion - either a local classfile or a reliable web service? Free is preferred. :-) Do you mean QRCode? If so, you may want to take a look at this class: http://www.phpclasses.org/package/6092-PHP-Generate-QRCode-images-using-Kaywa-com-site.html -- Regards, Manuel Lemos Find and post PHP jobs http://www.phpclasses.org/jobs/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Application Structre
On 12 May 2010 07:10, Kevin Kinsey k...@daleco.biz wrote: Ashley Sheridan wrote: On Tue, 2010-05-11 at 08:48 +0530, chetan rane wrote: Hi all, mod rewrite was actually inrduced to have search engne frendly urls. hnce if you want a seo site then you have to use options 1 2. using smarty or any templating engine for readibility is not total true. one of the major advantages of using template engines is caching I've read some {disparaging?) comments on option 2, but I've got a question, or point, about that. I'm not at all sure that you have to use mod_rewrite at all, can't you just use a FORCETYPE directive on your handler script(s)? I've certainly got some work in the form: somesite.com/scriptname/var1/var2/var3 that seems to work well with no use of the rewrite module. And why wouldn't you want to use mod_rewrite? It's an extremely powerful tool that does the job really well. Regards Peter -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 /hype -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Encoder like IonCube
On 12/05/10 01:06, Ashley Sheridan wrote: On Tue, 2010-05-11 at 16:50 -0700, Brian Dunning wrote: Hi Shiplu - I also have a product with similar requirements. I searched a LOT and was never able to find a free solution that I was satisfied with. Even a lot of the commercial solutions required some server-side runtime EXE or something be installed, and my customers are not tech savvy enough to get that going. I ultimately settled on PHP Lockit, which is $29. It's a Windows program that you run to create an obfuscated version of your script. I'm very satisfied with the obfuscation, and it does not require any external runtime files or anything. Works like a charm, and I recommend it. http://phplockit.com/ - Brian On May 9, 2010, at 1:36 PM, shiplu wrote: Is there any php encoder like IonCube ? Looking for an opensource solution. My main target is to deliver encoded php codes so that it can not be re-engineered. Does slightly limit you to the Windows platform though, which I always think is a shame when using a language as open as PHP. Thanks, Ash http://www.ashleysheridan.co.uk Maybe it'll run under Wine? I might just try that with a demo version... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] regexp questions
-Original Message- From: Spud. Ivan. [mailto:spudm...@hotmail.com] Sent: 11 May 2010 15:56 To: php-general@lists.php.net Subject: RE: [PHP] regexp questions hehe, but I can't find anything related to regexp. I've found something at http://php.net/preg_match Changelog Try searching for pcre: Version 5.3.2 Upgraded bundled PCRE to version 8.00. Version 5.3.0 Upgraded bundled PCRE to version 7.9. Version 5.2.13 Upgraded bundled PCRE to version 7.9. Version 5.2.9 Fixed bug #44336 (Improve pcre UTF-8 string matching performance). Version 5.2.7 Upgraded PCRE to version 7.8 Version 5.2.6 Upgraded PCRE to version 7.6 Version 5.2.5 Upgraded PCRE to version 7.3 Version 5.2.4 Upgraded PCRE to version 7.2 Version 5.2.2 Upgraded PCRE to version 7.0 Version 5.2.0 Updated PCRE to version 6.7 ... so it looks like between PHP 5.1 and 5.3.2 you have at least 2 major version upgrades of the PCRE library, so the previously referenced http://www.pcre.org/changelog.txt is more than likely what you need to be looking at. Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Leeds Metropolitan University, C507, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Encoder like IonCube
On 12/05/10 10:48, Pete Ford wrote: On 12/05/10 01:06, Ashley Sheridan wrote: On Tue, 2010-05-11 at 16:50 -0700, Brian Dunning wrote: Hi Shiplu - I also have a product with similar requirements. I searched a LOT and was never able to find a free solution that I was satisfied with. Even a lot of the commercial solutions required some server-side runtime EXE or something be installed, and my customers are not tech savvy enough to get that going. I ultimately settled on PHP Lockit, which is $29. It's a Windows program that you run to create an obfuscated version of your script. I'm very satisfied with the obfuscation, and it does not require any external runtime files or anything. Works like a charm, and I recommend it. http://phplockit.com/ - Brian On May 9, 2010, at 1:36 PM, shiplu wrote: Is there any php encoder like IonCube ? Looking for an opensource solution. My main target is to deliver encoded php codes so that it can not be re-engineered. Does slightly limit you to the Windows platform though, which I always think is a shame when using a language as open as PHP. Thanks, Ash http://www.ashleysheridan.co.uk Maybe it'll run under Wine? I might just try that with a demo version... Looks like it works fine under Wine, at least the demo does... -- Peter Ford, Developer phone: 01580 89 fax: 01580 893399 Justcroft International Ltd. www.justcroft.com Justcroft House, High Street, Staplehurst, Kent TN12 0AH United Kingdom Registered in England and Wales: 2297906 Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Encoder like IonCube
Can you paste a sample encoded version of a php file on pastie.org? Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Encoder like IonCube
Output looks pretty typical for something encrypted/obfuscated. As the script will run, it needs to unpack itself ... so you can write automated unpackers for this kind of thing if you want. Best go with Phpsters advice of the contract, you'd be a lot better off (assuming the court system works). On 12 May 2010 12:23, shiplu shiplu@gmail.com wrote: Can you paste a sample encoded version of a php file on pastie.org? Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 /hype -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] __call and recursion
On 9 May 2010 22:21, Daniel Kolbo kolb0...@umn.edu wrote: Hello, I've defined a __call() method inside a class. Within the __call() method (after testing that the method exists and is callable I am using: call_user_func_array(array($this,$method), $args); However, this seems to be an infinite loop (and is crashing my test apache server). How, could I still use the __call() method and avoid an infinite loop of calling? Thanks, dK __call() is receiving $method. Do you alter $method in any way? If not, calling call_user_func(array($this, $method), $args) will simply call the non-existent function. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Encoder like IonCube
On 12/05/10 11:23, shiplu wrote: Can you paste a sample encoded version of a php file on pastie.org? Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) OK, I just did the phpPgAdmin index.php page (just something public-domain I had lying around): Here's the original: http://www.pastie.org/pastes/956801 and here's the encoded: http://www.pastie.org/pastes/956803 I haven't yet checked that the encoded version works! -- Peter Ford, Developer phone: 01580 89 fax: 01580 893399 Justcroft International Ltd. www.justcroft.com Justcroft House, High Street, Staplehurst, Kent TN12 0AH United Kingdom Registered in England and Wales: 2297906 Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] __call and recursion
Hi Daniel, Could you please tell us what version of PHP and OS you're using. The following code fragment runs as expected on my PHP 5.3.2/Windows/XP/32bit: ?php header('Content-Type: text/plain'); class A { private function method_a( $argument ) { echo('private method_a(\'' . $argument . '\') ...' . PHP_EOL ); } public function __call( $method, $arguments ) { if( method_exists( $this, $method ) is_callable( array( $this, $method ) ) ) { call_user_func_array( array( $this, $method ), $arguments ); } else { echo('method \'' . $method . '\' either does not exist, or is not callable ...' . PHP_EOL ); } } } $a = new A(); $a-method_a('argument'); $a-method_b('argument'); ? Results in: private method_a('argument') called ... method 'method_b' either does not exist, or is not callable ... Perhaps if you provided some code we could spot the problem. I would guess there's something fishy in your __call() method. Best of luck, Lawrance -Original Message- From: Richard Quadling [mailto:rquadl...@googlemail.com] Sent: 12 May 2010 12:28 PM To: Daniel Kolbo Cc: PHP General Subject: Re: [PHP] __call and recursion On 9 May 2010 22:21, Daniel Kolbo kolb0...@umn.edu wrote: Hello, I've defined a __call() method inside a class. Within the __call() method (after testing that the method exists and is callable I am using: call_user_func_array(array($this,$method), $args); However, this seems to be an infinite loop (and is crashing my test apache server). How, could I still use the __call() method and avoid an infinite loop of calling? Thanks, dK __call() is receiving $method. Do you alter $method in any way? If not, calling call_user_func(array($this, $method), $args) will simply call the non-existent function. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- 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] PHP Encoder like IonCube
It just obfuscates. Long ago I created a decoder for this type of encoder. Every day I got 100s of decoding requests. After changing my domain and hosting company I didn't upload it yet. I think bcompiler is better. Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Generating PHP from WSDL
Let's if anyone can come up with a non-brittle solution to this. In order to create the framework code for a webservice client I have generated it from the server's wsdl. Unfortunately the wsdl (which is out of my control) tries to use extension base=... to say that 'B' extends/inherits from 'A', and the tool I use doesn't understand it, with the result that the generated code doesn't include that relatonship, and so sending a 'B' to the webservice doesn't work because it doesn't also include the expected properties of 'A'. Possible solutions I have thought of are: * create 'C', inheriting from 'A' and 'B' and send one of those instead, but of course php doesn't support multiple-inheritance; * manually change 'B' so that it does inherit from 'A'. I don't like this because if the wsdl changes then that client-side code needs to again be changed manually. * use composition instead. Doesn't seem it will work because the marshalling of the objects seems to want to use the properties directly (i.e. instead of using getters as it should do). Does anyone have any other ideas? Are there any generators out there that handle something like: s:complexType name=B s:complexContent mixed=false s:extension base=tns:A ... /s:complexType and produce nusoap client code? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Encoder like IonCube
On 12 May 2010 12:50, shiplu shiplu@gmail.com wrote: It just obfuscates. Long ago I created a decoder for this type of encoder. Every day I got 100s of decoding requests. After changing my domain and hosting company I didn't upload it yet. You of all people should know the futility in what you're asking then. Regards Peter -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 /hype -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Generating PHP from WSDL
On 12 May 2010 11:53, Gary . php-gene...@garydjones.name wrote: Let's if anyone can come up with a non-brittle solution to this. In order to create the framework code for a webservice client I have generated it from the server's wsdl. Unfortunately the wsdl (which is out of my control) tries to use extension base=... to say that 'B' extends/inherits from 'A', and the tool I use doesn't understand it, with the result that the generated code doesn't include that relatonship, and so sending a 'B' to the webservice doesn't work because it doesn't also include the expected properties of 'A'. Possible solutions I have thought of are: * create 'C', inheriting from 'A' and 'B' and send one of those instead, but of course php doesn't support multiple-inheritance; * manually change 'B' so that it does inherit from 'A'. I don't like this because if the wsdl changes then that client-side code needs to again be changed manually. * use composition instead. Doesn't seem it will work because the marshalling of the objects seems to want to use the properties directly (i.e. instead of using getters as it should do). Does anyone have any other ideas? Are there any generators out there that handle something like: s:complexType name=B s:complexContent mixed=false s:extension base=tns:A ... /s:complexType and produce nusoap client code? Can you provide a URL for the wsdl file please? -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Application Structre
On Wed, May 12, 2010 at 10:16:04AM +0200, Peter Lind wrote: On 12 May 2010 07:10, Kevin Kinsey k...@daleco.biz wrote: Ashley Sheridan wrote: On Tue, 2010-05-11 at 08:48 +0530, chetan rane wrote: Hi all, mod rewrite was actually inrduced to have search engne frendly urls. hnce if you want a seo site then you have to use options 1 2. using smarty or any templating engine for readibility is not total true. one of the major advantages of using template engines is caching I've read some {disparaging?) comments on option 2, but I've got a question, or point, about that. I'm not at all sure that you have to use mod_rewrite at all, can't you just use a FORCETYPE directive on your handler script(s)? I've certainly got some work in the form: somesite.com/scriptname/var1/var2/var3 that seems to work well with no use of the rewrite module. And why wouldn't you want to use mod_rewrite? It's an extremely powerful tool that does the job really well. Because your public internet server disables its use. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Application Structre
Peter Lind wrote: On 12 May 2010 07:10, Kevin Kinsey k...@daleco.biz wrote: Ashley Sheridan wrote: On Tue, 2010-05-11 at 08:48 +0530, chetan rane wrote: Hi all, mod rewrite was actually inrduced to have search engne frendly urls. hnce if you want a seo site then you have to use options 1 2. using smarty or any templating engine for readibility is not total true. one of the major advantages of using template engines is caching I've read some {disparaging?) comments on option 2, but I've got a question, or point, about that. I'm not at all sure that you have to use mod_rewrite at all, can't you just use a FORCETYPE directive on your handler script(s)? I've certainly got some work in the form: somesite.com/scriptname/var1/var2/var3 that seems to work well with no use of the rewrite module. And why wouldn't you want to use mod_rewrite? It's an extremely powerful tool that does the job really well. Well, again, I'm not purporting to be an authority, but the first thing that comes to mind is that my reasoning would be much the same as my reasoning in building stuff: I've got a nice STIHL chainsaw, but I don't need it to cut two-by-fours, and I've got access to a Hole Hawg but don't need it to make a path for a CAT5 cable. I guess you could call the concept avoiding overkill, but I'm not cognizant enough with the inner workings of Apache to know really how much of a hit the rewrite module makes. I suppose, in terms of computing, it's kind of similar to a Unix philosophy: small tools that do one job without extra fluff. KDK -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Application Structre
On 12 May 2010 17:07, Paul M Foster pa...@quillandmouse.com wrote: Because your public internet server disables its use. And once more I'm reminded of just how happy I am with my VPS and my dedicated server. Regards Peter -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 /hype -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Application Structre
On 12 May 2010 17:17, Kevin Kinsey k...@daleco.biz wrote: Well, again, I'm not purporting to be an authority, but the first thing that comes to mind is that my reasoning would be much the same as my reasoning in building stuff: I've got a nice STIHL chainsaw, but I don't need it to cut two-by-fours, and I've got access to a Hole Hawg but don't need it to make a path for a CAT5 cable. I guess you could call the concept avoiding overkill, but I'm not cognizant enough with the inner workings of Apache to know really how much of a hit the rewrite module makes. I suppose, in terms of computing, it's kind of similar to a Unix philosophy: small tools that do one job without extra fluff. Doing it in PHP is like to be doing it with extra fluff. Mod_rewrite is designed for rewriting and it does it well. Doing the same job in PHP is likely to use more resources and be more complex. In short: using mod_rewrite for url rewriting is not overkill - it's using the proper tool for the job. Regards Peter -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 /hype -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] regexp questions
Subject: RE: [PHP] regexp questions Date: Wed, 12 May 2010 11:11:07 +0100 From: m.f...@leedsmet.ac.uk To: spudm...@hotmail.com; php-general@lists.php.net -Original Message- From: Spud. Ivan. [mailto:spudm...@hotmail.com] Sent: 11 May 2010 15:56 To: php-general@lists.php.net Subject: RE: [PHP] regexp questions hehe, but I can't find anything related to regexp. I've found something at http://php.net/preg_match Changelog Try searching for pcre: Version 5.3.2 Upgraded bundled PCRE to version 8.00. Version 5.3.0 Upgraded bundled PCRE to version 7.9. Version 5.2.13 Upgraded bundled PCRE to version 7.9. Version 5.2.9 Fixed bug #44336 (Improve pcre UTF-8 string matching performance). Version 5.2.7 Upgraded PCRE to version 7.8 Version 5.2.6 Upgraded PCRE to version 7.6 Version 5.2.5 Upgraded PCRE to version 7.3 Version 5.2.4 Upgraded PCRE to version 7.2 Version 5.2.2 Upgraded PCRE to version 7.0 Version 5.2.0 Updated PCRE to version 6.7 ... so it looks like between PHP 5.1 and 5.3.2 you have at least 2 major version upgrades of the PCRE library, so the previously referenced http://www.pcre.org/changelog.txt is more than likely what you need to be looking at. Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Leeds Metropolitan University, C507, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm Thank you very much, this was very useful ;) I. Lopez. _ ¿Quieres conocer trucos de Windows 7? ¡Los que ya lo usan te los cuentan! http://www.sietesunpueblodeexpertos.com/index_windows7.html
RE: [PHP] regexp questions
Date: Tue, 11 May 2010 15:38:41 -0700 From: li...@cmsws.com To: spudm...@hotmail.com CC: php-general@lists.php.net Subject: Re: [PHP] regexp questions Spud. Ivan. wrote: I think we've not so much only with the regex, but maybe you can tell me somethin helpful ;) /Word1:\/a\/h4\(a href=\http:\/\/www.thiswebsite.com\/some-script.php\fir.*?st word.*?(.*)Word2:\/a\/h4ul(.*)Second word:\/a\/h4ul(.*)Word3:\/a\/h4ul(.*)rd word/is Thanks. I.Lopez. On 05/11/2010 09:56 AM, Spud. Ivan. wrote: But it doesn't explain why my regexps work fine within php 5.1 but 5.3 Ivan. Post a regex and what you think it should match but doesn't. Again... Why don't you show us an example of what it is you are trying to match this against. Then, after that example, show us what you would like to see as the output. Then, send us a copy of the code you are trying to use to make it all happen. -- 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 I'm sorry Jim, but as majority of regexp, I can't explain you what I want with words... I simply want to pick specific text at very specific places inside the html. I'm sending you to your email the html and regex so you can test it if you want :) Thanks. I. Lopez. _ Consejos para seducir ¿Puedes conocer gente nueva a través de Internet? ¡Regístrate ya! http://contactos.es.msn.com/?mtcmk=015352
RE: [PHP] regexp questions
On Wed, 2010-05-12 at 18:13 +0200, Spud. Ivan. wrote: Date: Tue, 11 May 2010 15:38:41 -0700 From: li...@cmsws.com To: spudm...@hotmail.com CC: php-general@lists.php.net Subject: Re: [PHP] regexp questions Spud. Ivan. wrote: I think we've not so much only with the regex, but maybe you can tell me somethin helpful ;) /Word1:\/a\/h4\(a href=\http:\/\/www.thiswebsite.com\/some-script.php\fir.*?st word.*?(.*)Word2:\/a\/h4ul(.*)Second word:\/a\/h4ul(.*)Word3:\/a\/h4ul(.*)rd word/is Thanks. I.Lopez. On 05/11/2010 09:56 AM, Spud. Ivan. wrote: But it doesn't explain why my regexps work fine within php 5.1 but 5.3 Ivan. Post a regex and what you think it should match but doesn't. Again... Why don't you show us an example of what it is you are trying to match this against. Then, after that example, show us what you would like to see as the output. Then, send us a copy of the code you are trying to use to make it all happen. -- 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 I'm sorry Jim, but as majority of regexp, I can't explain you what I want with words... I simply want to pick specific text at very specific places inside the html. I'm sending you to your email the html and regex so you can test it if you want :) Thanks. I. Lopez. _ Consejos para seducir ¿Puedes conocer gente nueva a través de Internet? ¡Regístrate ya! http://contactos.es.msn.com/?mtcmk=015352 It might be better to use some of the DOM functions for something like this. You can pull out specific tags and tag content as you need. It's better to rely on DOM functions for these sorts of things than using regular expressions. Thanks, Ash http://www.ashleysheridan.co.uk
RE: [PHP] regexp questions
Subject: RE: [PHP] regexp questions From: a...@ashleysheridan.co.uk To: spudm...@hotmail.com CC: php-general@lists.php.net Date: Wed, 12 May 2010 17:11:11 +0100 On Wed, 2010-05-12 at 18:13 +0200, Spud. Ivan. wrote: Date: Tue, 11 May 2010 15:38:41 -0700 From: li...@cmsws.com To: spudm...@hotmail.com CC: php-general@lists.php.net Subject: Re: [PHP] regexp questions Spud. Ivan. wrote: I think we've not so much only with the regex, but maybe you can tell me somethin helpful ;) /Word1:\/a\/h4\(a href=\http:\/\/www.thiswebsite.com\/some-script.php\fir.*?st word.*?(.*)Word2:\/a\/h4ul(.*)Second word:\/a\/h4ul(.*)Word3:\/a\/h4ul(.*)rd word/is Thanks. I.Lopez. On 05/11/2010 09:56 AM, Spud. Ivan. wrote: But it doesn't explain why my regexps work fine within php 5.1 but 5.3 Ivan. Post a regex and what you think it should match but doesn't. Again... Why don't you show us an example of what it is you are trying to match this against. Then, after that example, show us what you would like to see as the output. Then, send us a copy of the code you are trying to use to make it all happen. -- 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 I'm sorry Jim, but as majority of regexp, I can't explain you what I want with words... I simply want to pick specific text at very specific places inside the html. I'm sending you to your email the html and regex so you can test it if you want :) Thanks. I. Lopez. _ Consejos para seducir ¿Puedes conocer gente nueva a través de Internet? ¡Regístrate ya! http://contactos.es.msn.com/?mtcmk=015352 It might be better to use some of the DOM functions for something like this. You can pull out specific tags and tag content as you need. It's better to rely on DOM functions for these sorts of things than using regular expressions. Thanks, Ash http://www.ashleysheridan.co.uk But If I remove tags, I can't match this specific place, because are just these tags who distinct the place where to match. I.Lopez. _ Consejos para seducir ¿Puedes conocer gente nueva a través de Internet? ¡Regístrate ya! http://contactos.es.msn.com/?mtcmk=015352
RE: [PHP] regexp questions
On Wed, 2010-05-12 at 18:23 +0200, Spud. Ivan. wrote: Subject: RE: [PHP] regexp questions From: a...@ashleysheridan.co.uk To: spudm...@hotmail.com CC: php-general@lists.php.net Date: Wed, 12 May 2010 17:11:11 +0100 On Wed, 2010-05-12 at 18:13 +0200, Spud. Ivan. wrote: Date: Tue, 11 May 2010 15:38:41 -0700 From: li...@cmsws.com To: spudm...@hotmail.com CC: php-general@lists.php.net Subject: Re: [PHP] regexp questions Spud. Ivan. wrote: I think we've not so much only with the regex, but maybe you can tell me somethin helpful ;) /Word1:\/a\/h4\(a href=\http:\/\/www.thiswebsite.com\/some-script.php\fir.*?st word.*?(.*)Word2:\/a\/h4ul(.*)Second word:\/a\/h4ul(.*)Word3:\/a\/h4ul(.*)rd word/is Thanks. I.Lopez. On 05/11/2010 09:56 AM, Spud. Ivan. wrote: But it doesn't explain why my regexps work fine within php 5.1 but 5.3 Ivan. Post a regex and what you think it should match but doesn't. Again... Why don't you show us an example of what it is you are trying to match this against. Then, after that example, show us what you would like to see as the output. Then, send us a copy of the code you are trying to use to make it all happen. -- 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 I'm sorry Jim, but as majority of regexp, I can't explain you what I want with words... I simply want to pick specific text at very specific places inside the html. I'm sending you to your email the html and regex so you can test it if you want :) Thanks. I. Lopez. _ Consejos para seducir ¿Puedes conocer gente nueva a través de Internet? ¡Regístrate ya! http://contactos.es.msn.com/?mtcmk=015352 It might be better to use some of the DOM functions for something like this. You can pull out specific tags and tag content as you need. It's better to rely on DOM functions for these sorts of things than using regular expressions. Thanks, Ash http://www.ashleysheridan.co.uk But If I remove tags, I can't match this specific place, because are just these tags who distinct the place where to match. I.Lopez. _ Consejos para seducir ¿Puedes conocer gente nueva a través de Internet? ¡Regístrate ya! http://contactos.es.msn.com/?mtcmk=015352 It depends what you need to do. If you want to match specific tags, then something like getElementsByTagName() (I believe this function exists in the set of DOM functions) would very easily grab all those tags so you can work on them. I don't see much that a regex could do here that the DOM can't handle. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] regexp questions
On May 12, 2010, at 11:20 AM, Ashley Sheridan wrote: On Wed, 2010-05-12 at 18:23 +0200, Spud. Ivan. wrote: Subject: RE: [PHP] regexp questions From: a...@ashleysheridan.co.uk To: spudm...@hotmail.com CC: php-general@lists.php.net Date: Wed, 12 May 2010 17:11:11 +0100 On Wed, 2010-05-12 at 18:13 +0200, Spud. Ivan. wrote: Date: Tue, 11 May 2010 15:38:41 -0700 From: li...@cmsws.com To: spudm...@hotmail.com CC: php-general@lists.php.net Subject: Re: [PHP] regexp questions Spud. Ivan. wrote: I think we've not so much only with the regex, but maybe you can tell me somethin helpful ;) /Word1:\/a\/h4\(a href=\http:\/\/www.thiswebsite.com\/some- script.php\fir.*?st word.*?(.*)Word2:\/a\/h4ul(.*)Second word:\/a\/h4ul(.*)Word3:\/a\/h4ul(.*)rd word/is Thanks. I.Lopez. On 05/11/2010 09:56 AM, Spud. Ivan. wrote: But it doesn't explain why my regexps work fine within php 5.1 but 5.3 Ivan. Post a regex and what you think it should match but doesn't. Again... Why don't you show us an example of what it is you are trying to match this against. Then, after that example, show us what you would like to see as the output. Then, send us a copy of the code you are trying to use to make it all happen. -- 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 I'm sorry Jim, but as majority of regexp, I can't explain you what I want with words... I simply want to pick specific text at very specific places inside the html. I'm sending you to your email the html and regex so you can test it if you want :) Thanks. I. Lopez. _ Consejos para seducir ¿Puedes conocer gente nueva a través de Internet? ¡Regístrate ya! http://contactos.es.msn.com/?mtcmk=015352 It might be better to use some of the DOM functions for something like this. You can pull out specific tags and tag content as you need. It's better to rely on DOM functions for these sorts of things than using regular expressions. Thanks, Ash http://www.ashleysheridan.co.uk But If I remove tags, I can't match this specific place, because are just these tags who distinct the place where to match. I.Lopez. _ Consejos para seducir ¿Puedes conocer gente nueva a través de Internet? ¡Regístrate ya! http://contactos.es.msn.com/?mtcmk=015352 It depends what you need to do. If you want to match specific tags, then something like getElementsByTagName() (I believe this function exists in the set of DOM functions) would very easily grab all those tags so you can work on them. I don't see much that a regex could do here that the DOM can't handle. Thanks, Ash http://www.ashleysheridan.co.uk Dont know if you found your solution or not, but here is a good website for regexp. http://lawrence.ecorp.net/inet/samples/regexp-intro.php HTH, Karl DeSaulniers Design Drumm http://designdrumm.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] In need of CVS/SVN checkout script for Production servers [solved]
-Original Message- From: tedd [mailto:tedd.sperl...@gmail.com] Sent: Thursday, May 06, 2010 9:06 AM To: Daevid Vincent; php-general@lists.php.net Subject: RE: [PHP] In need of CVS/SVN checkout script for Production servers [solved] At 5:43 PM -0700 5/5/10, Daevid Vincent wrote: -Original Message- From: tedd [mailto:tedd.sperl...@gmail.com] Sent: Wednesday, May 05, 2010 8:19 AM To: Daevid Vincent; php-general@lists.php.net Subject: RE: [PHP] In need of CVS/SVN checkout script for -snip- stuff which fell on deaf ears tedd *sigh* once again you people focus on something S off topic compared to the meat of the thread -- which is a production repository checkout script. Let me get this right -- you created a repository for people to check-out/deposit scripts, but then deny some people access because of their choice of browser? That seems counter productive. Do your scripts only work for certain browsers? No. I created a little miniscule dumping ground for some useful scripts *I* use, and if someone else can use them, then feel free. I don't support them. I don't even pretend to maintain them once posted. They are what they are. --- As for my site. [*] I really don't care about the fringe browsers... That obvious. But what happens when your client's do care? I make 6+ figures and have so for years. I'm not a freelancer. My experience, networking and resume get me jobs, not my home page. I don't have clients. --- Give me a break man. I've got more important things to do. Let me get this right -- it's more important to do something else than to fix something you did wrong? If you're gong to take the time to do something, then why not do it right? Remember, this is an example of *your* work. No. Examples of my work are what I get PAID for. This is simply a personal page and a hobby. I spend a lot of my time making my code as good as I can get it, not because of clients, or what others might think, but because of me. It's a personal choice of mine to always learn and improve. If you allow I've got more important things to do altitude to excuse bad code, then you are only hurting yourself in the long run. I think you know that. --- [*] Honestly, I also dislike Apple. I think it's stupid for them to make a browser. I think they make crappy products. LOL! So you think that M$ makes better stuff, like IE6? Even Apple's worst browser was better than that! Yes I do. I won't get into an OS war with you though. XP is the best OS thus far. Everything in the world supports it. It is stable and fast. As for browser, I use FF for developing (mostly for Firebug) and some flavor of IE (usually all three to test with) as that is what most people still use. IE6 is still the standard default browser Panasonic uses (that's 5000 users alone). Many other large enterprise companies also stick with XP/IE6. Only slowly are they migrating to IE8. --- As for CSS, inline styles, separation of logic, and all that other stuff you ASSUME I don't use -- you are very wrong. I just happen to use a lot of PHP to dynamically create various parts. I'm not ASSUMING anything -- it's a fact the site you provided doesn't follow said practices. Additionally, you seem to be blaming PHP for the bad code but the fact is you're just being lazy. Many of my sites are dynamically created via PHP but still generate good code. One doesn't exclude the other. Not blaming at all. Just saying that while you see inline JS or CSS, it's actually not as it appears. Some of that is generated in routines or loops. The point is that you want us to go to your site to check-out/provide scripts, but the site you provided reeks of bad code. That's a bit like a dinner saying Don't mind the dirty silverware, just eat the food. No. I don't want you to do anything. I offered up some free code. Take it or leave it. If you want it, then the least you can do is use the required browsers (which mostly everyone has already installed) to get to it. In fact, if you're such a die-hard Safari user, just change your USER_AGENT string and it will probably work. No sweat off my balls if you don't. --- In some cases I inline styles where they are used one time or used in a PHP function. Okay, then why not learn how to do it right? Using a validator can help you improve your code. Standards are not just for an elite group of people but rather to improve overall coding practices. What's wrong with that? Validation is giving you the opportunity to critically review your code. What part about coded 4 years ago don't you understand? --- If I had to choose between my daevid.com site and one of the three you (presumably) illustrate as beacons of the way to do it (http://sperling.com http://ancientstones.com
[PHP] GD - import a PNG image and make transparant
Hi, I am trying to import a PNG image from disk, place it on top of a transparant image created in GD and output it to the browser. In the case of a low opacity setting, I would expect to see the background colour from the HTML page. If I set the opacity to 0, everything works - I end up with a transparant image. However, if I set it for any value 0 (even 1) instead of a very-faint-image the whole thing goes black. As the opacity level goes up from 0, the amount of black reduces and the amount of imported image increases - but this is not what I want. I am using this code: ?php $src = imagecreatefrompng('test.png'); $img_width = imagesx($src); $img_height = imagesy($src); // Create trans image $dest = imagecreatetruecolor($img_width, $img_height); //imagesavealpha($dest, true); // This has no effect it appears $trans_colour = imagecolorallocatealpha($dest, 0, 255, 0, 128); // Make the background transparent imagecolortransparent($dest, $trans_colour); //imagefill($dest, 0, 0, $trans_colour); // This does not work // Merge src on top of dest, with opacity of 1 in this case imagecopymerge($dest, $src, 0, 0, 0, 0, $img_width, $img_height, 1); // Output and free from memory header('Content-Type: image/png'); imagepng($dest); ? The images that this outputs, at opacity levels 0,1 and 80 on a red and green background (screenshots of a HTML page) can be downloaded from http://www.box.net/shared/h9zn4tjgro Any help appreciated! Cheers, Alex
Re: [PHP] GD - import a PNG image and make transparant
Hi Alex, I have a php file I made just a few months ago. It takes a gif, jpeg or png of any size and sizes it proportionately to a specified size and then outputs a png. If the image is a transparent png or transparent gif, it will still hold the transparency. This is just a test page and it tested ok for me, but it is my first one. I also tested it on PHP 5. Dont know about compatibility to older versions. Knowing that, here you go. http://designdrumm.com/upload_images_test.php.zip HTH, Karl On May 12, 2010, at 6:12 PM, Alex Davies wrote: Hi, I am trying to import a PNG image from disk, place it on top of a transparant image created in GD and output it to the browser. In the case of a low opacity setting, I would expect to see the background colour from the HTML page. If I set the opacity to 0, everything works - I end up with a transparant image. However, if I set it for any value 0 (even 1) instead of a very-faint-image the whole thing goes black. As the opacity level goes up from 0, the amount of black reduces and the amount of imported image increases - but this is not what I want. I am using this code: ?php $src = imagecreatefrompng('test.png'); $img_width = imagesx($src); $img_height = imagesy($src); // Create trans image $dest = imagecreatetruecolor($img_width, $img_height); //imagesavealpha($dest, true); // This has no effect it appears $trans_colour = imagecolorallocatealpha($dest, 0, 255, 0, 128); // Make the background transparent imagecolortransparent($dest, $trans_colour); //imagefill($dest, 0, 0, $trans_colour); // This does not work // Merge src on top of dest, with opacity of 1 in this case imagecopymerge($dest, $src, 0, 0, 0, 0, $img_width, $img_height, 1); // Output and free from memory header('Content-Type: image/png'); imagepng($dest); ? The images that this outputs, at opacity levels 0,1 and 80 on a red and green background (screenshots of a HTML page) can be downloaded from http://www.box.net/shared/h9zn4tjgro Any help appreciated! Cheers, Alex Karl DeSaulniers Design Drumm http://designdrumm.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD - import a PNG image and make transparant
On Thu, 2010-05-13 at 00:12 +0100, Alex Davies wrote: Hi, I am trying to import a PNG image from disk, place it on top of a transparant image created in GD and output it to the browser. In the case of a low opacity setting, I would expect to see the background colour from the HTML page. If I set the opacity to 0, everything works - I end up with a transparant image. However, if I set it for any value 0 (even 1) instead of a very-faint-image the whole thing goes black. As the opacity level goes up from 0, the amount of black reduces and the amount of imported image increases - but this is not what I want. I am using this code: ?php $src = imagecreatefrompng('test.png'); $img_width = imagesx($src); $img_height = imagesy($src); // Create trans image $dest = imagecreatetruecolor($img_width, $img_height); //imagesavealpha($dest, true); // This has no effect it appears $trans_colour = imagecolorallocatealpha($dest, 0, 255, 0, 128); // Make the background transparent imagecolortransparent($dest, $trans_colour); //imagefill($dest, 0, 0, $trans_colour); // This does not work // Merge src on top of dest, with opacity of 1 in this case imagecopymerge($dest, $src, 0, 0, 0, 0, $img_width, $img_height, 1); // Output and free from memory header('Content-Type: image/png'); imagepng($dest); ? The images that this outputs, at opacity levels 0,1 and 80 on a red and green background (screenshots of a HTML page) can be downloaded from http://www.box.net/shared/h9zn4tjgro Any help appreciated! Cheers, Alex How exactly are you setting the opacity for the image? The traditional way is to use imagecolorallocatealpha() on the source. Thanks, Ash http://www.ashleysheridan.co.uk
[PHP] function/class to convert IDN (Puny-Code)?
Hello, while reading RFC3490 (plus 3454/3491/3492) and before I am ongoing to reinvent the wheel here the question: Does someone HAVE or know a function/class which does the IDN conversion toASCII and toUNICODE? Note: The C Source-Code is included in RFC3492 and can more or less easily converted to PHP. Thanks, Greetings and nice Day/Evening Michelle Konzack Systemadministrator -- # Debian GNU/Linux Consultant ## Development of Intranet and Embedded Systems with Debian GNU/Linux itsyst...@tdnet France itsyst...@tdnet UG (haftungsbeschränkt) Gesch. Michelle Konzack Gesch. Michelle Konzack Apt. 917 (homeoffice) 50, rue de Soultz Kinzigstraße 17 67100 Strasbourg/France 77694 Kehl/Germany Tel: +33-6-61925193 mobil Tel: +49-177-9351947 mobil Tel: +33-9-52705884 fix http://www.itsystems.tamay-dogan.net/ http://www.flexray4linux.org/ http://www.debian.tamay-dogan.net/ http://www.can4linux.org/ Jabber linux4miche...@jabber.ccc.de ICQ#328449886 Linux-User #280138 with the Linux Counter, http://counter.li.org/ signature.pgp Description: Digital signature