@@ -269,6 +269,7 @@ function Framework() {
269269 'allow-compile-html' : true ,
270270 'allow-performance' : false ,
271271 'allow-custom-titles' : false ,
272+ 'allow-compatibility' : true ,
272273 'disable-strict-server-certificate-validation' : true ,
273274 'disable-clear-temporary-directory' : false ,
274275
@@ -1914,8 +1915,12 @@ Framework.prototype.install = function(type, name, declaration, options, callbac
19141915 else
19151916 self . sources [ name ] = obj ;
19161917
1917- if ( typeof ( obj . install ) === TYPE_FUNCTION )
1918- obj . install ( self , options , name ) ;
1918+ if ( typeof ( obj . install ) === TYPE_FUNCTION ) {
1919+ if ( framework . config [ 'allow-compatibility' ] )
1920+ obj . install ( self , options , name ) ;
1921+ else
1922+ obj . install ( options , name ) ;
1923+ }
19191924
19201925 if ( ! skipEmit ) {
19211926 setTimeout ( function ( ) {
@@ -2094,8 +2099,12 @@ Framework.prototype.install_make = function(key, name, obj, options, callback, s
20942099
20952100 _controller = routeID ;
20962101
2097- if ( typeof ( obj . install ) === TYPE_FUNCTION )
2098- obj . install ( self , options , name ) ;
2102+ if ( typeof ( obj . install ) === TYPE_FUNCTION ) {
2103+ if ( framework . config [ 'allow-compatibility' ] )
2104+ obj . install ( self , options , name ) ;
2105+ else
2106+ obj . install ( options , name ) ;
2107+ }
20992108
21002109 me . processed = true ;
21012110
@@ -2207,8 +2216,12 @@ Framework.prototype.uninstall = function(type, name, options, skipEmit) {
22072216 if ( obj . id )
22082217 delete require . cache [ require . resolve ( obj . id ) ] ;
22092218
2210- if ( typeof ( obj . uninstall ) === TYPE_FUNCTION )
2211- obj . uninstall ( self , options , name ) ;
2219+ if ( typeof ( obj . uninstall ) === TYPE_FUNCTION ) {
2220+ if ( framework . config [ 'allow-compatibility' ] )
2221+ obj . uninstall ( self , options , name ) ;
2222+ else
2223+ obj . uninstall ( options , name ) ;
2224+ }
22122225
22132226 if ( type === 'model' )
22142227 delete self . models [ name ] ;
@@ -2240,8 +2253,12 @@ Framework.prototype.uninstall = function(type, name, options, skipEmit) {
22402253 self . routes . websockets = self . routes . websockets . remove ( 'controller' , id ) ;
22412254
22422255 if ( obj ) {
2243- if ( obj . uninstall )
2244- obj . uninstall ( self , options , name ) ;
2256+ if ( obj . uninstall ) {
2257+ if ( framework . config [ 'allow-compatibility' ] )
2258+ obj . uninstall ( self , options , name ) ;
2259+ else
2260+ obj . uninstall ( options , name ) ;
2261+ }
22452262
22462263 if ( isModule )
22472264 delete self . modules [ name ] ;
0 commit comments