-
Notifications
You must be signed in to change notification settings - Fork 2
/
ExtensionProvider.cfc
43 lines (36 loc) · 2.19 KB
/
ExtensionProvider.cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<cfcomponent>
<cffunction name="getInfo" access="remote" returntype="struct">
<cfset var info=struct()>
<cfset info.title="Local Extension Provider ("&cgi.HTTP_HOST&")">
<cfset info.mode="develop">
<cfset info.description="Andrea Campolonghi personal development extensions">
<cfset info.image="http://localhost:8888/extensions/logo.jpg">
<cfset info.url="http://" & cgi.HTTP_HOST>
<cfreturn info>
</cffunction>
<cffunction name="listApplications" access="remote" returntype="query">
<cfset var apps=queryNew('type,id,name,label,description,version,category,image,download,paypal,author,codename,video,support,documentation,forum,mailinglist,network,created')>
<cfset populateCOM(apps)>
<cfreturn apps>
</cffunction>
<cffunction name="populateCOM" access="private" returntype="void">
<cfargument name="apps" type="query" required="yes">
<cfset var exp="this extension is experimental and will no longer work with the final release of lucee 3.1, it is not allowed to use this extension in a productve enviroment.">
<cfset var rootURL=getInfo().url & "/">
<cfset var zipFileLocation = 'ext/redis-cache.zip'>
<cffile action="read" file="zip://#expandPath(zipFileLocation)#!/config.xml" variable="config">
<cfset info = XMLParse(config)>
<cfset QueryAddRow(apps)>
<cfset QuerySetCell(apps,'download',rootURL & zipFileLocation)>
<cfset QuerySetCell(apps,'id', info.config.info.id.XMLtext)>
<cfset QuerySetCell(apps,'name',info.config.info.name.XMLtext)>
<cfset QuerySetCell(apps,'type',info.config.info.type.XMLtext)>
<cfset QuerySetCell(apps,'label',info.config.info.label.XMLtext)>
<cfset QuerySetCell(apps,'description',info.config.info.description.XMLtext)>
<cfset QuerySetCell(apps,'created',info.config.info.created.XMLtext)>
<cfset QuerySetCell(apps,'version',info.config.info.version.XMLtext)>
<cfset QuerySetCell(apps,'category',info.config.info.category.XMLtext)>
<cfset QuerySetCell(apps,'author',info.config.info.author.XMLtext)>
<cfset QuerySetCell(apps,'image',info.config.info.image.XMLtext)>
</cffunction>
</cfcomponent>