[ pathinfo($i, PATHINFO_FILENAME), ...array_slice(getimagesize($em_dir . "/" . $i), 0, 2), ], array_values( array_filter( scandir($em_dir), fn($i) => $i[0] !== "." && is_file($em_dir . "/" . $i) && strtolower(pathinfo($i, PATHINFO_EXTENSION)) === "gif" ) ) ); usort($emoticons, fn($a, $b) => strlen($b[0]) <=> strlen($a[0])); $emoticons_alpha_lookup = []; foreach ($emoticons as $i => $emoticon) { $emoticons_alpha_lookup []= [$i, $emoticon[0]]; } usort($emoticons_alpha_lookup, fn($a, $b) => $a[1] <=> $b[1]); $emoticons_alpha_lookup = array_column($emoticons_alpha_lookup, 0); return [ "emoticons.js", "/* auto-generated at " . date("c") . " */\nvar EMOTICONS = " . json_encode([ $emoticons, $emoticons_alpha_lookup, ]) . ";\n", ];