How can rewrite function require or include php ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hitmanmx
Forum Newbie
Posts: 13
Joined: Mon Dec 22, 2008 1:29 am

How can rewrite function require or include php ?

Post by hitmanmx »

hi all, i' new. How can rewrite function require or include php ? to add something my code.thk all
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: How can rewrite function require or include php ?

Post by jaoudestudios »

What do you want to do?
hitmanmx
Forum Newbie
Posts: 13
Joined: Mon Dec 22, 2008 1:29 am

Re: How can rewrite function require or include php ?

Post 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.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: How can rewrite function require or include php ?

Post 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?
hitmanmx
Forum Newbie
Posts: 13
Joined: Mon Dec 22, 2008 1:29 am

Re: How can rewrite function require or include php ?

Post 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 ?
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: How can rewrite function require or include php ?

Post 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.
hitmanmx
Forum Newbie
Posts: 13
Joined: Mon Dec 22, 2008 1:29 am

Re: How can rewrite function require or include php ?

Post 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 ?
Post Reply