Page 1 of 1

How can rewrite function require or include php ?

Posted: Mon Dec 22, 2008 1:36 am
by hitmanmx
hi all, i' new. How can rewrite function require or include php ? to add something my code.thk all

Re: How can rewrite function require or include php ?

Posted: Mon Dec 22, 2008 1:56 am
by jaoudestudios
What do you want to do?

Re: How can rewrite function require or include php ?

Posted: Mon Dec 22, 2008 7:49 pm
by hitmanmx
i want before require one file i will check it and remove something in code. I want rewrite some function of php ex : require, die, include or global.

Re: How can rewrite function require or include php ?

Posted: Tue Dec 23, 2008 2:58 am
by jaoudestudios
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?

Re: How can rewrite function require or include php ?

Posted: Tue Dec 23, 2008 5:51 am
by hitmanmx
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?
hi it's just a idea. ex :

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']);
 
how can do this ?

Re: How can rewrite function require or include php ?

Posted: Tue Dec 23, 2008 7:18 am
by Mark Baker
jaoudestudios wrote:I dont think you can, but you can write your own function.
You can, but only using the APD extension.

I'm still puzzled by what the OP is trying to achieve as well.

Re: How can rewrite function require or include php ?

Posted: Tue Dec 23, 2008 10:13 am
by hitmanmx
Mark Baker wrote:
jaoudestudios wrote:I dont think you can, but you can write your own function.
You can, but only using the APD extension.

I'm still puzzled by what the OP is trying to achieve as well.
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 ?