当前位置: 首页>>代码示例>>PHP>>正文


PHP kernel::get_list方法代码示例

本文整理汇总了PHP中kernel::get_list方法的典型用法代码示例。如果您正苦于以下问题:PHP kernel::get_list方法的具体用法?PHP kernel::get_list怎么用?PHP kernel::get_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kernel的用法示例。


在下文中一共展示了kernel::get_list方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: resource

 function get_response()
 {
     $response = $this->response;
     $form = $response->get_form($this->actions_name, 'step4');
     $resource = new resource();
     $resource->get_instance_by_id($this->appliance->resources);
     // if not openQRM resource
     if ($resource->id != 0) {
         $virtualization = new virtualization();
         $virtualization->get_instance_by_id($resource->vtype);
     }
     $image = new image();
     $image->get_instance_by_id($this->appliance->imageid);
     $deployment = new deployment();
     $deployment->get_instance_by_type($image->type);
     $submit = $form->get_elements('submit');
     $submit->handler = 'onclick="wait();"';
     $form->add($submit, 'submit');
     $submit = $form->get_elements('cancel');
     $submit->handler = 'onclick="cancel();"';
     $form->add($submit, 'cancel');
     $kernel = new kernel();
     $list = $kernel->get_list();
     unset($list[0]);
     $kernels = array();
     if ($resource->id == 0) {
         $kernels[] = array(0, 'openQRM');
     } else {
         if (strstr($resource->capabilities, "TYPE=local-server")) {
             $local_kernel = new kernel();
             $local_kernel->get_instance_by_name("resource" . $resource->id);
             $kernels[] = array($local_kernel->id, 'Local OS Installation');
             // local-deployment VMs
         } else {
             if (strstr($virtualization->type, "-vm-local")) {
                 $kernels[] = array(1, 'Local OS Installation');
                 // network-deployment - show only network-boot images
             } else {
                 if (strstr($virtualization->type, "-vm-net")) {
                     foreach ($list as $value) {
                         $id = $value['value'];
                         $kernel->get_instance_by_id($id);
                         if (!strstr($kernel->capabilities, "TYPE=local-server")) {
                             $kernels[] = array($id, $kernel->id . ' / ' . $kernel->name . ' (' . $kernel->version . ')');
                         }
                     }
                     // network deployment - physical systems - show only network-boot images
                 } else {
                     foreach ($list as $value) {
                         $id = $value['value'];
                         $kernel->get_instance_by_id($id);
                         if (!strstr($kernel->capabilities, "TYPE=local-server")) {
                             $kernels[] = array($id, $kernel->id . ' / ' . $kernel->name . ' (' . $kernel->version . ')');
                         }
                     }
                 }
             }
         }
     }
     $d['kernel']['label'] = $this->lang['form_kernel'];
     $d['kernel']['required'] = true;
     $d['kernel']['object']['type'] = 'htmlobject_select';
     $d['kernel']['object']['attrib']['index'] = array(0, 1);
     $d['kernel']['object']['attrib']['id'] = 'kernel';
     $d['kernel']['object']['attrib']['name'] = 'kernel';
     $d['kernel']['object']['attrib']['options'] = $kernels;
     $form->add($d);
     $response->form = $form;
     return $response;
 }
开发者ID:kelubo,项目名称:OpenQRM,代码行数:70,代码来源:appliance.step4.class.php

