Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.