Login   Register  
PHP Classes
elePHPant
Icontem

Dynamic Methods: Add class functions dynamically from script files

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2010-12-23 (4 years ago) RSS 2.0 feedStarStarStar 46%Total: 504 All time: 5,279 This week: 1,534Up
Version License PHP version Categories  
dynamic-methods 1.0The PHP License5.3PHP 5, Language
Description Author  

This class can be used to add class functions dynamically from script files.

It traps calls to inexistent class functions. The class loads script files with the same name as the called function and uses the loaded code to implement the missing functions.

Innovation Award  
PHP Programming Innovation award nominee
January 2011
Number 5


Prize: One subscription to the PDF edition of the PHP Architect magazine
One way to extend the functionality of a class is to load external plug-in scripts when certain functions are called.

The inconvenience of this approach is that usually needs to register somehow the functions that are implemented by plug-ins before calling them.

This class implements a more automatic approach that does not require prior plug-in registration.

It implements a default class call function which intercepts calls to missing functions and automatically loads on demand external plug-in scripts with names based on the called function.

Manuel Lemos
Picture of Pashkov Denis Igorevich
Name: Pashkov Denis Igorevich <contact>
Classes: 21 packages by
Country: Ukraine Ukraine
Age: 24
All time rank: 3189 in Ukraine Ukraine
Week rank: 154 Up3 in Ukraine Ukraine Up
Innovation award
Innovation award
Nominee: 10x

Winner: 1x

  Files folder image Files  
File Role Description
Plain text file foo Aux. foo
Plain text file hello_world Aux. part hello world
Plain text file main_class.php Class main class
Plain text file readme.txt Doc. readme
Plain text file samples.php Example example

 Version Control Unique User Downloads Download Rankings  
 0%Total:504All time:5,279
 This week:0This week:1,534Up
User Ratings User Comments (3)  
 All time
Utility:56%StarStarStar
Consistency:87%StarStarStarStarStar
Documentation:43%StarStarStar
Examples:50%StarStarStar
Tests:-
Videos:-
Overall:46%StarStarStar
Rank:1869