abitdodgy / cfw-usermanager

A user manager demo app for ColdFusion on Wheels
23 stars 11 forks source link

Dynamic CreateObject Switch #17

Closed ghost closed 11 years ago

ghost commented 11 years ago

Perhaps, for the next installment, instead of having to manually modify the Users.cfc CreateObject for Railo or CF, you could do something like:

if (StructKeyExists(server, "railo")){ CreateObject('java','BCrypt.class','/lib') }else{ CreateObject('java','bCrypt') }

So that there isn;t the need of Manually changing that particular CreateObject, the system would know automatically.

Just a thought,

ghost commented 11 years ago

The Actual Code I'm using is slightly different than above, I forgot to assign it as a Var: if (StructKeyExists(server, "railo")){ var bCrypt = CreateObject('java','BCrypt.class','/lib'); }else{ var bCrypt = CreateObject('java','bCrypt'); }

abitdodgy commented 11 years ago

Thanks for the example. I will move this into it's own class to avoid duplication!

On Wed, Oct 10, 2012 at 3:21 PM, James Harvey notifications@github.comwrote:

The Actual Code I'm using is slightly different than above, I forgot to assign it as a Var: if (StructKeyExists(server, "railo")){ var bCrypt = CreateObject('java','BCrypt.class','/lib'); }else{ var bCrypt = CreateObject('java','bCrypt'); }

— Reply to this email directly or view it on GitHubhttps://github.com/abitdodgy/cfw-usermanager/issues/17#issuecomment-9313777.

ghost commented 11 years ago

I was just thinking of a way to help simplify matters. If you need any help, let me know.

abitdodgy commented 11 years ago

Thanks! That's already very helpful, and so is any feedback--so please keep it coming!

abitdodgy commented 11 years ago

Fixed. Commit a17faea8210301fa465f5f017431dffdf66b1fa8