summaryrefslogtreecommitdiff
path: root/includes/refresh/cleanup.inc
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-03-27 22:22:53 +0200
committerRaindropsSys <contact@minteck.org>2023-03-27 22:22:53 +0200
commite98e95d89939cdc1252d02df04ae8d91c6aa8c92 (patch)
treea5d5535f8058f1a7b45a31a1caf36ab7e24ff19d /includes/refresh/cleanup.inc
parent6ab243c12f2514cd0f40e80504223664755a6da4 (diff)
downloadpluralconnect-e98e95d89939cdc1252d02df04ae8d91c6aa8c92.tar.gz
pluralconnect-e98e95d89939cdc1252d02df04ae8d91c6aa8c92.tar.bz2
pluralconnect-e98e95d89939cdc1252d02df04ae8d91c6aa8c92.zip
Updated 9 files, added 9 files, deleted 3 files and renamed includes/refresh/logo.inc (automated)
Diffstat (limited to 'includes/refresh/cleanup.inc')
-rw-r--r--includes/refresh/cleanup.inc24
1 files changed, 0 insertions, 24 deletions
diff --git a/includes/refresh/cleanup.inc b/includes/refresh/cleanup.inc
deleted file mode 100644
index 39ec41a..0000000
--- a/includes/refresh/cleanup.inc
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-$screens = array_values(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/screens"), function ($i) {
- return !str_starts_with($i, ".");
-}));
-
-$computers = array_values(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata"), function ($i) {
- return !str_starts_with($i, ".");
-}));
-
-foreach ($screens as $screen) {
- $delete = true;
- $id = explode(".", explode("-", $screen)[2])[0];
-
- foreach ($computers as $file) {
- $computer = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $file), true);
-
- foreach ($computer["screens"] as $sel) {
- if ($sel["id"] === $id) $delete = false;
- }
- }
-
- if ($delete) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/screens/" . $screen);
-} \ No newline at end of file