本文整理汇总了PHP中Toolbox::deleteDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Toolbox::deleteDir方法的具体用法?PHP Toolbox::deleteDir怎么用?PHP Toolbox::deleteDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Toolbox
的用法示例。
在下文中一共展示了Toolbox::deleteDir方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: plugin_positions_uninstall
function plugin_positions_uninstall()
{
global $DB;
$tables = array("glpi_plugin_positions_positions", "glpi_plugin_positions_positions_items", "glpi_plugin_positions_profiles", "glpi_plugin_positions_imageitems", "glpi_plugin_positions_infos");
foreach ($tables as $table) {
$DB->query("DROP TABLE IF EXISTS `{$table}`;");
}
$rep_files_positions = GLPI_PLUGIN_DOC_DIR . "/positions";
Toolbox::deleteDir($rep_files_positions);
$tables_glpi = array("glpi_displaypreferences", "glpi_documents_items", "glpi_bookmarks", "glpi_logs", "glpi_tickets");
foreach ($tables_glpi as $table_glpi) {
$DB->query("DELETE FROM `{$table_glpi}` WHERE `itemtype` = 'PluginPositionsPosition' ;");
}
return true;
}
示例2: plugin_archires_uninstall
function plugin_archires_uninstall()
{
global $DB;
$tables = array("glpi_plugin_archires_imageitems", "glpi_plugin_archires_views", "glpi_plugin_archires_networkinterfacecolors", "glpi_plugin_archires_vlancolors", "glpi_plugin_archires_statecolors", "glpi_plugin_archires_profiles", "glpi_plugin_archires_locationqueries", "glpi_plugin_archires_networkequipmentqueries", "glpi_plugin_archires_appliancequeries", "glpi_plugin_archires_querytypes");
foreach ($tables as $table) {
$DB->query("DROP TABLE IF EXISTS `{$table}`;");
}
//old versions
$tables = array("glpi_plugin_archires_query_location", "glpi_plugin_archires_query_switch", "glpi_plugin_archires_query_applicatifs", "glpi_plugin_archires_image_device", "glpi_plugin_archires_query_type", "glpi_plugin_archires_color_iface", "glpi_plugin_archires_color_state", "glpi_plugin_archires_config", "glpi_plugin_archires_color_vlan");
foreach ($tables as $table) {
$DB->query("DROP TABLE IF EXISTS `{$table}`;");
}
$rep_files_archires = GLPI_PLUGIN_DOC_DIR . "/archires";
Toolbox::deleteDir($rep_files_archires);
$tables_glpi = array("glpi_displaypreferences", "glpi_documents_items", "glpi_bookmarks", "glpi_logs");
foreach ($tables_glpi as $table_glpi) {
$DB->query("DELETE FROM `{$table_glpi}`\n WHERE `itemtype` = 'PluginArchiresLocationQuery'\n OR `itemtype` = 'PluginArchiresNetworkEquipmentQuery'\n OR `itemtype` = 'PluginArchiresApplianceQuery'\n OR `itemtype` = 'PluginArchiresView';");
}
return true;
}
示例3: uninstall
static function uninstall()
{
global $DB;
if (is_dir(PLUGIN_THEMES_UPLOAD_DIR)) {
Toolbox::deleteDir(PLUGIN_THEMES_UPLOAD_DIR);
}
if (TableExists("glpi_plugin_themes_themes")) {
$result = $DB->query("DROP TABLE IF EXISTS `glpi_plugin_themes_themes`;");
} else {
$result = true;
}
if (TableExists("glpi_plugin_themes_per_user")) {
$result = $DB->query("DROP TABLE IF EXISTS `glpi_plugin_themes_per_user`;");
} else {
$result = true;
}
if (!$result) {
return array('success' => false, 'msg' => 'Uninstallation Error');
} else {
return array('success' => true);
}
}
示例4: plugin_custom_uninstall
function plugin_custom_uninstall()
{
global $DB;
//Delete plugin's table
$tables = array('glpi_plugin_custom_tabs', 'glpi_plugin_custom_defaulttabs', 'glpi_plugin_custom_styles', 'glpi_plugin_custom_profiles', 'glpi_plugin_custom_tabprofiles');
foreach ($tables as $table) {
$DB->query("DROP TABLE IF EXISTS `{$table}`");
}
//delete plugin files dir
Toolbox::deleteDir(CUSTOM_FILES_DIR);
return true;
}
示例5: plugin_projet_uninstall
function plugin_projet_uninstall()
{
global $DB;
$tables = array("glpi_plugin_projet_projets", "glpi_plugin_projet_projetstates", "glpi_plugin_projet_projets_items", "glpi_plugin_projet_projets_projets", "glpi_plugin_projet_tasks", "glpi_plugin_projet_tasks_items", "glpi_plugin_projet_taskstates", "glpi_plugin_projet_tasktypes", "glpi_plugin_projet_taskplannings", "glpi_plugin_projet_tasks_tasks", "glpi_plugin_projet_profiles", "glpi_plugin_projet_followups");
foreach ($tables as $table) {
$DB->query("DROP TABLE IF EXISTS `{$table}`;");
}
$oldtables = array("glpi_plugin_projet", "glpi_plugin_projet_items", "glpi_plugin_projet_tasks", "glpi_plugin_projet_tasks_items", "glpi_dropdown_plugin_projet_tasks_type", "glpi_plugin_projet_mailing", "glpi_dropdown_plugin_projet_status", "glpi_dropdown_plugin_projet_task_status", "glpi_plugin_project", "glpi_plugin_project_items", "glpi_plugin_project_tasks", "glpi_plugin_project_tasks_items", "glpi_dropdown_plugin_project_status", "glpi_dropdown_plugin_project_tasks_type", "glpi_dropdown_plugin_project_task_status", "glpi_plugin_project_mailing", "glpi_plugin_project_profiles", "glpi_plugin_project_users", "glpi_plugin_project_setup", "glpi_plugin_project_groups", "glpi_plugin_project_items", "glpi_plugin_project_enterprises", "glpi_plugin_project_contracts", "glpi_plugin_project_documents", "glpi_dropdown_project_tasks_type", "glpi_project", "glpi_project_tasks", "glpi_project_user", "glpi_project_items", "glpi_plugin_projet_projetitems", "glpi_plugin_projet_mailings", "glpi_plugin_projet_taskitems");
foreach ($oldtables as $oldtable) {
$DB->query("DROP TABLE IF EXISTS `{$oldtable}`;");
}
$rep_files_projet = GLPI_PLUGIN_DOC_DIR . "/projet";
Toolbox::deleteDir($rep_files_projet);
$in = "IN (" . implode(',', array("'PluginProjetProjet'", "'PluginProjetTask'")) . ")";
$tables = array("glpi_displaypreferences", "glpi_documents_items", "glpi_contracts_items", "glpi_bookmarks", "glpi_logs", "glpi_tickets");
foreach ($tables as $table) {
$query = "DELETE FROM `{$table}` WHERE (`itemtype` " . $in . " ) ";
$DB->query($query);
}
$notif = new Notification();
$options = array('itemtype' => 'PluginProjetProjet', 'event' => 'new', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginProjetProjet', 'event' => 'update', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginProjetProjet', 'event' => 'delete', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginProjetProjet', 'event' => 'newtask', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginProjetProjet', 'event' => 'updatetask', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginProjetProjet', 'event' => 'deletetask', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
//templates
$template = new NotificationTemplate();
$translation = new NotificationTemplateTranslation();
$options = array('itemtype' => 'PluginProjetProjet', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notificationtemplates', $options) as $data) {
$options_template = array('notificationtemplates_id' => $data['id'], 'FIELDS' => 'id');
foreach ($DB->request('glpi_notificationtemplatetranslations', $options_template) as $data_template) {
$translation->delete($data_template);
}
$template->delete($data);
}
return true;
}
示例6: array
$t->getFromDB($_GET['activate']);
PluginThemesTheme::resetActiveTheme();
$values = array('id' => $_GET['activate'], 'active_theme' => '1');
$t->update($values);
header('location:' . $CFG_GLPI['root_doc'] . '/plugins/themes/front/themes.php');
}
if (isset($_GET['delete']) && PluginThemesTheme::canCreate()) {
if (!$t->getFromDB($_GET['delete'])) {
global $CFG_GLPI;
Session::addMessageAfterRedirect(__('Error while deleting', 'themes'), false, ERROR);
header('location:' . $CFG_GLPI['root_doc'] . '/plugins/themes/front/themes.php');
}
if ($t->fields['active_theme'] == "1") {
$DB->query("UPDATE glpi_plugin_themes_themes SET active_theme = 1 WHERE name = 'GLPI'");
}
if (is_dir(PLUGIN_THEMES_UPLOAD_DIR . "/" . $t->fields['name'])) {
Toolbox::deleteDir(PLUGIN_THEMES_UPLOAD_DIR . "/" . $t->fields['name']);
}
$DB->query("DELETE FROM glpi_plugin_themes_per_user WHERE theme_id = {$t->fields['id']};");
$DB->query("DELETE FROM glpi_plugin_themes_themes WHERE id = {$_GET['delete']};");
Session::addMessageAfterRedirect(__('Theme deleted', 'themes'), false, INFO);
header('location:' . $CFG_GLPI['root_doc'] . '/plugins/themes/front/themes.php');
}
$plugin = new Plugin();
Html::header(__('Themes manager', 'themes'), '', "plugins", "themes");
if (plugin_themes_haveRight('themes', 'r')) {
PluginThemesTheme::showAllThemes();
} else {
Html::displayRightError();
}
Html::footer();
示例7: plugin_datainjection_uninstall
function plugin_datainjection_uninstall()
{
global $DB;
$tables = array("glpi_plugin_datainjection_models", "glpi_plugin_datainjection_modelcsvs", "glpi_plugin_datainjection_mappings", "glpi_plugin_datainjection_infos", "glpi_plugin_datainjection_filetype", "glpi_plugin_datainjection_profiles");
foreach ($tables as $table) {
if (TableExists($table)) {
$DB->queryOrDie("DROP TABLE IF EXISTS `" . $table . "`", $DB->error());
}
}
if (is_dir(PLUGIN_DATAINJECTION_UPLOAD_DIR)) {
Toolbox::deleteDir(PLUGIN_DATAINJECTION_UPLOAD_DIR);
}
plugin_init_datainjection();
return true;
}
示例8: plugin_resources_uninstall
//.........这里部分代码省略.........
$DB->query($query);
}
//drop rules
$Rule = new Rule();
$a_rules = $Rule->find("`sub_type`='PluginResourcesRuleChecklist'\n OR `sub_type`='PluginResourcesRuleContracttype'");
foreach ($a_rules as $data) {
$Rule->delete($data);
}
$notif = new Notification();
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'new', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'update', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'delete', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'newtask', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'updatetask', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'deletetask', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'AlertExpiredTasks', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'AlertLeavingResources', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'AlertArrivalChecklists', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'AlertLeavingChecklists', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'LeavingResource', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'report', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'newresting', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'updateresting', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'deleteresting', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'newholiday', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'updateholiday', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
$options = array('itemtype' => 'PluginResourcesResource', 'event' => 'deleteholiday', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notifications', $options) as $data) {
$notif->delete($data);
}
//templates
$template = new NotificationTemplate();
$translation = new NotificationTemplateTranslation();
$options = array('itemtype' => 'PluginResourcesResource', 'FIELDS' => 'id');
foreach ($DB->request('glpi_notificationtemplates', $options) as $data) {
$options_template = array('notificationtemplates_id' => $data['id'], 'FIELDS' => 'id');
foreach ($DB->request('glpi_notificationtemplatetranslations', $options_template) as $data_template) {
$translation->delete($data_template);
}
$template->delete($data);
}
if (class_exists('PluginDatainjectionModel')) {
PluginDatainjectionModel::clean(array('itemtype' => 'PluginResourcesResource'));
PluginDatainjectionModel::clean(array('itemtype' => 'PluginResourcesClient'));
}
$rep_files_resources = GLPI_PLUGIN_DOC_DIR . "/resources";
Toolbox::deleteDir($rep_files_resources);
return true;
}
示例9: plugin_positions_uninstall
function plugin_positions_uninstall()
{
global $DB;
$tables = array("glpi_plugin_positions_positions", "glpi_plugin_positions_positions_items", "glpi_plugin_positions_imageitems", "glpi_plugin_positions_infos", "glpi_plugin_positions_configs");
foreach ($tables as $table) {
$DB->query("DROP TABLE IF EXISTS `{$table}`;");
}
$rep_files_positions = GLPI_PLUGIN_DOC_DIR . "/positions";
Toolbox::deleteDir($rep_files_positions);
$tables_glpi = array("glpi_displaypreferences", "glpi_documents_items", "glpi_bookmarks", "glpi_logs", "glpi_tickets");
foreach ($tables_glpi as $table_glpi) {
$DB->query("DELETE FROM `{$table_glpi}` WHERE `itemtype` = 'PluginPositionsPosition' ;");
}
//Delete rights associated with the plugin
$profileRight = new ProfileRight();
foreach (PluginPositionsProfile::getAllRights() as $right) {
$profileRight->deleteByCriteria(array('name' => $right['field']));
}
PluginPositionsMenu::removeRightsFromSession();
PluginPositionsProfile::removeRightsFromSession();
return true;
}
示例10: plugin_mreporting_uninstall
function plugin_mreporting_uninstall()
{
global $DB;
$queries = array("DROP TABLE IF EXISTS glpi_plugin_mreporting_profiles", "DROP TABLE IF EXISTS glpi_plugin_mreporting_configs", "DROP TABLE IF EXISTS glpi_plugin_mreporting_preferences", "DROP TABLE IF EXISTS glpi_plugin_mreporting_notifications");
foreach ($queries as $query) {
$DB->query($query);
}
$rep_files_mreporting = GLPI_PLUGIN_DOC_DIR . "/mreporting";
$notifications_folder = GLPI_PLUGIN_DOC_DIR . "/mreporting/notifications";
Toolbox::deleteDir($notifications_folder);
Toolbox::deleteDir($rep_files_mreporting);
$tables_glpi = array("glpi_displaypreferences", "glpi_bookmarks");
foreach ($tables_glpi as $table_glpi) {
$DB->query("DELETE FROM `{$table_glpi}` WHERE `itemtype` = 'PluginMreportingConfig' ;");
}
require_once "inc/notification.class.php";
PluginMreportingNotification::uninstall();
return true;
}