]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/common.php
Switch autoloader from '__autoload' magic function name to registering our function...
[quix0rs-gnu-social.git] / lib / common.php
index 6138200e49880f2da1688049613ac9d366025df5..b072a4969963a9ca1c23e3c14287996f349afd8f 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.