示例2: KernelGetList

 function KernelGetList($method_parameters)
 {
     global $event;
     $parameter_array = explode(',', $method_parameters);
     $mode = $parameter_array[0];
     $username = $parameter_array[1];
     $password = $parameter_array[2];
     // check all user input
     for ($i = 0; $i <= 2; $i++) {
         if (!$this->check_param($parameter_array[$i])) {
             $event->log("cloudsoap->KernelGetList", $_SERVER['REQUEST_TIME'], 2, "cloud-soap-server.php", "Not allowing user-intput with special-characters : {$parameter_array[$i]}", "", "", 0, 0, 0);
             return;
         }
     }
     // check parameter count
     $parameter_count = count($parameter_array);
     if ($parameter_count != 3) {
         $event->log("cloudsoap->KernelGetList", $_SERVER['REQUEST_TIME'], 2, "cloud-soap-server.php", "Wrong parameter count {$parameter_count} ! Exiting.", "", "", 0, 0, 0);
         return;
     }
     // check authentication
     if (!$this->check_user($mode, $username, $password)) {
         $event->log("cloudsoap->KernelGetList", $_SERVER['REQUEST_TIME'], 2, "cloud-soap-server.php", "User authentication failed (mode {$mode})", "", "", 0, 0, 0);
         return;
     }
     $event->log("cloudsoap->KernelGetList", $_SERVER['REQUEST_TIME'], 5, "cloud-soap-server.php", "Providing list of available kernels", "", "", 0, 0, 0);
     $kernel = new kernel();
     $kernel_list = $kernel->get_list();
     $kernel_name_list = array();
     foreach ($kernel_list as $kernels) {
         // check cloudselector
         // ####### start of cloudselector case #######
         // if cloudselector is enabled check if products exist
         $cloudselector = new cloudselector();
         $cc_conf = new cloudconfig();
         $cloud_selector_enabled = $cc_conf->get_value(22);
         // cloudselector
         if (!strcmp($cloud_selector_enabled, "true")) {
             // kernel
             $kernel_name = $kernels['label'];
             $cs_kernel = new kernel();
             $cs_kernel->get_instance_by_name($kernel_name);
             if ($cloudselector->product_exists_enabled("kernel", $cs_kernel->id)) {
                 $kernel_name_list[] = $kernels['label'];
             }
         } else {
             $kernel_name_list[] = $kernels['label'];
         }
     }
     if (strcmp($cloud_selector_enabled, "true")) {
         // remove openqrm kernel
         array_splice($kernel_name_list, 0, 1);
     }
     return $kernel_name_list;
 }
开发者ID:kelubo,项目名称:OpenQRM,代码行数:55,代码来源:cloudsoap.class.php

示例3: VALUES

 $cloud_product_id = (int) str_replace(".", "", str_pad(microtime(true), 15, "0"));
 $create_default_cloudselector_config = "insert into cloud_selector VALUES (" . $cloud_product_id . ",'network',1,'2',2,'2','2 Network Cards',1);";
 $recordSet = $db->Execute($create_default_cloudselector_config);
 $cloud_product_id = (int) str_replace(".", "", str_pad(microtime(true), 15, "0"));
 $create_default_cloudselector_config = "insert into cloud_selector VALUES (" . $cloud_product_id . ",'network',2,'3',3,'3','3 Network Cards',1);";
 $recordSet = $db->Execute($create_default_cloudselector_config);
 $cloud_product_id = (int) str_replace(".", "", str_pad(microtime(true), 15, "0"));
 $create_default_cloudselector_config = "insert into cloud_selector VALUES (" . $cloud_product_id . ",'network',3,'4',4,'4','4 Network Cards',1);";
 $recordSet = $db->Execute($create_default_cloudselector_config);
 $cloud_product_id = (int) str_replace(".", "", str_pad(microtime(true), 15, "0"));
 $create_default_cloudselector_config = "insert into cloud_selector VALUES (" . $cloud_product_id . ",'quantity',0,'1',1,'1','1 CloudAppliance',1);";
 $recordSet = $db->Execute($create_default_cloudselector_config);
 // create kernel products
 $next_sort_id = 0;
 $kernel = new kernel();
 $kernel_id_ar = $kernel->get_list();
 unset($kernel_id_ar[0]);
 foreach ($kernel_id_ar as $key => $value) {
     $id = $value['value'];
     $kernel->get_instance_by_id($id);
     $pos = strpos($kernel->name, 'resource');
     if ($pos === false) {
         $cloud_product_id = (int) str_replace(".", "", str_pad(microtime(true), 15, "0"));
         $create_kernel_cloudselector_config = "insert into cloud_selector (id, type, sort_id, quantity, price, name, description, state) VALUES (" . $cloud_product_id . ", 'kernel', " . $next_sort_id . ", '" . $kernel->id . "', 1, '" . $kernel->name . "', '" . $kernel->version . "', 1);";
         $recordSet = $db->Execute($create_kernel_cloudselector_config);
         $next_sort_id++;
     }
 }
 // create default projects
 $cloud_hook_config = array();
 $cloud_id = (int) str_replace(".", "", str_pad(microtime(true), 15, "0"));
开发者ID:kelubo,项目名称:OpenQRM,代码行数:31,代码来源:cloud-action.php


注:本文中的kernel::get_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。