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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -