A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 551
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/system/core/Exceptions.php:271)

Filename: view/raw.php

Line Number: 2

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/themes/geocities/views/view/raw.php
Line: 2
Function: header

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 173
Function: include

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 43
Function: _ci_load

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 558
Function: view

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

package com.savvas.content.analyzer.util; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.stream.Stream; import org.apache.commons.io.FileUtils; import org.apache.commons.io.LineIterator; import org.json.JSONTokener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class FileUtil { private static final Logger LOGGER = LoggerFactory.getLogger(FileUtil.class); /** The Constant ERROR_LOG_MSG_1. */ private static final String ERROR_LOG_MSG_1 = "Exception: {}"; private FileUtil() {} public static void readFile(String filePath) throws IOException { File file = new File(filePath); LineIterator it = FileUtils.lineIterator(file, "UTF-8"); try { while (it.hasNext()) { String line = it.nextLine(); LOGGER.debug(line); } } finally { LineIterator.closeQuietly(it); } } public static List getDirFileList(String dirPath) { List pageXhtmls = new ArrayList<>(); try (Stream files = Files.list(Paths.get(dirPath)) ) { files.forEach(path -> pageXhtmls.add(path.toString())); } catch (IOException e) { LOGGER.error(ERROR_LOG_MSG_1, e); } return pageXhtmls; } public static List getRecursiveDirFileList(String dirPath) { List pageXhtmls = new ArrayList<>(); String[] pattern = {"xhtml", "html"}; Collection files = FileUtils.listFiles(new File(dirPath), pattern, true); files.forEach(path -> pageXhtmls.add(path.toString())); return pageXhtmls; } public static Object readFileAsObject(String filename) { String content = new String(readFileAsBytes(filename)); return new JSONTokener(content).nextValue(); } public static List readFileAsLines(String filePath) { List lines = new ArrayList<>(); try { File f = new File(filePath); return FileUtils.readLines(f, "UTF-8"); } catch (IOException e) { e.printStackTrace(); } return lines; } public static String readFileAsString(String filename) { return new String(readFileAsBytes(filename)); } public static byte[] readFileAsBytes(String filename) { byte[] temp = new byte[0]; try { temp = Files.readAllBytes(Paths.get(filename)); } catch (IOException e) { LOGGER.error(ERROR_LOG_MSG_1, e); } return temp; } public static void createDirectories(String filename) { try { Path path = Paths.get(filename); Files.createDirectories(path.getParent()); } catch (IOException e) { LOGGER.error(ERROR_LOG_MSG_1, e); } } public static boolean deleteFile(String filePath) { File fileToDelete = FileUtils.getFile(filePath); return FileUtils.deleteQuietly(fileToDelete); } }