On 4-12-2010 10:17, Jonathan Martens wrote:
On 4-12-2010 10:01, Jonathan Martens wrote:
I have been able to manually fix it with the work-around in attached
patch. Any change that can be applied to the EL5 build?

Re-attaching the patch as some strange layout issues seem to appear in
the previous one. This should be properly formatted.

Once more... sigh. This should also load the file properly as I forgot that in the previous versions.

Kind regards,

Jonathan
Index: mythweb/includes/compat.php
===================================================================
--- mythweb/includes/compat.php (revision 0)
+++ mythweb/includes/compat.php (revision 0)
@@ -0,0 +1,49 @@
+<?php
+
+if ( !function_exists( 'get_called_class' ) ) {
+  function get_called_class( $bt = false, $l = 1 )
+  {
+    if ( !$bt ) $bt = debug_backtrace();
+    if ( !isset( $bt[$l] ) ) throw new Exception( "Cannot find called class -> 
stack level too deep." );
+    if ( !isset( $bt[$l]['type'] ) ) {
+      throw new Exception ( 'type not set' );
+    } else switch ( $bt[$l]['type'] ) {
+      case '::':
+        $lines = file( $bt[$l]['file'] );
+        $i = 0;
+        $callerLine = '';
+        do {
+          $i++;
+          $callerLine = $lines[$bt[$l]['line'] - $i] . $callerLine;
+        } while ( stripos( $callerLine, $bt[$l]['function'] ) === false
+);
+        preg_match( '/([a-zA-Z0-9\_]+)::' . $bt[$l]['function'] . '/',
+          $callerLine,
+          $matches );
+        if ( !isset( $matches[1] ) ) {
+          // must be an edge case.
+          throw new Exception ( "Could not find caller class: originating 
method call is obscured." );
+        }
+        switch ( $matches[1] ) {
+          case 'self':
+          case 'parent':
+            return get_called_class( $bt, $l + 1 );
+          default:
+            return $matches[1];
+        }
+        // won't get here.
+      case '->': switch ( $bt[$l]['function'] ) {
+          case '__get':
+            // edge case -> get class of calling object
+            if ( !is_object( $bt[$l]['object'] ) ) throw new
+              Exception ( "Edge case fail. __get called on non object.");
+            return get_class( $bt[$l]['object'] );
+          default: return $bt[$l]['class'];
+        }
+
+      default: throw new Exception ( "Unknown backtrace method type" );
+    }
+  }
+}
+
+?>
\ No newline at end of file
Index: mythweb/includes/init.php
===================================================================
--- mythweb/includes/init.php   (revision 27408)
+++ mythweb/includes/init.php   (working copy)
@@ -16,6 +16,9 @@
  *
 /**/
 
+// Attempt to load for backwards compatability
+    require_once('compat.php');
+
 // Attempt to load up firephp if installed on the server
     @include_once('FirePHPCore/fb.php');
 
Index: mythweb/includes/php_version_check.php
===================================================================
--- mythweb/includes/php_version_check.php      (revision 27408)
+++ mythweb/includes/php_version_check.php      (working copy)
@@ -12,7 +12,7 @@
  * @package     MythWeb
  *
 /**/
-    define('PHP_MIN_VERSION', floatval(5.3));
+    define('PHP_MIN_VERSION', floatval(5.1));
 
 // Make sure we're running a new enough version of php
     if (floatval(substr(phpversion(), 0, 3)) < PHP_MIN_VERSION)
_______________________________________________
atrpms-devel mailing list
atrpms-devel@atrpms.net
http://lists.atrpms.net/mailman/listinfo/atrpms-devel

Reply via email to