Ejemplo n.º 1
0
 public static function init($config = NULL)
 {
     self::$extensions = array();
     if (is_null($config)) {
         $config = MANIFEST . '/extensions.xml';
     }
     if (!file_exists($config)) {
         self::$extension_configuration = new SimpleXMLElement('<extensions></extensions>');
     } else {
         $previous = libxml_use_internal_errors(true);
         self::$extension_configuration = simplexml_load_file($config);
         libxml_use_internal_errors($previous);
         if (!self::$extension_configuration instanceof SimpleXMLElement) {
             throw new ExtensionException('Failed to load Extension configuration file ' . $config);
         }
     }
 }