|
257 | 257 | ',', '|', 'all' ) <!---convert commas to pipes (or's)--->
|
258 | 258 | />
|
259 | 259 | <!--- if resources folder exists, use internal bean factory --->
|
260 |
| - <cfset _taffyRequest.resourcePath = getDirectoryFromPath(getBaseTemplatePath()) & '/resources' /> |
| 260 | + <cfset _taffyRequest.resourcePath = guessResourcesFullPath() /> |
261 | 261 | <cfif directoryExists(_taffyRequest.resourcePath)>
|
262 | 262 | <!--- setup internal bean factory --->
|
263 | 263 | <cfset application._taffy.factory = createObject("component", "taffy.core.factory").init() />
|
264 |
| - <cfset application._taffy.factory.loadBeansFromPath(_taffyRequest.resourcePath) /> |
| 264 | + <cfset application._taffy.factory.loadBeansFromPath(_taffyRequest.resourcePath, guessResourcesCFCPath()) /> |
265 | 265 | <cfset application._taffy.beanList = application._taffy.factory.getBeanList() />
|
266 | 266 | <cfset cacheBeanMetaData(application._taffy.factory, application._taffy.beanList) />
|
267 | 267 | <cfset application._taffy.status.internalBeanFactoryUsed = true />
|
|
470 | 470 | <cfreturn local.returnData />
|
471 | 471 | </cffunction>
|
472 | 472 |
|
| 473 | + <cffunction name="guessResourcesPath" access="private" output="false" returntype="string"> |
| 474 | + <cfset local.indexcfmpath = cgi.script_name /> |
| 475 | + <cfset local.resourcesPath = listDeleteAt(local.indexcfmpath, listLen(local.indexcfmpath, "/"), "/") & "/resources" /> |
| 476 | + <cfreturn local.resourcesPath /> |
| 477 | + </cffunction> |
| 478 | + |
| 479 | + <cffunction name="guessResourcesFullPath" access="private" output="false" returntype="string"> |
| 480 | + <cfreturn expandPath(guessResourcesPath()) /> |
| 481 | + </cffunction> |
| 482 | + |
| 483 | + <cffunction name="guessResourcesCFCPath" access="private" output="false" returntype="string"> |
| 484 | + <cfset var path = guessResourcesPath() /> |
| 485 | + <cfset path = right(path, len(path)-1) /> |
| 486 | + <cfreturn reReplace(path, "\/", ".", "all") /> |
| 487 | + </cffunction> |
| 488 | + |
473 | 489 | <cffunction name="throwError" access="private" output="false" returntype="void">
|
474 | 490 | <cfargument name="statusCode" type="numeric" default="500" />
|
475 | 491 | <cfargument name="msg" type="string" required="true" hint="message to return to api consumer" />
|
|
0 commit comments