-1

Possible Duplicate:
Convert PHP Class in apache module

I'm looking for some guidance on the web to create an apache2 module which, when loaded, is able to expose a class in php:

if I create a php class as

// myclass.php
class myClass {
     public function myFunction ($t) {
         return $t;
     }
}

I can write

include("myclass.php");
$item = new myClass ();
echo $item-> hello ("word");

I would like to create an apache module that I make available the class all the php files in my server so I can write:

$item = new myClass ();
echo $item-> hello ("word");

Of course I could set in php.ini to autoload file, but I need to encrypt the methods and algorithms of the class in order to redistribute the class as a framework

Any advice?

Community
  • 1
  • 1

1 Answers1

0

You'd have to write a PHP extension for that, not an apache module.

For confuscating your sourcecode you could use something like the Zend Guard, which would be way easier as long as you could install additional software on your server.

Louis Huppenbauer
  • 3,719
  • 1
  • 18
  • 24
  • I do not trust the Zend Guard, there are, on the web,many software that make it a perfect reverse engineering (I've never tried), but also on youtube there are videos that explain how to do. – user1655348 Sep 07 '12 at 17:25
  • Hm. Then you'd probably have to find another obsfuscator or create PHP extension in C (which probably isn't that easy). I at least don't know of any better method to protect sourcecode. – Louis Huppenbauer Sep 07 '12 at 17:29