// Load settings from database; note we need autoload for this
Config::loadSettings();
+ self::verifyLoadedConfig();
+
self::initPlugins();
}
}
}
+ /**
+ * Verify that the loaded config is good. Not complete, but will
+ * throw exceptions on common configuration problems I hope.
+ *
+ * Might make changes to the filesystem, to created dirs, but will
+ * not make database changes.
+ */
+ static function verifyLoadedConfig()
+ {
+ if (common_config('htmlpurifier', 'Cache.DefinitionImpl') === 'Serializer'
+ && !is_dir(common_config('htmlpurifier', 'Cache.SerializerPath'))) {
+ if (!mkdir(common_config('htmlpurifier', 'Cache.SerializerPath'))) {
+ throw new ServerException('Could not create HTMLPurifier cache dir: '._ve(common_config('htmlpurifier', 'Cache.SerializerPath')));
+ }
+ }
+ }
+
/**
* Are we running from the web with HTTPS?
*