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
'use strict';
var express = require('express'),
cors = require('cors'),
nconf = require('nconf'),
fs = require('fs'),
bodyParser = require('body-parser'),
cookieParser = require('cookie-parser'),
morgan = require('morgan'),
app = express();
// ===========================================
// Config
// ===========================================
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
// Set default node environment to development
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
// optional config for developer convenience
var localConfigFile = __dirname + '/config/config-local.json';
if (fs.existsSync(localConfigFile)) {
var overrides = JSON.parse(fs.readFileSync(localConfigFile));
nconf.overrides(overrides);
console.log('::LOCAL:: found config overrides in config-local.json!!');
}
nconf.argv().env();
var configFile = __dirname + '/config/config-' + nconf.get('NODE_ENV') + '.json';
var logConfigFile = __dirname + '/config/log-config-' + nconf.get('NODE_ENV') + '.json';
if (fs.existsSync(configFile)) {
nconf.file('config', configFile);
} else {
console.error('Missing environment config file', configFile);
}
if (fs.existsSync(logConfigFile)) {
nconf.file('logConfig', logConfigFile);
} else {
console.error('Missing environment log config file', logConfigFile);
}
console.log('Auth Gateway');
console.log('- running in [', nconf.get('NODE_ENV'), '] mode');
nconf.defaults({
port: 3000,
auth_cache_timeout: 3600
});
// Logging
var logger = require('./src/utils/logger'),
httpLogger = logger.loggers.get('http');
if (!httpLogger) {
httpLogger = logger;
}
app.use(bodyParser.json()); // support json encoded bodies
app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies
app.use(cookieParser());
app.use(cors());
// Express Logging
var skipFunction,
logFormat = nconf.get('access_log:format'),
skipConfigCode = nconf.get('access_log:skip_statusCode_less_than'),
accessLogStream = {
write: function(message) {httpLogger.info(message);}
};
if (skipConfigCode) {
skipFunction = function(req, res) { return res.statusCode < skipConfigCode; };
} else {
skipFunction = false;
}
app.use(morgan(logFormat, {
stream: accessLogStream,
skip: skipFunction
}
));
// Disable cache for all REST calls
app.use(function(req, res, next) {
res.setHeader('Cache-Control', 'max-age=0, no-cache, no-store');
return next();
});
app.set('etag', false);
// Routers
var sapiRouter = express.Router();
app.use('/sapi', sapiRouter);
//Swagger documentation
if (nconf.get('swaggerDocsEnabled')) {
var swaggerTools = require('swagger-tools'),
swaggerDocs = require('./src/docs/swaggerDoc.json'),
swagger = require('./src/utils/swagger');
if (nconf.get('webapp_url').indexOf('//') > -1) {
swaggerDocs.host = nconf.get('webapp_url').split('//')[1];
} else {
swaggerDocs.host = nconf.get('webapp_url');
}
swaggerDocs.info.contact.url = nconf.get('webapp_url');
swagger.validate(swaggerDocs);
swaggerTools.initializeMiddleware(swaggerDocs, function(middleware) {
// Interpret Swagger resources and attach metadata to request - must be first in swagger-tools middleware chain
sapiRouter.use(middleware.swaggerMetadata());
// Validate Swagger requests
sapiRouter.use(middleware.swaggerValidator());
// Serve the Swagger documents and Swagger UI
sapiRouter.use(middleware.swaggerUi());
logger.info('To access Swagger: ', nconf.get('webapp_url'), '/docs');
});
}
sapiRouter.get('/version', function(req, res) {
res.sendFile('version.txt', { root: __dirname });
});
var sasRouter = require('./src/sas/assignmentServiceToken.ctrl')(express.Router());
sapiRouter.use('/sas', sasRouter);
var notebookRouter = require('./src/notebook/notebookToken.ctrl')(express.Router());
sapiRouter.use('/notebook', notebookRouter);
var accountRouter = require('./src/account/account.ctrl')(express.Router());
sapiRouter.use('/account', accountRouter);
var lrsRouter = require('./src/lrs/lrs.ctrl')(express.Router());
sapiRouter.use('/lrs', lrsRouter);
var syncGatewayRouter = require('./src/sync-gateway/syncGatewaySession.ctrl')(express.Router());
sapiRouter.use('/sync-gateway', syncGatewayRouter);
var bookshelfRouter = require('./src/bookshelf/bookshelf.ctrl')(express.Router());
sapiRouter.use('/bookshelf', bookshelfRouter);
var booksRouter = require('./src/books/books.ctrl')(express.Router());
sapiRouter.use('/books', booksRouter);
var contentIndexRouter = require('./src/content-index/ciToken.ctrl')(express.Router());
sapiRouter.use('/ccci', contentIndexRouter);
// Server
var server = app.listen(nconf.get('port'), function() {
var port = server.address().port;
logger.info('listening on port %d', port);
app.get('/*', function(req, res, next) {
var excludes = ['/docs', '/api-docs'];
if (excludes.some(function(path) {
return req.path.startsWith(path);
})) {
return next();
} else {
res.sendFile('./src/index.html', {root: __dirname});
}
});
app.post('*', function(req, res) {
res.sendFile('./src/index.html', { root: __dirname });
});
});