public static function readfile($file) { $file = config::$encryptLocalStorage ? "{$file}." . config::$encrypedLocalStorageExtention : "{$file}"; gio::log("Reading file: {$file} ...", VERBOSE); $fp = @fopen("{$file}", 'rb'); !config::$encryptLocalStorage ? '' : @stream_filter_append($fp, GsonCrypt::getLocalEncAlgo('mdecrypt'), STREAM_FILTER_READ, GsonCrypt::getLocalEncKeys()); $data = rtrim(@stream_get_contents($fp)); @fclose($fp); if ($data) { gio::log("... Done reading file: {$file}", VERBOSE); } else { gio::log("... Error reading file: {$file} ...", E_USER_WARNING); } return $data; }