<?php

include_once "htmllib/lib/include.php";
__xenimport_get_data();
function isXencfgSkip($l)
{
    if (is_dir("/etc/xen/{$l}")) {
        return true;
    }
    if (csb($l, "xend-")) {
        return true;
    }
    if (csb($l, "xmexample")) {
        return true;
    }
    if (csb($l, "qemu-")) {
        return true;
    }
    if (csa($l, "windows.hvm")) {
        return true;
    }
    return false;
}
function __xenimport_get_data()
{
    lxfile_mkdir("/home/oldxenconfig-hypervm");
    $list = lscandir_without_dot("/etc/xen");
    foreach ($list as $l) {
        if (isXencfgSkip($l)) {
            continue;
        }
 function importVps()
 {
     global $gbl, $sgbl, $login, $ghtml;
     $objlist = null;
     if ($this->main->__var_vps_driver === 'openvz') {
         if (!lxfile_exists("/etc/vz/conf")) {
             throw new lxException("no_vz_conf_directory", '');
         }
         $list = lscandir_without_dot_or_underscore("/etc/vz/conf");
         foreach ($list as $l) {
             if (!cse($l, ".conf")) {
                 continue;
             }
             if ($l === '0.conf') {
                 continue;
             }
             $object = vps__openvz::createVpsObject($this->main->nname, $l);
             $objlist[$object->nname] = $object;
         }
     } else {
         lxshell_return("chkconfig", "xendomains", "on");
         //lxshell_return("service", "xendomains", "restart");
         $imdriver = $this->main->__var_xenimportdriver;
         $importdriverfile = "{$sgbl->__path_program_htmlbase}/lib/xenimport/xenimport__{$imdriver}.php";
         if (!lxfile_exists($importdriverfile)) {
             throw new lxException("could_not_find_xen_import_driver_file", '');
         }
         include_once $importdriverfile;
         if (!function_exists("__xenimport_get_data")) {
             throw new lxException("no_xenimport_function", '');
         }
         $data = __xenimport_get_data();
         foreach ((array) $data as $input) {
             $object = vps__xen::createVpsObject($this->main->nname, $input);
             $objlist[$object->nname] = $object;
         }
     }
     return $objlist;
 }