Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2. ********************************************************************************
  3. * Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
  4. * www.coldbox.org | www.luismajano.com | www.ortussolutions.com
  5. ********************************************************************************
  6. * Allows you to maninpulate determine CFML engine capabilities
  7. */
  8. component {
  9.  
  10.     //setup the engine properties
  11.     this.ADOBE = "ADOBE";
  12.     this.RAILO = "RAILO";
  13.     this.LUCEE = "LUCEE";
  14.  
  15.     // JDK Version
  16.     this.JDK_VERSION = CreateObject( "java", "java.lang.System" ).getProperty( "java.version" );
  17.  
  18.     /**
  19.     * Constructor
  20.     */
  21.     function init() {
  22.         // Engine Turn off/on features
  23.         instance = structnew();
  24.         // adobe features
  25.         instance.adobe = {};
  26.         // railo only features
  27.         instance.railo = {};
  28.         // lucee only features
  29.         instance.lucee = {};
  30.  
  31.         return this;
  32.  
  33.     }
  34.  
  35. // ------------------------------------------- PUBLIC -------------------------------------------
  36.  
  37.     /**
  38.     * Returns the current running CFML major version
  39.     */
  40.     numeric function getVersion() {
  41.         return listfirst( server.coldfusion.productversion );
  42.     }
  43.  
  44.     /**
  45.     * Returns the current running CFML full version
  46.     */
  47.     string function getFullVersion() {
  48.         return server.coldfusion.productversion;
  49.     }
  50.  
  51.     /**
  52.     * Get the current CFML Engine
  53.     */
  54.     string function getEngine() {
  55.         var engine = this.adobe;
  56.  
  57.         if ( server.coldfusion.productname eq "Railo" ){
  58.             engine = this.railo;
  59.         } else if ( server.coldfusion.productname eq "Lucee" ){
  60.             engine = this.lucee;
  61.         }
  62.  
  63.         return engine;
  64.     }
  65.  
  66.     /**
  67.     * Feature Active Check
  68.     * @feature.hint The feature to check
  69.     * @engine.hint The engine we are checking
  70.     */
  71.     boolean function featureCheck( required string feature, required string engine ) {
  72.         return instance[ arguments.engine ][ arguments.feature ];
  73.     }
  74.  
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement