/** * Get PHP allocated memory usage */ public static function getMemUsage() { return Numeric::toBytes(memory_get_peak_usage()); }
/** * Get folder size in human readable format */ public function getByteSite($recursive = false) { $bytes = $recursive ? $this->getRecursiveSize() : $this->getSize(); return Numeric::toBytes($bytes); }
/** * Get file size in human readable format */ public function getByteSite() { return Numeric::toBytes($this->getSize()); }
/** * Get the formatted error text */ public function getErrorText($text = "") { $text = Utils::value($text, "Too many failed attempts."); $count = $this->session->get($this->key . ".info.fail_count", 0); $total = $this->session->get($this->key . ".info.fail_total", 0); $last = $this->session->get($this->key . ".info.last_attempt", 0); $keymap = array("attempts" => $total, "countdown" => Numeric::toCountdown($last, $this->cd_time), "count" => "(" . $count . "/" . $this->cd_trigger . ")", "total" => "(" . $total . "/" . $this->max_attempts . ")"); return Utils::render($text, $keymap); }