Module: nagvis
Branch: master
Commit: 200ac4532d35a043c520887d2b075c944eac2819
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=200ac4532d35a043c520887d2b075c944eac2819

Author: Lars Michelsen <[email protected]>
Date:   Mon Oct 19 23:41:39 2009 +0200

The old autoloader hat some problems with the autoloaders of external librarys; 
Needed to recode it

---

 share/server/core/functions/autoload.php |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/share/server/core/functions/autoload.php 
b/share/server/core/functions/autoload.php
index 276869c..32ec74f 100644
--- a/share/server/core/functions/autoload.php
+++ b/share/server/core/functions/autoload.php
@@ -1,9 +1,9 @@
 <?php
 /*****************************************************************************
  *
- * autoload.php - Class for defining the __autoload method
+ * autoload.php - Class for defining the autoload method for NagVis
  *
- * Copyright (c) 2004-2008 NagVis Project (Contact: [email protected])
+ * Copyright (c) 2004-2009 NagVis Project (Contact: [email protected])
  *
  * License:
  *
@@ -23,13 +23,21 @@
  *****************************************************************************/
  
 /**
- * Load required files
+ * Load required files for NagVis. This autoloader has no compatibility
+ * problem with other autoloaders from external code
  *
- * @param      string  $class
- * @author  Michael Luebben <[email protected]>
+ * @param   String  Name of the requested class
+ * @author     Lars Michelsen <[email protected]>
  */
-function __autoload($class) {
-       require($class.'.php');
+function NagVisAutoload($sClass) {
+       if(substr($sClass, 0, 8) === 'Frontend' || substr($sClass, 0, 4) === 
'Core' || substr($sClass, 0, 6) === 'NagVis' || substr($sClass, 0, 6) === 
'Global') {
+               require($sClass.'.php');
+               return true;
+       } else {
+               return false;
+       }
 }
 
+spl_autoload_register('NagVisAutoload');
+
 ?>


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to