PHP Classes

File: test/test_ns.php

Recommend this page to a friend!
  Packages of Nikos M.   Importer   test/test_ns.php   Download  
File: test/test_ns.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Importer
Load classes, images, CSS and JavaScript
Author: By
Last change: Update of test/test_ns.php
Date: 5 years ago
Size: 780 bytes
 

 

Contents

Class file image Download
<?php
require( '../src/php/Importer.php' );

echo('Importer.VERSION = ' . Importer::VERSION . PHP_EOL);

echo('Importer.BASE = ' . Importer::$BASE . PHP_EOL);

$importer = Importer::_( dirname(__FILE__), 'http://_mygit/Importer/test/' )
    ->register('psr-4', array(
        'Foo\\' => './namespaces/Foo',
        'Bar\\' => dirname(__FILE__) .'/namespaces/Bar'
    ))
    ->register('psr-0', array(
        'ns_' => dirname(__FILE__) .'/namespaces0'
    ))
    ->register('classes', array(
        array('Test1',  'Test1', './classes/Test1.php')
    ))
    ->register_autoload( )
    ->one('import-class-Bar\\FooClass', function($imp, $id, $class, $path){
        print_r(func_get_args());
    })
;


$foo = new Bar\FooClass();
$bar = new ns_Bar_FooClass();
$test = new Test1();