function unload($cwd)
{
chdir($cwd);
if (!($error = error_get_last()) && session_status() == PHP_SESSION_ACTIVE) {
session_commit();
}
$handler = $this->hive['UNLOAD'];
if ((!$handler || $this->call($handler, $this) === FALSE) && $error && in_array($error['type'], [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR])) {
// Fatal error detected
$this->error(500, sprintf(self::E_Fatal, $error['message']), [$error]);
}
}