本文整理汇总了PHP中resource类的典型用法代码示例。如果您正苦于以下问题:PHP resource类的具体用法?PHP resource怎么用?PHP resource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了resource类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: openqrm_dhcpd_appliance
function openqrm_dhcpd_appliance($cmd, $appliance_fields)
{
global $OPENQRM_SERVER_BASE_DIR;
global $OPENQRM_EXEC_PORT;
$openqrm_server = new openqrm_server();
$OPENQRM_SERVER_IP_ADDRESS = $openqrm_server->get_ip_address();
$event = new event();
$appliance_id = $appliance_fields["appliance_id"];
$appliance_name = $appliance_fields["appliance_name"];
$resource = new resource();
$resource->get_instance_by_id($appliance_fields["appliance_resources"]);
$resource_mac = $resource->mac;
$resource_ip = $resource->ip;
$appliance = new appliance();
$appliance->get_instance_by_id($appliance_id);
if ($resource->id == "-1" || $resource->id == "") {
return;
}
$event->log("openqrm_dhcpd_appliance", $_SERVER['REQUEST_TIME'], 5, "openqrm-dhcpd-appliance-hook.php", "Handling {$cmd} event {$appliance_id}/{$appliance_name}/{$resource_ip}/{$resource_mac}", "", "", 0, 0, $resource->id);
switch ($cmd) {
case "start":
$event->log("openqrm_dhcpd_appliance", $_SERVER['REQUEST_TIME'], 5, "openqrm-dhcpd-appliance-hook.php", "Adding hostname " . $appliance->name . " from resource " . $resource->id . ".", "", "", 0, 0, $resource->id);
$dhcpd_command = $OPENQRM_SERVER_BASE_DIR . "/openqrm/plugins/dhcpd/bin/openqrm-dhcpd-appliance add_hostname -m " . $resource_mac . " -n " . $appliance->name . " -d " . $resource->id . " --openqrm-cmd-mode background";
$openqrm_server->send_command($dhcpd_command);
break;
case "stop":
$event->log("openqrm_dhcpd_appliance", $_SERVER['REQUEST_TIME'], 5, "openqrm-dhcpd-appliance-hook.php", "Removing hostname " . $appliance->name . " from resource " . $resource->id . ".", "", "", 0, 0, $resource->id);
$dhcpd_command = $OPENQRM_SERVER_BASE_DIR . "/openqrm/plugins/dhcpd/bin/openqrm-dhcpd-appliance remove_hostname -m " . $resource_mac . " -n " . $appliance->name . " -d " . $resource->id . " --openqrm-cmd-mode background";
$openqrm_server->send_command($dhcpd_command);
break;
}
}
开发者ID:kelubo,项目名称:OpenQRM,代码行数:32,代码来源:openqrm-dhcpd-appliance-hook.php
示例2: get_lvm_iscsi_deployment_image_rootdevice_identifier
function get_lvm_iscsi_deployment_image_rootdevice_identifier($lvm_iscsi_storage_id)
{
global $OPENQRM_SERVER_BASE_DIR;
global $OPENQRM_ADMIN;
global $event;
// place for the storage stat files
$StorageDir = $_SERVER["DOCUMENT_ROOT"] . '/openqrm/base/plugins/lvm-storage/storage';
$rootdevice_identifier_array = array();
$storage = new storage();
$storage->get_instance_by_id($lvm_iscsi_storage_id);
$storage_resource = new resource();
$storage_resource->get_instance_by_id($storage->resource_id);
$storage_resource_id = $storage_resource->id;
$ident_file = "{$StorageDir}/{$storage_resource_id}.lv.lvm-iscsi-deployment.ident";
if (file_exists($ident_file)) {
unlink($ident_file);
}
// send command
$resource_command = "{$OPENQRM_SERVER_BASE_DIR}/openqrm/plugins/lvm-storage/bin/openqrm-lvm-storage post_identifier -t lvm-iscsi-deployment -u {$OPENQRM_ADMIN->name} -p {$OPENQRM_ADMIN->password}";
$storage_resource->send_command($storage_resource->ip, $resource_command);
if (!lvm_iscsi_deployment_wait_for_identfile($ident_file)) {
$event->log("get_image_rootdevice_identifier", $_SERVER['REQUEST_TIME'], 2, "image.lvm-iscsi-deployment", "Timeout while requesting image identifier from storage id {$storage->id}", "", "", 0, 0, 0);
return;
}
$fcontent = file($ident_file);
foreach ($fcontent as $lun_info) {
$tpos = strpos($lun_info, ",");
$timage_name = trim(substr($lun_info, 0, $tpos));
$troot_device = trim(substr($lun_info, $tpos + 1));
$rootdevice_identifier_array[] = array("value" => "{$troot_device}", "label" => "{$timage_name}");
}
return $rootdevice_identifier_array;
}
开发者ID:kelubo,项目名称:OpenQRM,代码行数:33,代码来源:image.lvm-iscsi-deployment.php
示例3: get_nagios3_appliance_link
function get_nagios3_appliance_link($appliance_id)
{
global $event;
global $OPENQRM_SERVER_BASE_DIR;
global $OPENQRM_SERVER_IP_ADDRESS;
global $OPENQRM_EXEC_PORT;
$p_appliance = new appliance();
$p_appliance->get_instance_by_id($appliance_id);
$p_resource = new resource();
$p_resource->get_instance_by_id($p_appliance->resources);
$nagios_link = "/openqrm/base/index.php?name=Nagios3&iframe=/cgi-bin/nagios3/status.cgi?host=" . $p_appliance->name;
$html = new htmlobject($OPENQRM_SERVER_BASE_DIR . '/openqrm/web/base/class/htmlobjects');
$a = $html->a();
// $a->label = '<img title="Service monitoring" alt="Service monitoring" height="24" width="24" src="/openqrm/base/plugins/nagios3/img/plugin.png" border=0>';
$a->label = 'nagios';
$a->css = 'badge';
$a->href = $nagios_link;
$a->handler = '';
$plugin_link = $a;
if ($p_resource->id == 0) {
$plugin_link = $a;
}
if ($p_resource->id == '') {
$plugin_link = "";
}
return $plugin_link;
}
开发者ID:kelubo,项目名称:OpenQRM,代码行数:27,代码来源:openqrm-nagios3-appliance-link-hook.php
示例4: get_novnc_appliance_link
function get_novnc_appliance_link($appliance_id)
{
global $event;
global $OPENQRM_SERVER_BASE_DIR;
global $OPENQRM_SERVER_IP_ADDRESS;
global $OPENQRM_EXEC_PORT;
$p_appliance = new appliance();
$p_appliance->get_instance_by_id($appliance_id);
$p_resource = new resource();
$p_resource->get_instance_by_id($p_appliance->resources);
$virtualization = new virtualization();
$virtualization->get_instance_by_id($p_appliance->virtualization);
$html = new htmlobject($OPENQRM_SERVER_BASE_DIR . '/openqrm/web/base/class/htmlobjects');
$a = $html->a();
$a->label = 'noVNC';
$a->css = 'badge';
$a->handler = 'onclick="wait();"';
$plugin_link = '';
if (strstr($p_appliance->state, "active")) {
if (strstr($virtualization->type, '-vm-')) {
$a->href = '/openqrm/base/index.php?plugin=novnc&controller=novnc&novnc_action=console&appliance_id=' . $p_appliance->id;
} else {
$a->href = '/openqrm/base/index.php?plugin=novnc&controller=novnc&novnc_action=login&appliance_id=' . $p_appliance->id;
}
$plugin_link = $a;
} else {
if ($p_resource->id === '0') {
$a->href = '/openqrm/base/index.php?plugin=novnc&controller=novnc&novnc_action=login&appliance_id=' . $p_appliance->id;
$plugin_link = $a;
}
}
return $plugin_link;
}
开发者ID:kelubo,项目名称:OpenQRM,代码行数:33,代码来源:openqrm-novnc-appliance-link-hook.php
示例5: get_sshterm_appliance_link
function get_sshterm_appliance_link($appliance_id)
{
global $event;
global $OPENQRM_SERVER_BASE_DIR;
global $OPENQRM_SERVER_IP_ADDRESS;
global $OPENQRM_EXEC_PORT;
$p_appliance = new appliance();
$p_appliance->get_instance_by_id($appliance_id);
$p_resource = new resource();
$p_resource->get_instance_by_id($p_appliance->resources);
// get the parameters from the plugin config file
$OPENQRM_PLUGIN_SSHTERM_CONFIG_FILE = "{$OPENQRM_SERVER_BASE_DIR}/openqrm/plugins/sshterm/etc/openqrm-plugin-sshterm.conf";
$store = openqrm_parse_conf($OPENQRM_PLUGIN_SSHTERM_CONFIG_FILE);
extract($store);
$sshterm_login_ip = $p_resource->ip;
$sshterm_window = 'window' . str_replace('.', '', $sshterm_login_ip);
$sshterm_login_url = "https://{$sshterm_login_ip}:{$OPENQRM_PLUGIN_WEBSHELL_PORT}";
$html = new htmlobject($OPENQRM_SERVER_BASE_DIR . '/openqrm/web/base/class/htmlobjects');
$a = $html->a();
$a->label = 'SSHTerm';
$a->css = 'badge';
$a->href = '#';
$a->handler = 'onclick="sshwindow = window.open(\'' . $sshterm_login_url . '\',\'' . $sshterm_window . '\', \'location=0,status=0,scrollbars=yes,resizable=yes,width=972,height=500,left=100,top=100,screenX=400,screenY=100\'); sshwindow.focus(); return false;"';
$plugin_link = '';
if (strstr($p_appliance->state, "active")) {
$plugin_link = $a;
}
if ($p_resource->id == 0) {
$plugin_link = $a;
}
if ($p_resource->id == '') {
$plugin_link = "";
}
return $plugin_link;
}
开发者ID:kelubo,项目名称:OpenQRM,代码行数:35,代码来源:openqrm-sshterm-appliance-link-hook.php
示例6: get_lcmc_appliance_link
function get_lcmc_appliance_link($appliance_id)
{
global $event;
global $OPENQRM_SERVER_BASE_DIR;
global $OPENQRM_SERVER_IP_ADDRESS;
global $OPENQRM_EXEC_PORT;
$p_appliance = new appliance();
$p_appliance->get_instance_by_id($appliance_id);
$p_resource = new resource();
$p_resource->get_instance_by_id($p_appliance->resources);
$lcmc_gui = "/openqrm/base/plugins/lcmc/lcmc-gui.php";
$icon_size = "width='24' height='24'";
$icon_title = "Configure appliaction highavailability";
$html = new htmlobject($OPENQRM_SERVER_BASE_DIR . '/openqrm/web/base/class/htmlobjects');
$a = $html->a();
$a->label = 'LCMC';
//'<img title="'.$icon_title.'" alt="'.$icon_title.'" $icon_size src="/openqrm/base/plugins/lcmc/img/plugin.png" border=0>';
$a->css = 'badge';
$a->href = '#';
$a->handler = 'onclick="window.open(\'' . $lcmc_gui . '\',\'\', \'location=0,status=0,scrollbars=1,width=1150,height=800,left=50,top=50,screenX=50,screenY=50\');return false;"';
$plugin_link = '';
if (strstr($p_appliance->state, "active")) {
$plugin_link = $a;
}
if ($p_resource->id == 0) {
$plugin_link = $a;
}
if ($p_resource->id == '') {
$plugin_link = "";
}
return $plugin_link;
}
开发者ID:kelubo,项目名称:OpenQRM,代码行数:32,代码来源:openqrm-lcmc-appliance-link-hook.php
示例7: openqrm_template_deployment_resource_virtual_command
function openqrm_template_deployment_resource_virtual_command($cmd, $resource_fields)
{
global $event;
global $OPENQRM_SERVER_BASE_DIR;
global $OPENQRM_SERVER_IP_ADDRESS;
global $OPENQRM_EXEC_PORT;
$resource_id = $resource_fields["resource_id"];
$resource = new resource();
$resource->get_instance_by_id($resource_id);
$host_resource = new resource();
$host_resource->get_instance_by_id($resource->vhostid);
$event->log("openqrm_template_deployment_resource_virtual_command", $_SERVER['REQUEST_TIME'], 5, "openqrm-template_deployment-resource-virtual-command-hook.php", "Handling {$cmd} command of resource {$resource->id} on host {$host_resource->id}", "", "", 0, 0, 0);
switch ($cmd) {
case "reboot":
$event->log("openqrm_template_deployment_resource_virtual_command", $_SERVER['REQUEST_TIME'], 5, "openqrm-template_deployment-resource-virtual-command-hook.php", "Handling {$cmd} command", "", "", 0, 0, 0);
$virtual_command = $OPENQRM_SERVER_BASE_DIR . "/openqrm/plugins/template_deployment/bin/openqrm-template_deployment-vm restart_by_mac -m " . $resource->mac . " -d noop --openqrm-cmd-mode background";
// reboot conflicts with appliance stop, commented out for now
//$host_resource->send_command($host_resource->ip, $virtual_command);
break;
case "halt":
$event->log("openqrm_template_deployment_resource_virtual_command", $_SERVER['REQUEST_TIME'], 5, "openqrm-template_deployment-resource-virtual-command-hook.php", "Handling {$cmd} command", "", "", 0, 0, 0);
$virtual_command = $OPENQRM_SERVER_BASE_DIR . "/openqrm/plugins/template_deployment/bin/openqrm-template_deployment-vm stop_by_mac -m " . $resource->mac . " --openqrm-cmd-mode background";
$host_resource->send_command($host_resource->ip, $virtual_command);
break;
}
}
开发者ID:kelubo,项目名称:OpenQRM,代码行数:26,代码来源:openqrm-template-resource-virtual-command-hook.php
示例8: get_template_appliance_link
function get_template_appliance_link($appliance_id)
{
global $event;
global $OPENQRM_SERVER_BASE_DIR;
global $OPENQRM_SERVER_IP_ADDRESS;
global $OPENQRM_EXEC_PORT;
$p_appliance = new appliance();
$p_appliance->get_instance_by_id($appliance_id);
$p_resource = new resource();
$p_resource->get_instance_by_id($p_appliance->resources);
$html = new htmlobject($OPENQRM_SERVER_BASE_DIR . '/openqrm/web/base/class/htmlobjects');
$a = $html->a();
$a->label = 'Template';
$a->css = 'badge';
$a->href = '#';
$a->handler = 'onclick="window.open(\'Template-URL\',\'\', \'location=0,status=0,scrollbars=1,width=1150,height=800,left=50,top=50,screenX=50,screenY=50\');return false;"';
$plugin_link = '';
if (strstr($p_appliance->state, "active")) {
$plugin_link = $a;
}
if ($p_resource->id == 0) {
$plugin_link = $a;
}
if ($p_resource->id == '') {
$plugin_link = "";
}
return $plugin_link;
}
开发者ID:kelubo,项目名称:OpenQRM,代码行数:28,代码来源:openqrm-template-appliance-link-hook.php
示例9: openqrm_template_appliance
function openqrm_template_appliance($cmd, $appliance_fields)
{
global $event;
global $OPENQRM_SERVER_BASE_DIR;
global $OPENQRM_SERVER_IP_ADDRESS;
global $OPENQRM_EXEC_PORT;
$appliance_id = $appliance_fields["appliance_id"];
$appliance_name = $appliance_fields["appliance_name"];
$resource = new resource();
$resource->get_instance_by_id($appliance_fields["appliance_resources"]);
$appliance_ip = $resource->ip;
// check appliance values, maybe we are in update and they are incomplete
if ($resource->id == "-1" || $resource->id == "") {
return;
}
$event->log("openqrm_new_appliance", $_SERVER['REQUEST_TIME'], 5, "openqrm-template-appliance-hook.php", "Handling {$cmd} event {$appliance_id}/{$appliance_name}/{$appliance_ip}", "", "", 0, 0, $appliance_id);
switch ($cmd) {
case "start":
$openqrm_server = new openqrm_server();
$openqrm_server->send_command($OPENQRM_SERVER_BASE_DIR . "/openqrm/plugins/template/bin/openqrm-template-manager start " . $appliance_id . " " . $appliance_name . " " . $appliance_ip . " --openqrm-cmd-mode background");
break;
case "stop":
$openqrm_server = new openqrm_server();
$openqrm_server->send_command($OPENQRM_SERVER_BASE_DIR . "/openqrm/plugins/template/bin/openqrm-template-manager stop " . $appliance_id . " " . $appliance_name . " " . $appliance_ip . " --openqrm-cmd-mode background");
break;
}
}
开发者ID:kelubo,项目名称:OpenQRM,代码行数:27,代码来源:openqrm-template-appliance-hook.php
示例10: processJobData
/**
* 处理任务数据的回调方法
* @param function $callback
* @param resource $vendorInstance
* @param array $option
* @throws MyRuntimeException
*/
public static function processJobData($callback, $vendorInstance, $option = array())
{
$option += array('decode' => TRUE, 'delete' => TRUE, 'release' => FALSE, 'delay' => 10, 'priority' => 1024, 'timeout' => NULL);
$retData = NULL;
//echo 'proceed job data'.PHP_EOL;
//var_dump($vendorInstance);
$job = $vendorInstance->reserve($option['timeout']);
//var_dump($job);
if ($job) {
if ($option['decode'] == TRUE) {
$arg = self::decodeData($job->getData());
} else {
$arg = $job->getData();
}
if (!is_callable($callback)) {
throw new RuntimeException('process data error');
}
$retData = call_user_func($callback, $arg);
if (!$retData) {
if ($option['release'] == TRUE) {
$vendorInstance->release($job, $option['priority'], $option['delay']);
}
throw new RuntimeException('process data error');
}
if ($option['delete'] == TRUE) {
$vendorInstance->delete($job);
}
} else {
$arg = $job;
}
return $retData;
}
开发者ID:nickfan,项目名称:appbox,代码行数:39,代码来源:BeanstalkBoxRouteServiceDriver.php
示例11: query
/**
* query
* @param string $sql
* @param resource $connResource
* @return array
*/
public function query($sql, $connResource)
{
$rows = array();
$result = $connResource->query($sql);
while ($row = $result->fetch_assoc()) {
$rows[] = $row;
}
return $rows;
}
开发者ID:zhangshijle,项目名称:Python3,代码行数:15,代码来源:DbConnectionAdapterMysqli.php
示例12: __construct
/**
* Creates a new OCI8Statement that uses the given connection handle and SQL statement.
*
* @param resource $dbh The connection handle.
* @param string $statement The SQL statement.
*/
public function __construct($dbh, $statement, SQLite3Connection $conn)
{
list($statement, $paramMap) = self::convertPositionalToNamedPlaceholders($statement);
$this->_sth = $dbh->prepare($statement);
$this->_dbh = $dbh;
$this->_ret = null;
$this->_paramMap = $paramMap;
$this->_conn = $conn;
}
开发者ID:joshuacoddingyou,项目名称:php,代码行数:15,代码来源:SQLite3Statement.php
示例13: openqrm_nagios3_appliance
function openqrm_nagios3_appliance($cmd, $appliance_fields)
{
global $event;
global $OPENQRM_SERVER_BASE_DIR;
global $OPENQRM_SERVER_IP_ADDRESS;
global $OPENQRM_EXEC_PORT;
$appliance_id = $appliance_fields["appliance_id"];
$appliance = new appliance();
$appliance->get_instance_by_id($appliance_id);
$appliance_name = $appliance_fields["appliance_name"];
$resource = new resource();
$resource->get_instance_by_id($appliance_fields["appliance_resources"]);
$appliance_ip = $resource->ip;
// check appliance values, maybe we are in update and they are incomplete
if ($appliance->imageid == 1) {
return;
}
if ($resource->id == "-1" || $resource->id == "") {
return;
}
// get the nagios service checks
$nagios_host = new nagios3_host();
$nagios_host->get_instance_by_appliance_id($appliance_id);
$active_nagios_services = explode(',', $nagios_host->appliance_services);
$nagios_service_list = '';
foreach ($active_nagios_services as $service_id) {
$nagios_service = new nagios3_service();
$nagios_service->get_instance_by_id($service_id);
$nagios_service_list = $nagios_service_list . "," . $nagios_service->port;
}
$nagios_service_list = substr($nagios_service_list, 1);
if (!strlen($nagios_service_list)) {
$event->log("openqrm_new_appliance", $_SERVER['REQUEST_TIME'], 5, "openqrm-nagios3-appliance-hook.php", "Appliance {$appliance_id} has no configured nagios services, skipping...", "", "", 0, 0, $appliance_id);
return 0;
}
$event->log("openqrm_new_appliance", $_SERVER['REQUEST_TIME'], 5, "openqrm-nagios3-appliance-hook.php", "Handling {$cmd} event {$appliance_id}/{$appliance_name}/{$appliance_ip}", "", "", 0, 0, $appliance_id);
switch ($cmd) {
case "start":
$nagios_appliance_start_cmd = $OPENQRM_SERVER_BASE_DIR . "/openqrm/plugins/nagios3/bin/openqrm-nagios-manager add -n " . $appliance_name . " -i " . $resource->ip . " -p " . $nagios_service_list . " --openqrm-cmd-mode background";
$openqrm_server = new openqrm_server();
$openqrm_server->send_command($nagios_appliance_start_cmd, NULL, true);
break;
case "stop":
$nagios_appliance_stop_cmd = "{$OPENQRM_SERVER_BASE_DIR}/openqrm/plugins/nagios3/bin/openqrm-nagios-manager remove_host -n " . $appliance_name . " --openqrm-cmd-mode background";
$openqrm_server = new openqrm_server();
$openqrm_server->send_command($nagios_appliance_stop_cmd, NULL, true);
break;
case "remove":
$nagios_appliance_stop_cmd = "{$OPENQRM_SERVER_BASE_DIR}/openqrm/plugins/nagios3/bin/openqrm-nagios-manager remove_host -n " . $appliance_name . " --openqrm-cmd-mode background";
$openqrm_server = new openqrm_server();
$openqrm_server->send_command($nagios_appliance_stop_cmd, NULL, true);
// remove nagios_host from the db
$nagios_host->remove_by_appliance_id($appliance_id);
break;
}
}
开发者ID:kelubo,项目名称:OpenQRM,代码行数:56,代码来源:openqrm-nagios3-appliance-hook.php
示例14: __construct
/**
* Constructor
*
* @param resource $pdooci PDOOCI connection
* @param string $statement sql statement
*
* @return Statement $statement created
*/
public function __construct($pdooci, $statement)
{
try {
$this->_pdooci = $pdooci;
$this->_con = $pdooci->getConnection();
$this->_statement = Statement::insertMarks($statement);
$this->_stmt = \oci_parse($this->_con, $this->_statement);
$this->_fetch_sty = \PDO::FETCH_BOTH;
} catch (\Exception $e) {
throw new \PDOException($e->getMessage());
}
}
开发者ID:grzchr15,项目名称:pdooci,代码行数:20,代码来源:Statement.php
示例15: array
/**
* Get a list of recycle bin contents for the current user
* @param object $userObj current user object
* @param resource $db database connection
* @return array of recycle bin contents
*/
static function get_recyclebin_contents($userObj, $db)
{
$recycle_bin = array();
// Query the Papers tables.
$i = 0;
$stmt = $db->prepare("SELECT property_id AS id, paper_type, paper_title, DATE_FORMAT(deleted,'%Y%m%d%H%i') AS deleted FROM properties WHERE paper_ownerID = ? AND deleted IS NOT NULL");
$stmt->bind_param('i', $userObj->get_user_ID());
$stmt->execute();
$stmt->bind_result($id, $paper_type, $paper_title, $deleted);
while ($stmt->fetch()) {
$recycle_bin[$i]['id'] = $id;
$recycle_bin[$i]['type'] = 'paper';
$recycle_bin[$i]['name'] = $paper_title;
$recycle_bin[$i]['deleted'] = $deleted;
$recycle_bin[$i]['subtype'] = $paper_type;
$i++;
}
$stmt->close();
// Query the Questions tables.
$stmt = $db->prepare("SELECT q_id AS id, q_type, leadin_plain, DATE_FORMAT(deleted,'%Y%m%d%H%i') AS deleted FROM questions WHERE ownerID = ? AND deleted IS NOT NULL");
$stmt->bind_param('i', $userObj->get_user_ID());
$stmt->execute();
$stmt->bind_result($id, $q_type, $leadin_plain, $deleted);
while ($stmt->fetch()) {
$recycle_bin[$i]['id'] = $id;
$recycle_bin[$i]['type'] = 'question';
if ($q_type == 'sct') {
$parts = explode('~', $leadin_plain);
$recycle_bin[$i]['name'] = $parts[0];
} else {
$recycle_bin[$i]['name'] = $leadin_plain;
}
$recycle_bin[$i]['deleted'] = $deleted;
$recycle_bin[$i]['subtype'] = $q_type;
$i++;
}
$stmt->close();
// Query the Folder tables.
$stmt = $db->prepare("SELECT id, name, DATE_FORMAT(deleted,'%Y%m%d%H%i') AS deleted FROM folders WHERE ownerID = ? AND deleted IS NOT NULL");
$stmt->bind_param('i', $userObj->get_user_ID());
$stmt->execute();
$stmt->bind_result($id, $name, $deleted);
while ($stmt->fetch()) {
$recycle_bin[$i]['id'] = $id;
$recycle_bin[$i]['type'] = 'folder';
$recycle_bin[$i]['name'] = str_replace(';', '\\', $name);
$recycle_bin[$i]['deleted'] = $deleted;
$recycle_bin[$i]['subtype'] = '';
$i++;
}
$stmt->close();
return $recycle_bin;
}
开发者ID:vinod-co,项目名称:centa,代码行数:59,代码来源:recyclebin.class.php
示例16: __construct
/**
* Creates a new OCI8Statement that uses the given connection handle and SQL statement.
*
* @param resource $dbh The connection handle.
* @param string $statement The SQL statement.
*/
public function __construct($dbh, $statement, SQLite3Connection $conn)
{
$this->_dbh = $dbh;
list($statement, $paramMap) = self::convertPositionalToNamedPlaceholders($statement);
$this->_sth = $dbh->prepare($statement);
if (!$this->_sth) {
throw SQLite3Exception::fromErrorInfo($this->errorInfo());
}
$this->_ret = null;
$this->_paramMap = $paramMap;
$this->_conn = $conn;
}
开发者ID:elymatos,项目名称:expressive,代码行数:18,代码来源:SQLite3Statement.php
示例17: get_nagios3_appliance_edit
function get_nagios3_appliance_edit($appliance_id, $openqrm, $response)
{
$p_appliance = new appliance();
$p_appliance->get_instance_by_id($appliance_id);
$p_resource = new resource();
$p_resource->get_instance_by_id($p_appliance->resources);
if ($p_resource->id !== '') {
$a = $response->html->a();
$a->label = '<img title="Service monitoring" alt="Service monitoring" height="24" width="24" src="' . $openqrm->get('baseurl') . '/plugins/nagios3/img/plugin.png" border=0>';
$a->href = $openqrm->get('baseurl') . '/index.php?base=appliance&appliance_action=load_edit&aplugin=nagios3&appliance_id=' . $appliance_id . '&nagios3_action=edit';
return $a;
}
}
开发者ID:kelubo,项目名称:OpenQRM,代码行数:13,代码来源:openqrm-nagios3-appliance-edit-hook.php
示例18: quoteTrustedValue
/**
* {@inheritDoc}
*/
public function quoteTrustedValue($value)
{
if ($this->resource instanceof DriverInterface) {
$this->resource = $this->resource->getConnection()->getResource();
}
if (is_resource($this->resource)) {
return '\'' . pg_escape_string($this->resource, $value) . '\'';
}
if ($this->resource instanceof \PDO) {
return $this->resource->quote($value);
}
return 'E' . parent::quoteTrustedValue($value);
}
开发者ID:karnurik,项目名称:zf2-turtorial,代码行数:16,代码来源:Postgresql.php
示例19: action
function action()
{
$resource = new resource();
$resource->get_instance_by_id(0);
$t = $this->response->html->template($this->tpldir . '/local-server-about-usage.tpl.php');
$t->add($this->response->html->thisfile, "thisfile");
$t->add($this->lang['label'], 'label');
$t->add($this->lang['usage_integrate_title'], 'usage_integrate_title');
$t->add($this->lang['usage_remove_title'], 'usage_remove_title');
$t->add(sprintf($this->lang['usage_integrate_content'], $this->basedir, $resource->ip), 'usage_integrate_content');
$t->add(sprintf($this->lang['usage_remove_content'], $resource->ip), 'usage_remove_content');
$t->add($this->openqrm->get('baseurl'), 'baseurl');
return $t;
}
开发者ID:kelubo,项目名称:OpenQRM,代码行数:14,代码来源:local-server-about.usage.class.php
示例20: getDeviceIp
/**
* @param $phoneArray
* @return bool|\Exception|\SoapFault
*/
public function getDeviceIp($phoneArray)
{
try {
$response = $this->client->SelectCmDevice('', ['MaxReturnedDevices' => '1000', 'Class' => 'Phone', 'Model' => '255', 'Status' => 'Any', 'NodeName' => '', 'SelectBy' => 'Name', 'SelectItems' => $phoneArray]);
} catch (SoapFault $E) {
// Loop if we get a RISPort error for exceeding maximum calls in 1 minute
if (preg_match('/^AxisFault: Exceeded allowed rate for Reatime information/', $E->faultstring)) {
sleep(30);
$this->getDeviceIp($phoneArray);
}
return $E;
}
/*
* No Errors
* Process Results
*/
return $response["SelectCmDeviceResult"];
$SelectCmDeviceResult = $response["SelectCmDeviceResult"];
/*
* Return results if they exist
* Or return false
*/
if ($SelectCmDeviceResult->CmNodes) {
return $SelectCmDeviceResult->CmNodes;
}
return false;
}
开发者ID:shibahr,项目名称:uc-toolkit,代码行数:31,代码来源:RisSoap.php
注:本文中的resource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论