本文整理汇总了PHP中storage::get_storage_types方法的典型用法代码示例。如果您正苦于以下问题:PHP storage::get_storage_types方法的具体用法?PHP storage::get_storage_types怎么用?PHP storage::get_storage_types使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类storage
的用法示例。
在下文中一共展示了storage::get_storage_types方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action
function action()
{
$msg = '';
$event = new event();
$server = new openqrm_server();
$plugin = new plugin();
$identifier = $this->response->html->request()->get($this->identifier_name);
$enabled = $plugin->enabled();
if ($identifier !== '') {
foreach ($identifier as $id) {
if (in_array($id, $enabled)) {
$error = false;
// check dependencies
foreach ($enabled as $v) {
if ($v !== $id) {
$tmp = $plugin->get_dependencies($v);
if ($tmp !== '' && isset($tmp['dependencies']) && $tmp['dependencies'] !== '') {
if (strpos($tmp['dependencies'], $id) !== false) {
$msg .= sprintf($this->lang['error_dependencies'], $id, $v) . '<br>';
$error = true;
}
}
}
}
// handle plugin type
if ($error === false) {
$tmp = $plugin->get_config($id);
switch ($tmp['type']) {
case 'storage':
$storage = new storage();
$types = $storage->get_storage_types();
$deployment = new deployment();
$dep = $deployment->get_id_by_storagetype($id);
foreach ($dep as $val) {
if (in_array($val['value'], $types)) {
$msg .= sprintf($this->lang['error_in_use'], $id) . '<br>';
$error = true;
}
}
break;
}
}
if ($error === false) {
$return = $server->send_command("openqrm_server_plugin_command " . $id . " uninstall " . $GLOBALS['OPENQRM_ADMIN']->name . ' ' . $GLOBALS['OPENQRM_ADMIN']->password);
if ($return === true) {
if ($this->__check($id)) {
$msg .= sprintf($this->lang['msg'], $id) . '<br>';
} else {
$msg .= sprintf($this->lang['error_timeout'], $id) . '<br>';
}
} else {
$msg .= sprintf($this->lang['error_disable'], $id) . '<br>';
}
}
}
}
}
$this->response->redirect($this->response->get_url($this->actions_name, 'select', $this->message_param, $msg));
}