本文整理匯總了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));
}