![]() |
|||
SRM - Documentation |
|||
|
^ SRM Documentation ^ Bananas - Using Bananas - Writing Banana components - The eventloop of Bananas |
Writing Banana componentsWriting Banana objects is almost the same as writing a normal PHP class. There are some specific differences which are needed for proper implemntation. Below you can find an example.
There are only two special modifications in this class file for it to work as a Banana. The first is the class Uptime extends Banana line. A Banana must be an inherited class from the class Banana. This insures that several basic services, provided by the Banana class are included. This includes the special run() method which will begin the Banana eventloop. The second specific modification is found in the last two lines in the example. The first of these two lines instantiates the class ($uptime = new Uptime()), while the second line begins the eventloop. Without calling this method, a Banana will not be accesible remotely. You should name the file which contains the Banana class exactly as the name of the Banana. If your Banana class is called Uptime then the name of your Banana file should be Uptime.banana.php. You should place this file into the banana.class_path directive you configured in srm.ini. |
||
| Prev: Bananas | Next: The eventloop of Bananas | ||
|
© 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by The Vulcan Logic Group |
|||