Home » Configuration » Config » Bug #8169
Need add php code in phparray result
Details
| Request #8169 | Need add php code in phparray result |
|---|---|
| Submitted | 2006-07-09 03:20 UTC |
| From | macroz at gmail dot com |
| Assigned | aashley |
| Status | Wont fix |
| Package | Config |
| PHP Version | 5.1.1 |
| OS | windows |
| Roadmaps | (Not assigned) |
Comments
[2006-07-09 03:20 UTC] macroz at gmail dot com
Description:
------------
When create a config file , I need add some php code in it, something like " require_once(dirname(__FILE__).'/hbw.cn/function.inc.php'); "
Can you add a type of item, maybe "phpcode", to imporve it
Test script:
---------------
I'v add a little code in the phparray.php function toString
function toString(&$obj) {
.....
case 'phpcode':
$string .= ''.$obj->content."\n";
break;
....
}
and I can use it now:
$root->createItem('phpcode', '', 'require_once(dirname(__FILE__)."/hbw.cn/function.inc.php");');
[2006-08-11 01:52 UTC] aashley at php dot net
Ahh no. I'm not going to be adding something like that. It is way beyond the scope of this package.
If you need to do something like that I suggest loading it yourself into a string and then setting a config option the same as any other string.