Hi there guys,

I'm running the final tests on my script, and I ran an install on my older server(php 4.2.2), and where I'm checking a remote server for an update, it's failing:

Fatal error: Call to undefined function: file_get_contents() in /path/to/automonial/admin/index.php on line 956

I would like to allow versions of php < 4.3.0 to be able to check for updates. Is it possible?

If it's not possible, How could I get the script to detect that their php won't handle the request, and thus not perform it?

thanks very much for your time,
json

    Hi there, and thanks very much.

    I believe I'm going to leave the script compatible with 4.3.0 & < only because my stripping method for html utilizes html_entity_decode, which wasn't available prior to that, and I'm not dandy enough to figure out how to write it without.

    weedpacket(I believe) told me how old 4.3.0 is, and it seems like that's a safe age to write for. There can't be a lot of people using older versions. I hope.

    thanks,
    json

      if(!function_exists('file_get_contents')) {
         function file_get_contents($filename) {
            return explode('', file($filename));
         }
      }
        mjax wrote:
        if(!function_exists('file_get_contents')) {
           function file_get_contents($filename) {
              return explode('', file($filename));
           }
        }

        Shouldn't that be implode() ??

          You are completely right! I never test my code suggestions...

            Write a Reply...