Skip to content

Instantly share code, notes, and snippets.

@liferealized
Created June 9, 2010 15:38
Show Gist options
  • Save liferealized/431663 to your computer and use it in GitHub Desktop.
Save liferealized/431663 to your computer and use it in GitHub Desktop.
<cfscript>
// we use $wheels here since these variables get placed in the variables scope of all objects and we need to make sure they don't clash with other wheels variables or any variables the develoepr may set
if (!StructIsEmpty(application.wheels.mixins))
{
$wheels.metaData = GetMetaData(this);
if (StructKeyExists($wheels.metaData, "displayName"))
$wheels.className = $wheels.metaData.displayName;
else
$wheels.className = Reverse(SpanExcluding(Reverse(GetMetaData(this).name), "."));
if (StructKeyExists(application.wheels.mixins, $wheels.className))
{
$wheels.uuid = CreateUUID();
if (application.wheels.showDebugInformation && StructKeyExists(variables, "$debugPoint"))
$debugPoint("$pluginInjection-#$wheels.className#-#$wheels.uuid#");
if (!StructKeyExists(variables, "core"))
{
variables.core = {};
StructAppend(variables.core, variables);
}
/*
$wheels.iList = StructKeyList(application.wheels.mixins[$wheels.className]);
$wheels.iEnd = ListLen($wheels.iList);
for ($wheels.i=1; $wheels.i <= $wheels.iEnd; $wheels.i++)
{
$wheels.methodName = ListGetAt($wheels.iList, $wheels.i);
if (StructKeyExists(variables, $wheels.methodName) && !StructKeyExists(variables.core, $wheels.methodName))
variables.core[$wheels.methodName] = variables[$wheels.methodName];
}
*/
StructAppend(variables, application.wheels.mixins[$wheels.className], true);
if (application.wheels.showDebugInformation && StructKeyExists(variables, "$debugPoint"))
$debugPoint("$pluginInjection-#$wheels.className#-#$wheels.uuid#");
}
// get rid of any extra data create in $wheels
StructDelete(variables, "$wheels", false);
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment