[mythtv-users] Re: MythWeb and PHP5

ndoss at mtlaurel.org ndoss at mtlaurel.org
Thu Aug 19 02:44:02 EDT 2004


Quoting Chris Petersen <lists at forevermore.net>:
> Yup.  The main issue is that the programs class redefines $this inside
> of it.
>
> I'm open to suggestions for fixing this (or actual fixes), but at the
> moment it's low on my list...

For those trying to get php 5 to work, I thought I'd share what I'd found.

I've done two things to get a lot of the pages to work with myth 0.15.1.
I wouldn't call these pretty fixes but they make enough things work well
enough for me to limp along for awhile with php 5.

Major problems that still remain (I'm sure there are other minor problems):
- The server never responds when I go to the backend status page
- I get the following error sometimes when I access the recording schedule
  page:

    Fatal error: Cannot use object of type Recording as array in recordings.php
on line 103

Here are the changes I've made so far:

* Changed the "$this = load_one_program ...." line (line 299) in programs.php
to:

     $tmpVar = load_one_program($this->starttime, $this->chanid);
     foreach (get_object_vars($tmpVar) as $key => $value)
          $this->$key = $value;

* Changed the myth2unixtime function from:

    function myth2unixtime($mythtime) {
        return strtotime(str_replace('T', ' ', $mythtime));
    }

  To:

    function myth2unixtime($mythtime) {
        if (strlen($mythtime)>0)
          return strtotime(str_replace('T', ' ', $mythtime));
        else
          return $mythtime;
    }

   PHP 5.0.1 supposedly fixed a bug in strtotime when the argument is
   0 length but there still appear to be problems.




More information about the mythtv-users mailing list