FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » newbie question: Is config.php necessary?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: newbie question: Is config.php necessary? [message #170633 is a reply to message #170623] Fri, 12 November 2010 10:27 Go to previous messageGo to previous message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma:
Senior Member
On 11/11/2010 7:40 PM, Thomas Mlynarczyk wrote:
> Erwin Moller schrieb:
> [magic_quotes_gpc cannot be set at runtime]
>> Correct. That was confusing.
>> But it is there for a reason. ;-)
>> The reason it is there anyway is: the following block (that checks the
>> values) produces an error in case magic_quotes_gpc is on.
>

Hi Thomas,


> Okay, but actually, why bother since you can access the raw data using
> filter_input() even with magic_quotes_gpc on:
>
> // http://localhost/test.php?value=It's+a+"test"
> var_dump( filter_input( INPUT_GET, 'value', FILTER_UNSAFE_RAW ) );
> var_dump( @$_GET['value'] );
>
> Output:
> string 'It's a "test"' (length=13)
> string 'It\'s a \"test\"' (length=16)

Why?
Because I consider:
filter_input( INPUT_GET, 'value', FILTER_UNSAFE_RAW )
a horrible construct compared to:
$_GET["value"];

I prefer using the superglobals directly.
(But that might be just me: Each to his own of course!)


>> (I had a few more ini-values in there, but cut a lot out. The code was
>> only posted to show the idea of the kind of things you can do in a
>> 'global config' file.)
>
> Indeed, that gave me some inspiration for my own global setup stuff. :-)
>

Glad to hear something good came out of this thread, since I didn't hear
the OP respond. :-)


> [Use E_ALL | E_STRICT, not just E_ALL]
>> Yes, I am aware of E_ALL and E_STRICT: this examplecode comes from a
>> project where I didn't want strict errors to error out.
>
> Yes, sometimes one has to work with projects like this (SimpleTest, for
> example is not "strict proof"). :-(

Not to mention some of my own older code. :P

You probably know the situation: A huge website, written in PHP4.3 many
years ago, and the client doesn't understand why you want to rewrite the
whole thing, and says: "It works, doesn't it? So simply add this and
that functionality. I don't want to spend a lot of money on a rewrite.".

Sometimes I wished I could just ditch some old projects of mine.
But it pays for my pizza. ;-)

Regards,
Erwin Moller

>
> Greetings,
> Thomas
>


--
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Variable expansion <?=$foo?> not working anymore
Next Topic: need urgent help
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 04:36:43 GMT 2024

Total time taken to generate the page: 0.03821 seconds