How can rewrite function require or include php ?
Posted: Mon Dec 22, 2008 1:36 am
hi all, i' new. How can rewrite function require or include php ? to add something my code.thk all
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
hi it's just a idea. ex :jaoudestudios wrote:I dont think you can, but you can write your own function.
I still dont get what you want to do, can you give a full example?
Why noy just write your function and do the bits you want then put the include where you want?
Code: Select all
$config['xx'] = 'abc';
class process
{
private $config;
function __contructor()
{
global $config;
$this->config = md5($config['xx']);
}
function do($comp)
{
//i don't want someone use global or require some files other from here or in a.php, b.php,...
switch($comp)
{
case 'a' : require('a.php');break;
case 'b' : require('b.php');break;
case 'b' : require('b.php');break;
}
}
}
$t = new process;
$t->do($_GET['comp']);
You can, but only using the APD extension.jaoudestudios wrote:I dont think you can, but you can write your own function.
thk for help i looking for apd extension. i using vertrigo on win, hard to find php_apd.dll i downloaded http://vn.php.net/releases all Windows Binaries of php 5.2.6 and 5.2.8 but could not find php_apd.dll. Any way to rewrite ?Mark Baker wrote:You can, but only using the APD extension.jaoudestudios wrote:I dont think you can, but you can write your own function.
I'm still puzzled by what the OP is trying to achieve as well.