note 51974 deleted from ref.spl by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 10:18:08 +0000 |
| Subject: | note 51974 deleted from ref.spl by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196991@lists.php.net to get a copy of this message | ||
Note Submitter: zaufi at sendmail dot ru
----
I'v done with my PluginsManager... Sample code to use plugins may looks lije this:
<?php
require_once('lib/plugins-manager.inc.php');
// Load and use conctere plugin module
$p = new Plugin('test.class.php');
$test = $p->class_factory('test', 1, 2);
$test->foo();
// ... oneliner ;)
$p = $pm['test.class.php']->class_factory('test', 1, 2)->foo();
// Scan for plugable modules, construct an instance and call foo()
$pm = new PluginsManager('.');
foreach ($pm as $p)
{
$p->class_factory('test', 1, 2)->foo();
}
?>
You may download php files at my tw.o page: http://tikiwiki.org/tiki-index.php?page=UserPagezaufi
(see page attachments below)