Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Class extension to be evaluated
- $extension = 'class '.$class.' extends '.$class.'_Core { }';
- // Start class analysis
- $core = new ReflectionClass($class.'_Core');
- if ($core->isAbstract())
- {
- // Make the extension abstract
- $extension = 'abstract '.$extension;
- }
- // Transparent class extensions are handled using eval. This is
- // a disgusting hack, but it gets the job done.
- eval($extension);
- if(true)
- {
- class foo
- {
- // methods
- }
- }
- $proxyClassOnDisk = '/path/to/proxyCodeCache/' . $clazz .'.cachedProxyClass';
- if ( ! file_exists($proxyClassOnDisk) ) {
- // Generate the proxy and put it into the proxy class on disk.
- file_put_contents($proxyClassOnDisk, $this->generateProxy($object));
- }
- require_once($proxyClassOnDisk);
Add Comment
Please, Sign In to add comment