<commit_before>var path = require('path'),
	multer  = require('multer');
module.exports = function(periodic){
	// express,app,logger,config,db,mongoose
	var adminRouter = periodic.express.Router(),
		postRouter = periodic.express.Router(),
		tagRouter = periodic.express.Router(),
		tagAdminRouter = periodic.express.Router(),
		mediaRouter = periodic.express.Router(),
		contenttypeRouter = periodic.express.Router(),
		contenttypeAdminRouter = periodic.express.Router(),
		categoryRouter = periodic.express.Router(),
		categoryAdminRouter = periodic.express.Router(),
		collectionRouter = periodic.express.Router(),
		// collectionAdminRouter = periodic.express.Router(),
		extensionRouter = periodic.express.Router(),
		themeRouter = periodic.express.Router(),
		themeController = require('../../../../app/controller/theme')(periodic),
		extController = require('../../../../app/controller/extension')(periodic),
		postController = require('../../../../app/controller/post')(periodic),
		tagController = require('../../../../app/controller/tag')(periodic),
		mediaassetController = require('../../../../app/controller/asset')(periodic),
		categoryController = require('../../../../app/controller/category')(periodic),
		contenttypeController = require('../../../../app/controller/contenttype')(periodic),
		collectionController = require('../../../../app/controller/collection')(periodic),
		adminController = require('./controller/admin')(periodic),
		authController = require('../periodicjs.ext.login/controller/auth')(periodic);

	/**
	 * admin routes
	 */
	adminRouter.get('/',authController.ensureAuthenticated,adminController.index);
	adminRouter.get('/extensions',authController.ensureAuthenticated,adminController.loadExtensions,adminController.extensions_index);
	adminRouter.get('/themes',authController.ensureAuthenticated,adminController.loadThemes,adminController.themes_index);
	adminRouter.get('/posts',authController.ensureAuthenticated,postController.loadPosts,adminController.posts_index);
	adminRouter.get('/contenttypes',authController.ensureAuthenticated,contenttypeController.loadContenttypes,adminController.contenttypes_index);
	adminRouter.get('/tags',authController.ensureAuthenticated,tagController.loadTags,adminController.tags_index);
	adminRouter.get('/categories',authController.ensureAuthenticated,categoryController.loadCategories,adminController.categories_index);
	adminRouter.get('/collections',authController.ensureAuthenticated,collectionController.loadCollections,adminController.collections_index);
	adminRouter.get('/assets',authController.ensureAuthenticated,mediaassetController.loadAssets,adminController.assets_index);
	adminRouter.get('/mailer',authController.ensureAuthenticated,adminController.mail_index);
	/**
	 * admin/extension manager routes
	 */
	extensionRouter.get('/install',authController.ensureAuthenticated,extController.install);
	extensionRouter.get('/install/log/:extension/:date',authController.ensureAuthenticated,extController.install_getOutputLog);
	extensionRouter.get('/upload/log/:extension/:date',authController.ensureAuthenticated,extController.upload_getOutputLog);
	extensionRouter.get('/remove/log/:extension/:date',authController.ensureAuthenticated,extController.remove_getOutputLog);
	extensionRouter.get('/cleanup/log/:extension/:date',authController.ensureAuthenticated,extController.cleanup_log);
	extensionRouter.get('/:id/disable',authController.ensureAuthenticated,adminController.loadExtension,extController.disable);
	extensionRouter.get('/:id/enable',authController.ensureAuthenticated,adminController.loadExtension,extController.enable);
	extensionRouter.post('/upload',authController.ensureAuthenticated,mediaassetController.upload,extController.upload_install);
	extensionRouter.post('/:id/delete',authController.ensureAuthenticated,adminController.loadExtension,extController.remove);
	extensionRouter.get('/:id',authController.ensureAuthenticated,adminController.loadExtension,adminController.extension_show);
	/**
	 * admin/theme manager routes
	 */
	themeRouter.get('/install',authController.ensureAuthenticated,themeController.install);
	themeRouter.get('/install/log/:theme/:date',authController.ensureAuthenticated,themeController.install_getOutputLog);
	themeRouter.get('/upload/log/:theme/:date',authController.ensureAuthenticated,themeController.upload_getOutputLog);
	themeRouter.get('/remove/log/:theme/:date',authController.ensureAuthenticated,themeController.remove_getOutputLog);
	themeRouter.get('/cleanup/log/:theme/:date',authController.ensureAuthenticated,themeController.cleanup_log);<commit_msg>fixed dynamic extension loading for enabling<commit_after>var path = require('path'),
	multer  = require('multer');
module.exports = function(periodic){
	// express,app,logger,config,db,mongoose
	var adminRouter = periodic.express.Router(),
		postRouter = periodic.express.Router(),
		tagRouter = periodic.express.Router(),
		tagAdminRouter = periodic.express.Router(),
		mediaRouter = periodic.express.Router(),
		contenttypeRouter = periodic.express.Router(),
		contenttypeAdminRouter = periodic.express.Router(),
		categoryRouter = periodic.express.Router(),
		categoryAdminRouter = periodic.express.Router(),
		collectionRouter = periodic.express.Router(),
		// collectionAdminRouter = periodic.express.Router(),
		extensionRouter = periodic.express.Router(),
		themeRouter = periodic.express.Router(),
		themeController = require('../../../../app/controller/theme')(periodic),
		extController = require('../../../../app/controller/extension')(periodic),
		postController = require('../../../../app/controller/post')(periodic),
		tagController = require('../../../../app/controller/tag')(periodic),
		mediaassetController = require('../../../../app/controller/asset')(periodic),
		categoryController = require('../../../../app/controller/category')(periodic),
		contenttypeController = require('../../../../app/controller/contenttype')(periodic),
		collectionController = require('../../../../app/controller/collection')(periodic),
		adminController = require('./controller/admin')(periodic),
		authController = require('../periodicjs.ext.login/controller/auth')(periodic);

	/**
	 * admin routes
	 */
	// adminRouter.get('/',authController.ensureAuthenticated,adminController.index);
	adminRouter.get('/',function(req,res,next){
		res.redirect('/p-admin/posts');
	});
	adminRouter.get('/extensions',authController.ensureAuthenticated,adminController.loadExtensions,adminController.extensions_index);
	adminRouter.get('/themes',authController.ensureAuthenticated,adminController.loadThemes,adminController.themes_index);
	adminRouter.get('/posts',authController.ensureAuthenticated,postController.loadPosts,adminController.posts_index);
	adminRouter.get('/contenttypes',authController.ensureAuthenticated,contenttypeController.loadContenttypes,adminController.contenttypes_index);
	adminRouter.get('/tags',authController.ensureAuthenticated,tagController.loadTags,adminController.tags_index);
	adminRouter.get('/categories',authController.ensureAuthenticated,categoryController.loadCategories,adminController.categories_index);
	adminRouter.get('/collections',authController.ensureAuthenticated,collectionController.loadCollections,adminController.collections_index);
	adminRouter.get('/assets',authController.ensureAuthenticated,mediaassetController.loadAssets,adminController.assets_index);
	adminRouter.get('/mailer',authController.ensureAuthenticated,adminController.mail_index);
	/**
	 * admin/extension manager routes
	 */
	extensionRouter.get('/install',authController.ensureAuthenticated,extController.install);
	extensionRouter.get('/install/log/:extension/:date',authController.ensureAuthenticated,extController.install_getOutputLog);
	extensionRouter.get('/upload/log/:extension/:date',authController.ensureAuthenticated,extController.upload_getOutputLog);
	extensionRouter.get('/remove/log/:extension/:date',authController.ensureAuthenticated,extController.remove_getOutputLog);
	extensionRouter.get('/cleanup/log/:extension/:date',authController.ensureAuthenticated,extController.cleanup_log);
	extensionRouter.get('/:id/disable',authController.ensureAuthenticated,adminController.loadExtensions,adminController.loadExtension,extController.disable);
	extensionRouter.get('/:id/enable',authController.ensureAuthenticated,adminController.loadExtensions,adminController.loadExtension,extController.enable);
	extensionRouter.post('/upload',authController.ensureAuthenticated,mediaassetController.upload,extController.upload_install);
	extensionRouter.post('/:id/delete',authController.ensureAuthenticated,adminController.loadExtension,extController.remove);
	extensionRouter.get('/:id',authController.ensureAuthenticated,adminController.loadExtension,adminController.extension_show);
	/**
	 * admin/theme manager routes
	 */
	themeRouter.get('/install',authController.ensureAuthenticated,themeController.install);
	themeRouter.get('/install/log/:theme/:date',authController.ensureAuthenticated,themeController.install_getOutputLog);
	themeRouter.get('/upload/log/:theme/:date',authController.ensureAuthenticated,themeController.upload_getOutputLog);
	themeRouter.get('/remove/log/:theme/:date',authController.ensureAuthenticated,themeController.remove_getOutputLog);
	themeRouter.get('/cleanup/log/:theme/:date',authController.ensureAuthenticated,themeController.cleanup_log);
{'fraction_non_alphanumeric': 0.14715896999361566, 'fraction_numerical': 0.0, 'mean_word_length': 7.934410646387833, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1900069', 'n_tokens_mistral': 2465, 'n_tokens_neox': 2407, 'n_words': 182}