PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Nick Daniels  >  PHP Module Loader  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example Implementation
Class: PHP Module Loader
Load modular classes by name
Author: By
Last change: Default
Date: 7 years ago
Size: 615 bytes
 

Contents

Class file image Download
<?php
/**
 * A simple Module loader.
 * --------------------
 * Devel: Nick Daniels
 * Twttr: @ManicSec
 */
 
require_once 'Module.class.php';

###
## Start an instance of ModuleLoader
$module = ModuleLoader::startInst();

###
## Load a module by name `example`
$example = $module->loadModule("example");

###
## Check if Module loaded `example`
if(is_object($example) &&
   
$example->module_loaded())
    echo
"\r\nModule loaded!\r\n";
print_r($module->listModules());

###
## Unload Module, check if unloaded
if($module->unloadModule("example"))
    echo
"\r\nModule unloaded!\r\n";
print_r($module->listModules());

For more information send a message to info at phpclasses dot org.