Jump to content

Weird Question, Can I modify a php command?


jscix

Recommended Posts

I'm not sure if this is possible, but what I'm curious about is,

 

Is it possible to modify/redefine how a php command such as DIE works?

 

What I would like to do is have the die command also save the text to a log file, is this possible ?

 

eg:

 

die ("Error",$logfilename);

 

anyone? ::o

You can change the way how die works if you wish. However you will need to know C (or what ever programming language PHP is programmed in).

 

However what I'd do is create a function that will log the error passed to it example

die(log_error('error message here', $errorLog);

ah that is a really good idea. Thank you wild.

 

The reason I asked is I have already done a large amount of work, before deciding that logging errors would end up saving me a whole lot of work later on when something goes wrong/breaks.. So being lazy as I am, I wanted a quick fix so I didn't have to replace all the die commands with a modified version. :/

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.