PHP Classes

PHP Callback: Register and invoke callback functions

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 1,167 All time: 3,251 This week: 660Up
Version License Categories
phpcallback 1.0GNU General Publi...Language
Description 

Author

This class can be used to register and invoke callback functions.

The class can register a callback function by associating a string that defines the function name to the name of a global function or a function of a given object.

Then the class can invoke a callback function by specifying its name and an eventual list of parameters passed as an array, similar to the PHP call_user_func_array function.

Picture of Konstantin S. Budylov
Name: Konstantin S. Budylov <contact>
Classes: 2 packages by
Country: Russian Federation Russian Federation
Age: 46
All time rank: 81530 in Russian Federation Russian Federation
Week rank: 278 Up18 in Russian Federation Russian Federation Up

Details

******************************************************************************** Package: class phpCallback -------------------------------------------------------------------------------- Package version: 1.0 -------------------------------------------------------------------------------- Copyright: (C) 2005 Konstantin S. Budylov nimous@nightworks.ru -------------------------------------------------------------------------------- Licence: General Public License. See the GPL.txt for details -------------------------------------------------------------------------------- Summary: This class is intended for management of 'callback' elements, such as Objects and it's methods, or arrays with it's values, or some functions, or whatever you want. It based on a principle of the mechanism of PHP 'call_user_func_array()' function, with preliminary addition of the 'callbacks' elements, and their subsequent call. For a calling a callback-elements JAVA-syntax (object.method) is used as I find its more readable, in comparison with PHP syntax ($object->method()) If you think differently, simply change variables '$separator' in the functions get_array_key() and set_array_key(), stored in the file functions.inc.php in this package (the values must be identical). Anyway, I find this class very convenient and useful for myself, and, if it will be useful for someone else - it will be pleasant for me. :) Please, see the example.php for details. -------------------------------------------------------------------------------- Feedback: On any questions, please, contact me by this email: nimous@nightworks.ru ********************************************************************************

  Files folder image Files (6)  
File Role Description
Plain text file class.phpCallback.php Class class phpCallback
Accessible without login Plain text file example.php Example example file
Plain text file functions.inc.php Aux. Required functions
Accessible without login Plain text file GPL.txt Lic. License
Plain text file README.txt Doc. README
Plain text file class.example_callback.php Class Example callback class

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,167
This week:0
All time:3,251
This week:660Up
User Comments (1)
Excellent
15 years ago (kishore kumar)
80%StarStarStarStarStar