|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 7 Feb 2007 03:10:02 -0000 Issue 4612
php-general-digest-help
lists.php.net
Date: Tue Feb 06 2007 - 21:10:02 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 7 Feb 2007 03:10:02 -0000 Issue 4612
Topics (messages 248433 through 248467):
Re: Writting a simple proxy in PHP
248433 by: Casey Chu
248445 by: Alessandro Vernet
248450 by: Jochem Maas
Re: PHP book reviewers wanted
248434 by: tedd
248435 by: tedd
248438 by: Stut
Re: Converting string representation of a directory to multi-dimensional array
248436 by: Roman Neuhauser
248444 by: Matt Carlson
Re: file_get_contents
248437 by: scotdiddle.silverdarkroom.com
Re: All-in-one PHP Classes
248439 by: Roman Neuhauser
248452 by: Chris
248455 by: Robert Cummings
Open pop-up stylish window
248440 by: Chris Carter
248441 by: Colin Guthrie
248442 by: Jim Lucas
248443 by: Robert Cummings
248446 by: Jim Lucas
248447 by: Robert Cummings
248448 by: Jim Lucas
248449 by: Robert Cummings
Re: PHP5 & Commercial Development
248451 by: Keryx Web
248453 by: Robert Cummings
248463 by: Ligaya A. Turmelle
Re: _GET('name') truncates
248454 by: Roman Neuhauser
Apache asks to save php file?
248456 by: Skip Evans
248457 by: Robert Cummings
248458 by: Skip Evans
248459 by: Chris
248460 by: Greg Maruszeczka
248461 by: Robert Cummings
248462 by: Skip Evans
248464 by: Skip Evans
preg_match
248465 by: James Lockie
248466 by: Richard Lynch
248467 by: Myron Turner
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Try using cUrl.
On 2/6/07, Jochem Maas <jochem
iamjochem.com> wrote:
> Alessandro Vernet wrote:
> > I would like to forward on the server side (also called "proxy" or
> > "server-side redirect") some queries that get to my PHP script. A naive
> > approach is to do:
> >
> > print(implode("", file("http://localhost:8090" . $REQUEST_URI)));
> >
> > Where http://localhost:8090 is the address I want to proxy to. But of
> > course, this only works for simple GET requests. It does not forward headers
> > (like Authentication), and won't work if the request is a POST.
> >
> > Has anyone a suggestion on how I could implement a better proxy? I am not
> > looking for a perfect solution. Something that would forward headers and
> > handle posts would be good enough.
>
> if your using apache then you should look at the ProxyPass directive - very hand,
> STW or STA for more detailed info.
>
> >
> > Alex
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Jochem Maas wrote:
>
> if your using apache then you should look at the ProxyPass directive -
> very hand,
> STW or STA for more detailed info.
>
Jochem,
I went this route. I agree, it is much simpler than trying to hack this in
PHP.
Alex
--
View this message in context: http://www.nabble.com/Writting-a-simple-proxy-in-PHP-tf3178331.html#a8832985
Sent from the PHP - General mailing list archive at Nabble.com.
attached mail follows:
Alessandro Vernet wrote:
>
> Jochem Maas wrote:
>> if your using apache then you should look at the ProxyPass directive -
>> very hand,
>> STW or STA for more detailed info.
>>
>
> Jochem,
>
> I went this route. I agree, it is much simpler than trying to hack this in
> PHP.
it's rather a neat way of solving the 'how to run php4 & php5 module on the same
server' problem one often encounters,
I can't take any credit though - that belongs to Rasmus Lerdorf for pointing it out
(and possibly also due to his work on Apache itself - IIRC).
regardless, nice to know you solved your problem (or at least pushed back the urgency -
I guess that one day we'll all have to let go of php4 altogether :-).
>
> Alex
attached mail follows:
At 8:39 PM -0600 2/5/07, Richard Lynch wrote:
>On Mon, February 5, 2007 10:09 am, tedd wrote:
>> At 1:05 AM -0200 2/5/07, Manuel Lemos wrote:
>>>Demonstrating good English writing skills and having published good
>>> book
>>>reviews in the past gets me preference.
>>
>> "gets me preference" ???
>>
>> Me get any money for this?
>
>Hey, go easy on the non-native speakers...
>
>I'm betting your Spanish is worse than his English...
No doubt -- I have enough problems with English.
My point was, or at least my failed attempt was: 1) humor; 2)
pointing out a proof reading error in a request for roof reading
skills. I found that ironically humorous.
No disrespect was intended, it was just a jab between posters.
My apologies if any offense was taken.
Cheers,
tedd
PS: He is a native speaker, it's just not English. :-)
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
At 4:04 AM -0200 2/6/07, Manuel Lemos wrote:
>Anyway, since you brought that up, I would like to clarify that this is
>often misunderstood issue. Nobody likes ads, including myself. Ads are
>obviously necessary to keep the site viable. Otherwise it would have
>been closed a long time ago.
Why are ads necessary? I don't follow.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
tedd wrote:
> My point was, or at least my failed attempt was: 1) humor; 2) pointing
> out a proof reading error in a request for roof reading skills. I found
> that ironically humorous.
HumoUrous "roof reading skills" you've got there.
> No disrespect was intended, it was just a jab between posters.
Indeed.
-Stut
attached mail follows:
# jochem
iamjochem.com / 2007-02-06 12:45:22 +0100:
> there may also be some kind of solution based on
> ArrayArrayArrayIteratorIteratorRecursiveArrayIteratorIteratorRecursiveIterator
> but personally I don't grok those exotic forms of SPL interface well
> enough to tell you.
I had wanted to post something when the thread started, but gave up,
because I quickly ran into ambiguities. What should the conversion do
when given a basename, e. g. addToList("file.txt", ...)?
Anyway, here's an implementation, and a few Testilence tests. The code
doesn't provide for iteration since, AFAICT, the OP is looking for
a map, not an iterable collection.
<?php
class pata
implements ArrayAccess
{
function __construct($path, $sep = '/')
{
$this->sep = $sep;
$path = trim($path, $sep);
if ($this->isBasename($path)) {
throw new InvalidArgumentException;
}
list($key, $rest) = $this->split($path);
$this->key = $key;
if ($this->isBasename($rest)) {
$this->data = $rest;
} else {
$this->data = new self($rest, $sep);
}
}
function __toString()
{
return $this->key . $this->sep . $this->data;
}
function offsetExists($key)
{
return $this->key === $key;
}
function offsetGet($key)
{
return $this->data;
}
function offsetUnset($key) { throw new LogicException; }
function offsetSet($key, $value) { throw new LogicException; }
private function isBasename($path)
{
return (false === strpos($path, $this->sep));
}
private function split($path)
{
$sp = $this->strpos($path, $this->sep);
$key = substr($path, 0, $sp);
$rest = trim(substr($path, $sp), $this->sep);
return array($key, $rest);
}
private function strpos($haystack, $needle)
{
$rv = strpos($haystack, $needle);
return (false === $rv) ? strlen($haystack) : $rv;
}
private $key, $data = array();
}
class pata_SingleSegmentTest extends Tence_TestCase
{
function testThrowsOnBaseName()
{
$this->willThrow('InvalidArgumentException');
new pata('foo');
}
}
abstract class pata_MultipleSegmentTest extends Tence_TestCase
{
abstract protected /* string */ function separator();
function setUp()
{
$this->garbage = 'garbage';
$this->key = 'foo';
$segments = array('bar', 'baz');
$sep = $this->separator();
$this->path = implode($sep, $segments);
$this->pata = new pata($this->key . $sep . $this->path, $sep);
}
function testIssetWithPathAsKeySucceeds()
{
return $this->assertTrue(isset($this->pata[$this->key]));
}
function testIssetWithWrongKeyFails()
{
return $this->assertFalse(isset($this->pata[$this->garbage]));
}
function testGetWithPathAsKey()
{
return $this->assertEquals($this->path, $this->strval($this->pata[$this->key]));
}
private function strval($v)
{
if (is_object($v)) {
return $v->__toString();
} else {
return strval($v);
}
}
}
class pata_WinTest extends pata_MultipleSegmentTest
{
function separator() { return '\\'; }
}
class pata_POSIXTest extends pata_MultipleSegmentTest
{
function separator() { return '/'; }
}
class pata_tests extends Tence_TestSuite
{
function __construct()
{
$this
->add(new pata_SingleSegmentTest)
->add(new pata_WinTest)
->add(new pata_POSIXTest)
;
}
}
?>
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
attached mail follows:
It will never receive a base name due to the way the data is structured before being passed into the function.
I appreciate everyone's input on this. It's been tough for us to develop what we did (since it's such an odd case), and it's good to see other possible methods to do this in a better manor.
----- Original Message ----
From: Roman Neuhauser <neuhauser
sigpipe.cz>
To: Jochem Maas <jochem
iamjochem.com>
Cc: php-general
lists.php.net
Sent: Tuesday, February 6, 2007 9:03:35 AM
Subject: Re: [PHP] Converting string representation of a directory to multi-dimensional array
I had wanted to post something when the thread started, but gave up,
because I quickly ran into ambiguities. What should the conversion do
when given a basename, e. g. addToList("file.txt", ...)?
attached mail follows:
Steven,
I asked this same question a week or so on the ZEND PHP Fourm
See the answer to my post for an elegant solution:
http://www.zend.com/forums/index.php?t=msg&th=2977&start=0&S=fe14095d33458d18b9bc49ea04a9a13b
Scot L. Diddle, Richmond VA
Quoting Steven Macintyre <steven
steven.macintyre.name>:
> Hiya,
>
> I need to be able to read a file into a string - I have used the above
> command and it works ... now ... I need to read a file into a string - that
> requires a username and password to access the authentication is normal HTTP
> basic realm
>
> Any ideas?
>
>
>
> Kind Regards
>
>
> Steven Macintyre
>
> --
>
> www.friends4friends.co.za
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
# user
internet46.fr / 2007-02-06 12:47:47 +0100:
> Have been reading posts daily for two months now on the list, and am very
> pleased at how informative these can be.
> I have noticed, many examples where one is pointed to using classes
> downloadable on the internet.
> This is when i realized how often these classes that do "everything" are
> very BIG.
Big classes and long methods are signs of bad code, no matter if it's
downloadable for free or costs money.
> Here, it's the programmer who is confronted with loading huge files into
> memory to use just one perhaps two function in a 300+ functionality class..
what's a "300+ functionality class"? One having more than 300 public
methods? Where can I see it? Such a beast could be legit (hard to tell
without knowing more), but it's probably a result of incompetence.
> Shouldn't these classes be perhaps broken down into usefull "parts".
Definitely.
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
attached mail follows:
Roman Neuhauser wrote:
> # user
internet46.fr / 2007-02-06 12:47:47 +0100:
>> Have been reading posts daily for two months now on the list, and am very
>> pleased at how informative these can be.
>> I have noticed, many examples where one is pointed to using classes
>> downloadable on the internet.
>
>> This is when i realized how often these classes that do "everything" are
>> very BIG.
>
> Big classes and long methods are signs of bad code, no matter if it's
> downloadable for free or costs money.
Pfft. Depends on the code.
A developer api is going to have long methods / functions, simply
because of error checking.
>> Here, it's the programmer who is confronted with loading huge files into
>> memory to use just one perhaps two function in a 300+ functionality class..
>
> what's a "300+ functionality class"? One having more than 300 public
> methods? Where can I see it? Such a beast could be legit (hard to tell
> without knowing more), but it's probably a result of incompetence.
I'd have to agree with that being extremely bad. My biggest class has
maybe 30.
>> Shouldn't these classes be perhaps broken down into usefull "parts".
>
> Definitely.
Where possible, yes.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
On Wed, 2007-02-07 at 09:59 +1100, Chris wrote:
> Roman Neuhauser wrote:
> > # user
internet46.fr / 2007-02-06 12:47:47 +0100:
> >> Have been reading posts daily for two months now on the list, and am very
> >> pleased at how informative these can be.
> >> I have noticed, many examples where one is pointed to using classes
> >> downloadable on the internet.
> >
> >> This is when i realized how often these classes that do "everything" are
> >> very BIG.
> >
> > Big classes and long methods are signs of bad code, no matter if it's
> > downloadable for free or costs money.
>
> Pfft. Depends on the code.
>
> A developer api is going to have long methods / functions, simply
> because of error checking.
>
> >> Here, it's the programmer who is confronted with loading huge files into
> >> memory to use just one perhaps two function in a 300+ functionality class..
> >
> > what's a "300+ functionality class"? One having more than 300 public
> > methods? Where can I see it? Such a beast could be legit (hard to tell
> > without knowing more), but it's probably a result of incompetence.
>
> I'd have to agree with that being extremely bad. My biggest class has
> maybe 30.
I have a base class that most of my components extend that has 90
methods. It could go elsewhere or be broken up into smaller pieces, but
why bother, then I'd have to spend more cycles loading the individual
pieces... and quite frankly I'm too lazy to bother :) Most of them wrap
PHP functionality or do framework localization.
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. |
`------------------------------------------------------------'
attached mail follows:
Hi,
I am looking for a way to open a preview window. This should be a seperate
pop-up but within the same page. The moment the user clicks for say "more
details »" .. this should not open a next page or a pop-up window but a
dhtml transparent window that has the short discription. This window might
display onclick just below the "more details »" link.
Has anyone come across this ever. Please assist with a link or with your
advice. Sorry about posting on PHP-General though its HTML thing.
Thanks,
--
View this message in context: http://www.nabble.com/Open-pop-up-stylish-window-tf3181638.html#a8829459
Sent from the PHP - General mailing list archive at Nabble.com.
attached mail follows:
Chris Carter wrote:
> Hi,
>
> I am looking for a way to open a preview window. This should be a seperate
> pop-up but within the same page. The moment the user clicks for say "more
> details »" .. this should not open a next page or a pop-up window but a
> dhtml transparent window that has the short discription. This window might
> display onclick just below the "more details »" link.
>
> Has anyone come across this ever. Please assist with a link or with your
> advice. Sorry about posting on PHP-General though its HTML thing.
There are gazillions of examples found via the web. Just google for "css
popups" and I'm sure you'll fine a few of them in amoungst the porn,
spam, and warez. :p
Col.
attached mail follows:
Chris Carter wrote:
> Hi,
>
> I am looking for a way to open a preview window. This should be a seperate
> pop-up but within the same page. The moment the user clicks for say "more
> details »" .. this should not open a next page or a pop-up window but a
> dhtml transparent window that has the short discription. This window might
> display onclick just below the "more details »" link.
>
> Has anyone come across this ever. Please assist with a link or with your
> advice. Sorry about posting on PHP-General though its HTML thing.
>
> Thanks,
This is what i found a few years ago. Check it out
http://www.brainjar.com/dhtml/windows/
--
Enjoy,
Jim Lucas
Different eyes see different things. Different hearts beat on different
strings. But there are times for you and me when all such things agree.
- Rush
attached mail follows:
On Tue, 2007-02-06 at 10:09 -0800, Jim Lucas wrote:
> Chris Carter wrote:
> > Hi,
> >
> > I am looking for a way to open a preview window. This should be a seperate
> > pop-up but within the same page. The moment the user clicks for say "more
> > details »" .. this should not open a next page or a pop-up window but a
> > dhtml transparent window that has the short discription. This window might
> > display onclick just below the "more details »" link.
> >
> > Has anyone come across this ever. Please assist with a link or with your
> > advice. Sorry about posting on PHP-General though its HTML thing.
> >
> > Thanks,
>
> This is what i found a few years ago. Check it out
>
> http://www.brainjar.com/dhtml/windows/
Junk! Doesn't work in Opera :/
:)
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. |
`------------------------------------------------------------'
attached mail follows:
Robert Cummings wrote:
> On Tue, 2007-02-06 at 10:09 -0800, Jim Lucas wrote:
>> Chris Carter wrote:
>>> Hi,
>>>
>>> I am looking for a way to open a preview window. This should be a seperate
>>> pop-up but within the same page. The moment the user clicks for say "more
>>> details »" .. this should not open a next page or a pop-up window but a
>>> dhtml transparent window that has the short discription. This window might
>>> display onclick just below the "more details »" link.
>>>
>>> Has anyone come across this ever. Please assist with a link or with your
>>> advice. Sorry about posting on PHP-General though its HTML thing.
>>>
>>> Thanks,
>> This is what i found a few years ago. Check it out
>>
>> http://www.brainjar.com/dhtml/windows/
>
> Junk! Doesn't work in Opera :/
>
> :)
>
> Cheers,
> Rob.
Was there a requirement given that it had to work in Opera. No, he just
asked if anybody had come across this feature. Maybe it works in Opera,
maybe it doesn't. I didn't see that as a requirement. But then again,
what about the people that use Lynx, how is he going to work that one?
Oh, that wasn't a requirement either.
This is just one example of how it can be done.
That is what he asked for.
--
Enjoy,
Jim Lucas
Different eyes see different things. Different hearts beat on different
strings. But there are times for you and me when all such things agree.
- Rush
attached mail follows:
On Tue, 2007-02-06 at 13:05 -0800, Jim Lucas wrote:
> Robert Cummings wrote:
> > On Tue, 2007-02-06 at 10:09 -0800, Jim Lucas wrote:
> >> Chris Carter wrote:
> >>> Hi,
> >>>
> >>> I am looking for a way to open a preview window. This should be a seperate
> >>> pop-up but within the same page. The moment the user clicks for say "more
> >>> details »" .. this should not open a next page or a pop-up window but a
> >>> dhtml transparent window that has the short discription. This window might
> >>> display onclick just below the "more details »" link.
> >>>
> >>> Has anyone come across this ever. Please assist with a link or with your
> >>> advice. Sorry about posting on PHP-General though its HTML thing.
> >>>
> >>> Thanks,
> >> This is what i found a few years ago. Check it out
> >>
> >> http://www.brainjar.com/dhtml/windows/
> >
> > Junk! Doesn't work in Opera :/
> >
> > :)
> >
> > Cheers,
> > Rob.
>
> Was there a requirement given that it had to work in Opera. No, he just
> asked if anybody had come across this feature. Maybe it works in Opera,
> maybe it doesn't. I didn't see that as a requirement. But then again,
> what about the people that use Lynx, how is he going to work that one?
> Oh, that wasn't a requirement either.
>
> This is just one example of how it can be done.
>
> That is what he asked for.
I dunno... works fine via wget :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. |
`------------------------------------------------------------'
attached mail follows:
Robert Cummings wrote:
> On Tue, 2007-02-06 at 13:05 -0800, Jim Lucas wrote:
>> Robert Cummings wrote:
>>> On Tue, 2007-02-06 at 10:09 -0800, Jim Lucas wrote:
>>>> Chris Carter wrote:
>>>>> Hi,
>>>>>
>>>>> I am looking for a way to open a preview window. This should be a seperate
>>>>> pop-up but within the same page. The moment the user clicks for say "more
>>>>> details »" .. this should not open a next page or a pop-up window but a
>>>>> dhtml transparent window that has the short discription. This window might
>>>>> display onclick just below the "more details »" link.
>>>>>
>>>>> Has anyone come across this ever. Please assist with a link or with your
>>>>> advice. Sorry about posting on PHP-General though its HTML thing.
>>>>>
>>>>> Thanks,
>>>> This is what i found a few years ago. Check it out
>>>>
>>>> http://www.brainjar.com/dhtml/windows/
>>> Junk! Doesn't work in Opera :/
>>>
>>> :)
>>>
>>> Cheers,
>>> Rob.
>> Was there a requirement given that it had to work in Opera. No, he just
>> asked if anybody had come across this feature. Maybe it works in Opera,
>> maybe it doesn't. I didn't see that as a requirement. But then again,
>> what about the people that use Lynx, how is he going to work that one?
>> Oh, that wasn't a requirement either.
>>
>> This is just one example of how it can be done.
>>
>> That is what he asked for.
>
> I dunno... works fine via wget :B
>
> Cheers,
> Rob.
I didn't know that you could view a popup in wget. I'll have to try
that.. :)
--
Enjoy,
Jim Lucas
Different eyes see different things. Different hearts beat on different
strings. But there are times for you and me when all such things agree.
- Rush
attached mail follows:
On Tue, 2007-02-06 at 13:16 -0800, Jim Lucas wrote:
> Robert Cummings wrote:
> > On Tue, 2007-02-06 at 13:05 -0800, Jim Lucas wrote:
> >> Robert Cummings wrote:
> >>> On Tue, 2007-02-06 at 10:09 -0800, Jim Lucas wrote:
> >>>> Chris Carter wrote:
> >>>>> Hi,
> >>>>>
> >>>>> I am looking for a way to open a preview window. This should be a seperate
> >>>>> pop-up but within the same page. The moment the user clicks for say "more
> >>>>> details »" .. this should not open a next page or a pop-up window but a
> >>>>> dhtml transparent window that has the short discription. This window might
> >>>>> display onclick just below the "more details »" link.
> >>>>>
> >>>>> Has anyone come across this ever. Please assist with a link or with your
> >>>>> advice. Sorry about posting on PHP-General though its HTML thing.
> >>>>>
> >>>>> Thanks,
> >>>> This is what i found a few years ago. Check it out
> >>>>
> >>>> http://www.brainjar.com/dhtml/windows/
> >>> Junk! Doesn't work in Opera :/
> >>>
> >>> :)
> >>>
> >>> Cheers,
> >>> Rob.
> >> Was there a requirement given that it had to work in Opera. No, he just
> >> asked if anybody had come across this feature. Maybe it works in Opera,
> >> maybe it doesn't. I didn't see that as a requirement. But then again,
> >> what about the people that use Lynx, how is he going to work that one?
> >> Oh, that wasn't a requirement either.
> >>
> >> This is just one example of how it can be done.
> >>
> >> That is what he asked for.
> >
> > I dunno... works fine via wget :B
> >
> > Cheers,
> > Rob.
>
> I didn't know that you could view a popup in wget. I'll have to try
> that.. :)
*grin* And I was only joking in the first response also ;)
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. |
`------------------------------------------------------------'
attached mail follows:
Robert Cummings skrev:
> I sincerely question the competence of someone who advocates a one size
> fits all approach to programming. There are many reasons why a developer
> may work with the old-school interface calls. For instance they may be
> supporting an old school application. They might be writing their own
> abstract layer. They might be optimizing an extremely loaded system
> whereby explicitly using the API calls improves speed. Prepared
> statements only improve speed when making multiple queries to the
> database having the same format. They slow things down when making
> unique queries. Any developer worth his salt doesn't need prepared
> statements to improve security, and assuming prepared statements will
> protect you is silly since they cannot protect against everything. A
> professional knows when to use any given approach given the environment
> and requirements.
>
> Cheers,
> Rob.
So I was perhaps a bit inflammatory in my post. But I do not see myself
completely rebutted.
1. Maintaining legacy apps does not fall under the categories I was
referring to. If you are bound by legacy constraints it is another ballgame.
2. In a short mail like this one there is not room to expand every
minute detail. I do realise that PDO is not the best way to go for every
app. But in saying that prepared statements is a really good way to
protect against SQL-injection, I'm just echoing Ilia Alshanetsky
(spelling?) and a few other rather renowned security experts. Of course
one should always have a "defense in depth", though.
3. Speed loss from prepared statements are usually negligible even for a
single query. There are tests published on the net. And if one wants
speed, one should probably consider a caching layer between PHP and ones
DBMS. The OO-model in PHP 5 would make such multi tiered apps simpler to
develop as well.
The question PHP 4 or PHP 5: If you stay with 4 you are bound to a one
size fits all solution. In PHP 5 you can use DB-specific drivers or PDO
or a PHP-based abstraction layer. That's *more* choice, not less!
To summarize: With PDO or mysqli I can use both old school SQL and
prepared statements, in PHP 4 there are fewer options! My case for PHP 5
stands intact.
And finally: With each new release of PHP we can expect improvements in
PDO, making it a more future safe alternative.
Lars Gunther
attached mail follows:
On Tue, 2007-02-06 at 23:45 +0100, Keryx Web wrote:
>
> The question PHP 4 or PHP 5: If you stay with 4 you are bound to a one
> size fits all solution. In PHP 5 you can use DB-specific drivers or PDO
> or a PHP-based abstraction layer. That's *more* choice, not less!
>
> To summarize: With PDO or mysqli I can use both old school SQL and
> prepared statements, in PHP 4 there are fewer options! My case for PHP 5
> stands intact.
>
> And finally: With each new release of PHP we can expect improvements in
> PDO, making it a more future safe alternative.
Could you point out to me where exactly the discussion became about PHP4
versus PHP5? I seem to be smelling the red herring technique of changing
the conversation focus so as to inappropriately lend credence to the
initial argument because the secondary red herring argument can be
argued more in your favour despite its irrelevance.
http://en.wikipedia.org/wiki/Red_herring
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. |
`------------------------------------------------------------'
attached mail follows:
Law of mass tonnage - better to be in the big motorized vehicle then the
little one when *crunch* happens.
Respectfully,
Ligaya Turmelle
Systems Analyst
Guamcell Communications
Phone: (671)689-2377
-----Original Message-----
From: Stut [mailto:stuttle
gmail.com]
Sent: Tuesday, February 06, 2007 2:55 AM
To: tedd
Cc: php-general
lists.php.net
Subject: Re: [PHP] PHP5 & Commercial Development
tedd wrote:
> At 12:06 AM -0500 2/5/07, Craige Leeder wrote:
>> PHP is fine for commercial environments. Many people are just afraid
>> of it due to the fact it is known to break some poorly written PHP 4
>> scripts, and the fact that many people don't think it's new features
>> are "necessary". It is perfectly fine to use it in a commercial
>> environment however.
>
> I feel the same way about cars. There are some terrible drivers out
> there, so we should all take the bus.
Won't work. There are some *really* terrible bus drivers out there.
-Stut
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
attached mail follows:
# ceo
l-i-e.com / 2007-02-05 18:09:21 -0600:
> GET args can be truncated at some number, if the server does not want
> to allow longer args. I believe the minimum compliant limit is 1024
> bytes.
Since you asked for a reference in the other post: HTTP/1.1 tries to be
as general as possible, and doesn't impose limits on line lengths. Some
commented quotes follow, I hope it's digestible.
# 3.2.1 General Syntax
#
# URIs in HTTP can be represented in absolute form or relative to some
# known base URI [11], depending upon the context of their use. The two
# forms are differentiated by the fact that absolute URIs always begin
# with a scheme name followed by a colon. For definitive information on
# URL syntax and semantics, see "Uniform Resource Identifiers (URI):
# Generic Syntax and Semantics," RFC 2396 [42] (which replaces RFCs
# 1738 [4] and RFC 1808 [11]). This specification adopts the
# definitions of "URI-reference", "absoluteURI", "relativeURI", "port",
# "host","abs_path", "rel_path", and "authority" from that
# specification.
RFC 2396 doesn't mention any length limits.
# The HTTP protocol does not place any a priori limit on the length of
# a URI. Servers MUST be able to handle the URI of any resource they
# serve, and SHOULD be able to handle URIs of unbounded length if they
# provide GET-based forms that could generate such URIs.
Case closed. If there's no "a priori limit on the length of a URI",
then there isn't any limit on the length of the request line, the
Location response header, or the Content-Location entity header.
# A server
# SHOULD return 414 (Request-URI Too Long) status if a URI is longer
# than the server can handle (see section 10.4.15).
"10.4.15 414 Request-URI Too Long" doesn't add anything interesting.
# 4 HTTP Message
#
# 4.1 Message Types
#
# HTTP messages consist of requests from client to server and responses
# from server to client.
#
# HTTP-message = Request | Response ; HTTP/1.1 messages
#
# Request (section 5) and Response (section 6) messages use the generic
# message format of RFC 822 [9] for transferring entities (the payload
# of the message).
The keyword is "entities". Applying the email-specific header length
limit to a HTTP implementation would IMO be a mistake. For
completeness, RFC 822:
# 3.4.8. FOLDING LONG HEADER FIELDS
#
# Each header field may be represented on exactly one line con-
# sisting of the name of the field and its body, and terminated
# by a CRLF; this is what the parser sees. For readability, the
# field-body portion of long header fields may be "folded" onto
# multiple lines of the actual field. "Long" is commonly inter-
# preted to mean greater than 65 or 72 characters. The former
# length serves as a limit, when the message is to be viewed on
# most simple terminals which use simple display software; how-
# ever, the limit is not imposed by this standard.
As you can see, the standard specifically disclaims a length limit. The
998-character limit you mentioned (IIRC) in another post comes from
RFC 2822 (replaces 822), which imposes it for compatibility with legacy
systems which could not handle lines longer than 1000 characters
(RFC 2822, 2.1.1. Line Length Limits):
# The 998 character limit is due to limitations in many implementations
# which send, receive, or store Internet Message Format messages that
# simply cannot handle more than 998 characters on a line. Receiving
# implementations would do well to handle an arbitrarily large number
# of characters in a line for robustness sake.
This limitation doesn't apply to HTTP, that'd conflict with the unbound
URI statement in 3.2.1.
As for the server side: Status codes 413 and 414 are SHOULD, but any
server which silently truncates either the request URI or the request
entity has serious interoperability problems.
Summary
There are no limits on line length in HTTP, servers need to be able to
handle anything they need to work, and clients need to support headers
as long as they want to send.
HTTP/1.1 doesn't address URI or entity truncation in user agents
specifically, that's simply a bug, not a protocol violation.
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
attached mail follows:
Hey all,
Just did a new install on FreeBSD 6.0 of Apache 2,
PHP4 and MySQL, but the browser asks to save a PHP
file rather than execute it. I do have the
following in httpd.conf, however.
LoadModule php4_module libexec/apache2/libphp4.so
DirectoryIndex index.php index.html index.htm
index.html.var
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Now I'm wondering if somehow PHP4 got compiled
without the Apache module selected?
Does that sound accurate? I did check it off when
the compile began however.
--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and
versatile PHP/MySQL development framework.
http://phpenguin.bigskypenguin.com/
attached mail follows:
On Tue, 2007-02-06 at 16:15 -0700, Skip Evans wrote:
> Hey all,
>
> Just did a new install on FreeBSD 6.0 of Apache 2,
> PHP4 and MySQL, but the browser asks to save a PHP
> file rather than execute it. I do have the
> following in httpd.conf, however.
>
> LoadModule php4_module libexec/apache2/libphp4.so
>
> DirectoryIndex index.php index.html index.htm
> index.html.var
>
> AddType application/x-httpd-php .php
> AddType application/x-httpd-php-source .phps
>
> Now I'm wondering if somehow PHP4 got compiled
> without the Apache module selected?
>
> Does that sound accurate? I did check it off when
> the compile began however.
Anything in your apache logs? Did you restart the webserver? Did you
compile yourself?
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. |
`------------------------------------------------------------'
attached mail follows:
Nothing in the log file. Did restart the web
server, and yes, I'm compiling this myself.
The log file is actually not being touched. I
think it failed to compile the apache module on
the last attempt (it stopped before because I was
not subscribed to a paypal module I tried to
include), so I need to somehow get back to where
it will ask me to compile the Apache module, but
doing
make deinstall clean
does not do it.
Skip
Robert Cummings wrote:
> On Tue, 2007-02-06 at 16:15 -0700, Skip Evans wrote:
>> Hey all,
>>
>> Just did a new install on FreeBSD 6.0 of Apache 2,
>> PHP4 and MySQL, but the browser asks to save a PHP
>> file rather than execute it. I do have the
>> following in httpd.conf, however.
>>
>> LoadModule php4_module libexec/apache2/libphp4.so
>>
>> DirectoryIndex index.php index.html index.htm
>> index.html.var
>>
>> AddType application/x-httpd-php .php
>> AddType application/x-httpd-php-source .phps
>>
>> Now I'm wondering if somehow PHP4 got compiled
>> without the Apache module selected?
>>
>> Does that sound accurate? I did check it off when
>> the compile began however.
>
> Anything in your apache logs? Did you restart the webserver? Did you
> compile yourself?
>
> Cheers,
> Rob.
--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and
versatile PHP/MySQL development framework.
http://phpenguin.bigskypenguin.com/
attached mail follows:
Skip Evans wrote:
> Hey all,
>
> Just did a new install on FreeBSD 6.0 of Apache 2, PHP4 and MySQL, but
> the browser asks to save a PHP file rather than execute it. I do have
> the following in httpd.conf, however.
>
> LoadModule php4_module libexec/apache2/libphp4.so
Is that the right path to the file? Does that file exist? What
permissions are on it?
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
On Tue, 06 Feb 2007 16:42:03 -0700
Skip Evans <skip
bigskypenguin.com> wrote:
> Nothing in the log file. Did restart the web
> server, and yes, I'm compiling this myself.
>
> The log file is actually not being touched. I
> think it failed to compile the apache module on
> the last attempt (it stopped before because I was
> not subscribed to a paypal module I tried to
> include), so I need to somehow get back to where
> it will ask me to compile the Apache module, but
> doing
>
> make deinstall clean
>
> does not do it.
delete /var/db/ports/php*/options and 'make install clean' again.
HTH,
G
attached mail follows:
On Tue, 2007-02-06 at 15:59 -0800, Greg Maruszeczka wrote:
> On Tue, 06 Feb 2007 16:42:03 -0700
> Skip Evans <skip
bigskypenguin.com> wrote:
>
> > Nothing in the log file. Did restart the web
> > server, and yes, I'm compiling this myself.
> >
> > The log file is actually not being touched. I
> > think it failed to compile the apache module on
> > the last attempt (it stopped before because I was
> > not subscribed to a paypal module I tried to
> > include), so I need to somehow get back to where
> > it will ask me to compile the Apache module, but
> > doing
> >
> > make deinstall clean
> >
> > does not do it.
>
>
> delete /var/db/ports/php*/options and 'make install clean' again.
I always cleanup with:
shell> rm config.cache
shell> make clean
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. |
`------------------------------------------------------------'
attached mail follows:
Yes, the file name and path are correct. Apache
will give an error upon restart if they are not.
Chris wrote:
> Skip Evans wrote:
>> Hey all,
>>
>> Just did a new install on FreeBSD 6.0 of Apache 2, PHP4 and MySQL, but
>> the browser asks to save a PHP file rather than execute it. I do have
>> the following in httpd.conf, however.
>>
>> LoadModule php4_module libexec/apache2/libphp4.so
>
> Is that the right path to the file? Does that file exist? What
> permissions are on it?
>
--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and
versatile PHP/MySQL development framework.
http://phpenguin.bigskypenguin.com/
attached mail follows:
Even do the deinstall I get this:
===> Checking if misc/php4-calendar already installed
===> php4-calendar-4.4.4_1 is already installed
You may wish to ``make deinstall'' and
install this port again
by ``make reinstall'' to upgrade it properly.
If you really wish to overwrite the old
port of misc/php4-calendar
without deleting it first, set the variable
"FORCE_PKG_REGISTER"
in your environment or the "make install"
command line.
*** Error code 1
AAAAAaaaarrrrggghhhhh!!!!
How do I clean up the hold install completely?
Skip
Robert Cummings wrote:
> On Tue, 2007-02-06 at 15:59 -0800, Greg Maruszeczka wrote:
>> On Tue, 06 Feb 2007 16:42:03 -0700
>> Skip Evans <skip
bigskypenguin.com> wrote:
>>
>>> Nothing in the log file. Did restart the web
>>> server, and yes, I'm compiling this myself.
>>>
>>> The log file is actually not being touched. I
>>> think it failed to compile the apache module on
>>> the last attempt (it stopped before because I was
>>> not subscribed to a paypal module I tried to
>>> include), so I need to somehow get back to where
>>> it will ask me to compile the Apache module, but
>>> doing
>>>
>>> make deinstall clean
>>>
>>> does not do it.
>>
>> delete /var/db/ports/php*/options and 'make install clean' again.
>
> I always cleanup with:
>
> shell> rm config.cache
> shell> make clean
>
> Cheers,
> Rob.
--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and
versatile PHP/MySQL development framework.
http://phpenguin.bigskypenguin.com/
attached mail follows:
I am trying to use this code to display a button at the root but it
always displays the button. :-(
if (! (preg_match( "/$\/index.php/", $_SERVER['PHP_SELF'] ))) {
# display a button
....
attached mail follows:
On Tue, February 6, 2007 7:46 pm, James Lockie wrote:
> I am trying to use this code to display a button at the root but it
> always displays the button. :-(
>
> if (! (preg_match( "/$\/index.php/", $_SERVER['PHP_SELF'] ))) {
Without any "modifier", $ matches the END of the string.
It is impossible to have the end of the string followed by more stuff.
You maybe meant to add 'm' and or 's' after the ending '/', which
would indicate that you are looking for a newline followed by
'\/index.php' but I doubt that that is what you want either...
I don't think you want the $ in there at all...
Or maybe you want it right before the final '/' to make sure the URL
has nothing else after the 'index.php' part.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
James Lockie wrote:
> I am trying to use this code to display a button at the root but it
> always displays the button. :-(
>
> if (! (preg_match( "/$\/index.php/", $_SERVER['PHP_SELF'] ))) {
> # display a button
> ....
>
You got the end-of-string character ($) in the wrong place:
if (! (preg_match( "/\/index.php$/", $_SERVER['PHP_SELF'] ))) {
--
_____________________
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]