diff --git a/src/_h5ai/server/php/inc/class-api.php b/src/_h5ai/server/php/inc/class-api.php index 76e2621b..feb119f8 100644 --- a/src/_h5ai/server/php/inc/class-api.php +++ b/src/_h5ai/server/php/inc/class-api.php @@ -87,11 +87,6 @@ class Api { $response["items"] = $this->app->get_items($url, $what); } - if (Util::get_boolean_request_param("all_items", false)) { - - $response["all_items"] = $this->app->get_all_items(); - } - Util::json_exit($response); } diff --git a/src/_h5ai/server/php/inc/class-app.php b/src/_h5ai/server/php/inc/class-app.php index 2e4061a8..4557bb94 100644 --- a/src/_h5ai/server/php/inc/class-app.php +++ b/src/_h5ai/server/php/inc/class-app.php @@ -190,9 +190,6 @@ class App { return array(); } - // return $this->get_all_items(); - // return json_decode(file_get_contents(CACHE_PATH . "/item.json")); - $cache = array(); $folder = Item::get($this, $this->to_path($url), $cache); @@ -220,56 +217,6 @@ class App { } - private function get_all_item_content($item, &$cache) { - - foreach ($item->get_content($cache) as $child) { - if ($child->is_folder) { - $this->get_all_item_content($child, $cache); - } - } - } - - - public function cummulate_folders($item, &$cache) { - - if (!$item->is_folder) { - return; - } - - $max_date = $item->date; - $sum_size = 0; - foreach ($item->get_content($cache) as $child) { - $this->cummulate_folders($child, $cache); - if ($child->date > $max_date) { - $max_date = $child->date; - } - $sum_size += $child->size; - } - - $item->date = $max_date; - $item->size = $sum_size; - } - - - public function get_all_items() { - - $cache = array(); - $root = Item::get($this, ROOT_PATH, $cache); - - $this->get_all_item_content($root, $cache); - $this->cummulate_folders($root, $cache); - - uasort($cache, array("Item", "cmp")); - $result = array(); - foreach ($cache as $p => $item) { - $result[] = $item->to_json_object(); - } - - @file_put_contents(CACHE_PATH . "/item.json", json_encode($result)); - return $result; - } - - public function get_fallback() { $cache = array();