當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Repository::getFdd方法代碼示例

本文整理匯總了PHP中Repository::getFdd方法的典型用法代碼示例。如果您正苦於以下問題:PHP Repository::getFdd方法的具體用法?PHP Repository::getFdd怎麽用?PHP Repository::getFdd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Repository的用法示例。


在下文中一共展示了Repository::getFdd方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: fddParam

function fddParam($key)
{
    if (isset($_REQUEST[$key])) {
        if (strlen($_REQUEST[$key]) > 0) {
            return Repository::getFdd($_REQUEST[$key]);
        }
        return new FDD();
    }
    return NULL;
}
開發者ID:yamdrok,項目名稱:virtualbox-php,代碼行數:10,代碼來源:virtualbox.inc.php

示例2: __get

 public function __get($name)
 {
     switch ($name) {
         // booleans
         case 'bioslogofadein':
         case 'bioslogofadeout':
         case 'acpi':
         case 'ioapic':
         case 'pae':
         case 'hpet':
         case 'rtcuseutc':
         case 'hwvirtex':
             //		case 'hwvirtexexcl':
         //		case 'hwvirtexexcl':
         case 'nestedpaging':
         case 'largepages':
         case 'pagefusion':
         case 'vtxvpid':
         case 'synthcpu':
         case 'accelerate2dvideo':
         case 'accelerate3d':
         case 'usb':
         case 'usbehci':
         case 'vrde':
             return $this->get($name, 'off') == 'on';
             // integers
         // integers
         case 'cpus':
         case 'memory':
         case 'vram':
         case 'bioslogodisplaytime':
         case 'biossystemtimeoffset':
             return intval($this->get($name, '0'));
             // storage controllers
         // storage controllers
         case 'storage0':
         case 'storage1':
         case 'storage2':
         case 'storage3':
         case 'storage4':
         case 'storage5':
         case 'storage6':
         case 'storage7':
             $i = substr($name, 7);
             if (!$this->has('storagecontrollername' . $i)) {
                 break;
             }
             $name = $this->get('storagecontrollername' . $i, '');
             $ports = intval($this->get('storagecontrollerportcount' . $i, '0'));
             $maxdevices = intval($this->get('storagecontrollermaxdeviceperport' . $i, '0'));
             $devices = array();
             for ($j = 0; $j < $ports; $j++) {
                 for ($k = 0; $k < $maxdevices; $k++) {
                     $slot = $name . '-' . $j . '-' . $k;
                     if (!$this->has($slot)) {
                         continue;
                     }
                     if ($this->endsWith($slot, '.vdi') || $this->endsWith($slot, '.vmdk')) {
                         $devices[$j][$k] = Repository::getHdd($this->get($slot));
                     } else {
                         if ($this->get($slot) == 'emptydrive') {
                             $devices[$j][$k] = new DVD();
                         } else {
                             $devices[$j][$k] = Repository::getDvd($this->get($slot));
                         }
                     }
                 }
             }
             return array('name' => $name, 'type' => $this->get('storagecontrollertype' . $i, 'none'), 'instance' => intval($this->get('storagecontrollerinstance' . $i, '0')), 'ports' => array('count' => $ports, 'min' => intval($this->get('storagecontrollerminportcount' . $i, '0')), 'max' => intval($this->get('storagecontrollermaxportcount' . $i, '0')), 'maxdevices' => $maxdevices), 'devices' => $devices);
             // fdd controllers
         // fdd controllers
         case 'fd0':
         case 'fd1':
             $slot = 'FLOPPY-0-0';
             switch ($name) {
                 case 'fd0':
                     $slot = 'FLOPPY-0-0';
                     break;
                 case 'fd1':
                     $slot = 'FLOPPY-0-1';
                     break;
             }
             if (!$this->has($slot)) {
                 break;
             }
             if ($this->get($slot) == 'emptydrive') {
                 return new FDD();
             }
             return Repository::getFdd($this->get($slot));
             // ide controllers
         // ide controllers
         case 'ide0':
         case 'ide1':
         case 'ide2':
         case 'ide3':
             $slot = 'IDE-0-0';
             switch ($name) {
                 case 'ide0':
                     $slot = 'IDE-0-0';
                     break;
//.........這裏部分代碼省略.........
開發者ID:yamdrok,項目名稱:virtualbox-php,代碼行數:101,代碼來源:machine.inc.php


注:本文中的Repository::getFdd方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。