PHP Classes

File: test.class.plugin.php

Recommend this page to a friend!
  Classes of Daniel van Hoesel   YAPPM   test.class.plugin.php   Download  
File: test.class.plugin.php
Role: Example script
Content type: text/plain
Description: Test file
Class: YAPPM
Manage functionality loaded from external plug-ins
Author: By
Last change:
Date: 19 years ago
Size: 1,180 bytes
 

Contents

Class file image Download
<?php

// include the plugin core
include("class.plugin.php");

// initialize the plugin class
$classPlugin = new plugin("plugins", "plugin.?.php");

// show all available plugins with aditional information
print("Number of available plugins: " . $classPlugin->intAvailablePlugins . "<br>");
print(
"Available plugins for loading: <br>");
foreach(
$classPlugin->arrAvailablePlugins as $key => $val) {
    print(
"> <b>" . $key . "</b> (/" . $val[path] . "/" . $val[filename] . "): " . $val[info][name] . "<br> --- Plugin made by: " . $val[info][author] . "<br> --- " . $val[info][description] . "<br><br>");
}

// execute 'foo' plugin
print("<hr>Testing 'foo' plugin: ");
$classPlugin->execPlugin("foo");

// execute a function from the 'foo' plugin
if ($classPlugin->execFunction("foo", "foo_test", Array("blabla", "test 1..2..3.. passed"))) {
    print(
"<br>foo test passed");
}

// execute 'bar' plugin
print("<hr>Testing 'bar' plugin: ");
$classPlugin->execPlugin("bar");

// execute a function from the 'bar' plugin
if ($classPlugin->execFunction("bar", "bar_test", Array("blabla", "test 1..2..3.. passed"))) {
    print(
"<br>bar test passed");
}



?>