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 #170637 is a reply to message #170633] Fri, 12 November 2010 15:42 Go to previous messageGo to previous message
Thomas Mlynarczyk is currently offline  Thomas Mlynarczyk
Messages: 131
Registered: September 2010
Karma:
Senior Member
Erwin Moller schrieb:
> Because I consider:
> filter_input( INPUT_GET, 'value', FILTER_UNSAFE_RAW )
> a horrible construct compared to:
> $_GET["value"];

Well, I would, of course, bury this "horrible construct" in a nice
little function or method, for example:

function get( $name, $default = null )
{
return isset( $_GET[$name] )
? filter_input( INPUT_GET, $name, FILTER_UNSAFE_RAW )
: $default;
}

Actually, I would add some check of the retrieved value etc. but the
above is just to give the general idea of hiding the ugly interface of
the filter extension behind some sweet syntactic sugar.

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

Agreed.

> 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.".

I feel you pain. Maybe you could tell the client that the current
architecture does not permit to add the requested functionality easily
and that that would cost much more than than a complete rewrite. Or that
the requested functionality *requires* PHP 5. Or: PHP 4 is no longer
supported, so if there's a problem with it, there will be no one to fix
it. Or: "The requested functionality will make your website so popular
that the increased number of visitors can no longer be handled by the
old server, so you'd have to get a new one and they don't make the PHP4
ones any more..." ;-) Or: "Since PHP4 is no longer supported, I must
charge an extra fee for dealing with legacy code..."

Greetings,
Thomas

--
Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
(Coluche)
[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: Fri Nov 29 16:06:11 GMT 2024

Total time taken to generate the page: 0.05518 seconds