php - How to read a constant's value defined in .inc file in cakephp -
i newbie cakephp , given task implement memcache current features of app part of optimization. implemented , working fine want update memcache key,value pair through cron. made 1 function :
function mcache($client_id,$keyword_id,$function) { $this->$function($client_id,$keyword_id); }
i want call function thru cron scheduler , in $function parameter want give pass string have defined in define.inc file. structure dis:
define ("heat_map","getheatmapdata"); define ("age_demographics","getagedemographicsdata"); define ("gender_demographics","getgenderdemographicsdata");
here want pass "heat_map" function mcache parameter in $function , want read corresponding value can call function getheatmapdata.
when doing giving me "heat_map" not getheatmapdata. know bit confusing if u want info plz lemme know. ideas???
to read value of constant use constant()
function
define("foo", "bar"); $z = "foo"; echo constant($z); // "bar"
Comments
Post a Comment