<?php
 
class xmlmenu {
 
 
    private function __construct () {
 
        // FORBIDDEN TO CALL THE CONSTRUCTOR ;-)
 
    }
 
 
    public static function getInstance ($sVersion = null, $sEncoding= null) {
 
        if (!class_exists ('DOMDocument')) {
 
            $sInstance = 'xmlmenuhasnone';
 
        } elseif (!class_exists ('XSLTProcessor')) {
 
            $sInstance = 'xmlmenuhasdom';
 
        } else {
 
            $sInstance = 'xmlmenuhasboth';
 
        }
 
        //$sInstance = 'xmlmenuhasnone'; // Just to check wether it works without DOM and XSLT :-) Remove the comments if you want to, too.
 
        require_once 'class/'.$sInstance.'.cls.php';
 
        return new $sInstance ($sVersion, $sEncoding);
 
    }
 
}
 
?>
 
 |