. * @author niel * @copyright 2016 nZEDb */ namespace App\Extensions\util\yenc\adapter; use yenc\yenc; class NzedbYenc { public static function decode(&$text, $ignore = false, array $options = []) { return (new yenc())->decode($text); } public static function decodeIgnore(&$text, array $options = []) { return (new yenc())->decode($text, true); } /** * Determines if this adapter is enabled by checking if the `yenc` extension is loaded. * * @return bool Returns `true` if enabled, otherwise `false`. */ public static function enabled() { return extension_loaded('yenc'); } public static function encode($data, $filename, $lineLength = 128) { return (new yenc())->encode($data, $filename, $lineLength); } }