Jump to content

Ignore parse error on include?


EmperorcJ

Recommended Posts

Is there a way to ignore parse errors when calling an include? That is, the script calls include("file.php"), but if file.php has a parse error, the script just ignores the include and moves on.

 

If you need specifics, I'm running an AIM bot and I have it so I can update part of the bot's functionality while it's still running.

 

It looks something like this:

 

...

while(1)
{
// check for new data 
        ...

        // respond to data
include("flamingcactus.php");

}

 

And the included file looks something like this:

 

...
if($message=="asdfghjk") sendIM("what");
else if($message=="etrtyhfds") sendIM("oh");
...

 

Every now and then I'll make a typo though and the whole program will crash, and I'll have to restart the bot and log in again. I'd rather just ignore the included file.

 

Try/catch didn't work.

 

I running php 5.2.5 on a windows machine.

Link to comment
https://forums.phpfreaks.com/topic/78223-ignore-parse-error-on-include/
Share on other sites

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.