Cheap Web Hosting for Developers

PHP, MySQL, Java, Unix Cheap Web Hosting

Interfacing the Network 111 Interface to HTML Developers

Filed under: PHP Web Hosting — webmaster @ 14:01

112 Chapter 3 Application Design: A Real-Life Example registers itself registers itself Main system Plug-in A receives data from receives data from Plug-in B Figure 3.9 Chat system with plug-ins. Design your own plug-in-system, at least theoretically. Create a minimal application that s able to register plug-ins with itself and execute them. When starting up, phpChat includes an include file, which in turn includes all wanted plug-ins. Listing 3.3 shows how this include file works: Listing 3.3 The plug-in includer. ////////////////////////////////////////////////////////////////////////////// // // Plug-in Integrator // ////////////////////////////////////////////////////////////////////////////// include( chat_plugin_out_htmlspecialchars.php3 ); include( chat_plugin_out_link_transform.php3 ); include( chat_plugin_out_colorcodes.php3 ); include( chat_plugin_clock.php3 ); include( chat_plugin_cmd_basic.php3 ); include( chat_plugin_out_basic.php3 ); ////////////////////////////////////////////////////////////////////////////// Each of the plug-ins is built up in the same way, consisting of a main part and an event part.The main part calls two functions in phpChat,with the following names: chat_register_plugin_init() and chat_register_plugin_deinit(). Each function takes as a parameter the name of another function, which should be called for plug-in initialization and plug-in deinitialization, respectively. phpChat adds these function names to an internal table. Upon initialization of the chat, as soon as phpChat is fully set up, it makes a run through the initialization table and calls the initialization function of every plug-in that registered itself. Similarly, upon shutdown,it runs through the deinitialization table.This method allows signaling the plug-ins to activate and deactivate themselves.

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP MySQL Web Hosting services

8 Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Cheap Web Hosting