diff --git a/api.js b/api.js index 5da33cc..baa1ef4 100644 --- a/api.js +++ b/api.js @@ -8,7 +8,6 @@ var http = require( "http" ); var conf = cl.load( "config.all" ).botanjs; -var Session = cl.load( "botansx.modular.session" ); var hash = cl.load( "botansx.utils.hash" ); var rand = cl.load( "botansx.utils.random" ); @@ -19,6 +18,7 @@ var BotanJS = function() this.kv = {}; this.embed = {}; this._nonce = {}; + this.disabled = false; }; util.inherits( BotanJS, events.EventEmitter ); @@ -77,6 +77,12 @@ BotanJS.prototype.compile = function( type ) { var _self = this; + if( this.disabled ) + { + _self.emit( "complete" ); + return; + } + var j = conf.debug ? [ "Components.Console" ] : []; for( var i in this.sv ) if( this.sv[ i ] ) j.push( i ); for( var i in this.kv ) if( this.kv[ i ] ) j.push( i ); @@ -99,6 +105,7 @@ BotanJS.prototype.compile = function( type ) var q = j.join( "," ); var lookupKey = hash.md5( q ); + var Session = cl.load( "botansx.modular.session" ); var fastCache = new Session( lookupKey, "BOTAN_JCACHE", true ); var deflateComplete = function( err, data )