示例#1
0
 public static function refresh()
 {
     list($system, $oses, $dvds, $fdds, $hdds, $machines) = self::visit(new SimpleXMLElement(captureExec(VIRTUALBOX_XML_BIN, array('--base', BASE_PATH))));
     self::$system = $system;
     self::$oses = array();
     foreach ($oses as $os) {
         self::$oses[$os->id] = $os;
     }
     uasort(self::$oses, array('Repository', 'sortByName'));
     self::$dvds = array();
     foreach ($dvds as $dvd) {
         self::$dvds[$dvd->path] = $dvd;
     }
     uasort(self::$dvds, array('Repository', 'sortByName'));
     self::$fdds = array();
     foreach ($fdds as $fdd) {
         self::$fdds[$fdd->path] = $fdd;
     }
     uasort(self::$fdds, array('Repository', 'sortByName'));
     self::$hdds = array();
     foreach ($hdds as $hdd) {
         self::$hdds[$hdd->path] = $hdd;
     }
     uasort(self::$hdds, array('Repository', 'sortByName'));
     self::$machines = array();
     foreach ($machines as $machine) {
         self::$machines[$machine->id] = $machine;
     }
     uasort(self::$machines, array('Repository', 'sortByName'));
     self::$ovas = array();
     self::visitExports(BASE_PATH . '/exports');
     sort(self::$ovas);
     return TRUE;
 }
示例#2
0
 protected function onRefresh()
 {
     return Repository::visitVariables(new SimpleXMLElement(captureExec(VIRTUALBOX_XML_BIN, array('--base', BASE_PATH, '--hdd', $this->values['path']))));
 }