PHP Classes

File: Falcraft/tests/Loader/AutoLoader.php

Recommend this page to a friend!
  Classes of Asher Wolfstein   Flexible AutoLoader   Falcraft/tests/Loader/AutoLoader.php   Download  
File: Falcraft/tests/Loader/AutoLoader.php
Role: Example script
Content type: text/plain
Description: AutoLoader Test Script
Class: Flexible AutoLoader
Autoloader that supports PSR-0 and other methods
Author: By
Last change:
Date: 8 years ago
Size: 918 bytes
 

Contents

Class file image Download
<?php

require_once('../../Loader/AutoLoader.php');
require_once(
'../../Resource/FileUtility.php');

use
Falcraft\Loader;
use
Falcraft\Resource;

echo
"Falcraft\\Data\\Loader\\AutoLoader.php Test\n";
echo
"------------------------------------------\n\n";

$autoLoader = new Loader\AutoLoader(array(), array('AutoRegister' => true));

use
Falcraft\tests\Loader\TestLoads;

$testObject = new TestLoads\TestClass();

var_dump($testObject);

echo
"\n";

$path = realpath(Resource\FileUtility::normalizePath('../../../AutoLoaderTest/'));

$autoLoader->addPath($path, 'AutoLoaderTest');

use
AutoLoaderTest\FirstNamespace;

$testObject2 = new FirstNamespace\TestClass();

var_dump($testObject2);

echo
"\n";

$autoLoader->removePath($path);

$autoLoader->addLibraryModule('AutoLoader', $path, null);

use
AutoLoaderTest\SecondNamespace;

$testObject3 = new SecondNamespace\TestClass();

var_dump($testObject3);

echo
"\n";