PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Configuration » Config » Bug #8169

Need add php code in phparray result

Details

Request #8169Need add php code in phparray result
Submitted2006-07-09 03:20 UTC
Frommacroz at gmail dot com
Assignedaashley
StatusWont fix
PackageConfig
PHP Version5.1.1
OSwindows
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.