]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/common.php
Merge branch 'testing-sig' of gitorious.org:~brion/statusnet/brion-fixes into testing
[quix0rs-gnu-social.git] / lib / common.php
index 22890b5cb751d8e0336953e10f4d0e72e7e00546..4861731dfdd2d348607980f63dbe2f79876575d7 100644 (file)
@@ -95,7 +95,11 @@ function _have_config()
     return StatusNet::haveConfig();
 }
 
-function __autoload($cls)
+/**
+ * Wrapper for class autoloaders.
+ * This used to be the special function name __autoload(), but that causes bugs with PHPUnit 3.5+
+ */
+function autoload_sn($cls)
 {
     if (file_exists(INSTALLDIR.'/classes/' . $cls . '.php')) {
         require_once(INSTALLDIR.'/classes/' . $cls . '.php');
@@ -111,6 +115,8 @@ function __autoload($cls)
     }
 }
 
+spl_autoload_register('autoload_sn');
+
 // XXX: how many of these could be auto-loaded on use?
 // XXX: note that these files should not use config options
 // at compile time since DB config options are not yet loaded.