Location: PHPKode > scripts > Class Manager > class-manager/usage.php
<?php

//require_once('testclasses/lookeduprecursive/somedir/LookedupRecursive.php');
require_once('classmanager/ClassManager.php');

// loading default configuration (classpath.xml)
ClassManager::instance()->loadDefaultXml();

// using the classes right away
new TestClass1();
new TestClass2();
new TestClass3();
new LookedupClass();
new LookedupTemplate();
new LookedupRecursive();

// loading additional classes using XML
//ClassManager::instance()->loadXml('moreclasses.xml');

// its best to use relative paths in the classpath xmls, so it will be more independent from the concrete running environment. Those relative paths are relative to the currently running script. 
// it's possible to load an XML with a different "root" path that will be put in front of all the repository paths found in the XML file: 
// ClassManager::instance()->loadDefaultXml('c:/php/myclasses');
// ClassManager::instance()->loadXml('../..');

// loading additional class through interface
// ClassManager::instance()->addPath('MyNewClass', 'myClassDir/MyNewClass.php');

// adding additional auto lookup paths
ClassManager::instance()->addLookupPath('/php/myclasses/');

// adding additional auto lookup paths with custom file name template
ClassManager::instance()->addLookupPath('/php/myclassesTemplate/', '{className}.class.php');

// testing file existence
ClassManager::instance()->checkFilesExist();

// forcing require on all specified class sources
ClassManager::instance()->requireAll();

// generate PHP code to add classpath
$phpCode = ClassManager::instance()->generatePhpClassPathDump();



echo 'Test successful'


?>
Return current item: Class Manager