public static function &getInstance()
 {
     $args = func_get_args();
     $module = array_shift($args);
     $path = ClsNaanalApplication::getLibraryModulePath($module);
     if ($path === false) {
         $success = false;
         self::$arrErrorStatic[] = array("message" => "Library class {$module} not exist");
         return $success;
     }
     $moduleclass = "ClsL" . ucfirst($module);
     $class = "ClsL" . ucfirst($module);
     $path = rtrim($path, "/\\");
     if (file_exists($path . "/config.php")) {
         include $path . "/config.php";
         if (isset($lib_php_dir)) {
             if (file_exists($lib_php_dir)) {
                 $lib_php_dir = rtrim($lib_php_dir, "/\\");
                 if (isset($lib_php_file) && is_array($lib_php_file)) {
                     foreach ($lib_php_file as $tmpArr) {
                         $external_file = $tmpArr["file"];
                         //$external_class=$tmpArr["class"];
                         $external_include_file = "{$lib_php_dir}/{$external_file}";
                         if (!file_exists($external_include_file)) {
                             die("Library {$module} include file '{$external_include_file}' not exist");
                         }
                         include_once $external_include_file;
                     }
                 } else {
                     if (!isset($lib_php_file)) {
                         die("Library {$module}'s include file has to be defined. \n<pre>Ex: \$lib_php_file=array\n(\n'include'=>array('file'=>'include php file','class'=>'php class to include')\n);</pre>");
                     } else {
                         die("Library {$module}'s include file must be an array. \n<pre>Ex: \$lib_php_file=array\n(\n'include'=>array('file'=>'include php file','class'=>'php class to include')\n);</pre>");
                     }
                 }
             } else {
                 die("Library {$module} missing at {$lib_php_dir}");
             }
         }
     }
     if (file_exists($path . "/utils.php")) {
         include_once $path . "/utils.php";
     }
     $include_file = $path . "/" . $class . ".php";
     self::validate($include_file, $class);
     if (self::$arrValidate) {
         print_r(self::$arrValidate);
         exit;
     }
     include_once $include_file;
     if ($args) {
         $arrArg = array();
         foreach ($args as $ind => $arg) {
             $arrArg["key{$ind}"] = $arg;
         }
         extract($arrArg);
         $class = $class . '(';
         foreach ($args as $ind => $arg) {
             if ($ind === 0) {
                 $class = $class . "\$key{$ind}";
             } else {
                 $class = $class . ",\$key{$ind}";
             }
         }
         $class = $class . ')';
     }
     eval('$obj=new ' . $class . ';');
     return $obj;
 }