PHP Classes

File: examples/folder/runtest2.php

Recommend this page to a friend!
  Classes of Jorge Castro   PHP AutoLoad One   examples/folder/runtest2.php   Download  
File: examples/folder/runtest2.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP AutoLoad One
Generate scripts to autoload classes of a project
Author: By
Last change:
Date: 4 years ago
Size: 699 bytes
 

Contents

Class file image Download
<?php

define
("_AUTOLOAD_ONEDEBUG",true);
include
"..\autoinclude.php";



// basic
$c2=new \folder\NaturalClass();
// same folders
$c1=new \folder\subfolder\AnotherNaturalClass();
$c3=new \folder\subfolder\AnotherNaturalClass2();
$c4=new \folder\subfolder\MoreNaturalClass();
// same folder, again
$c4=new \folder\subfolder\MoreNaturalClass();
// same namespace, different folder
$c5=new \folder\subfolder\CustomClass();

// one file, two namespaces
$c6=new \MyProject\Connection();
$c8=new \AnotherProject\Connection();

// class without namespace
$c9=new ClassWithoutNameSpace();



echo
"Ok<br>";

echo
"the next command should raise an error:<br>";
$cE1 = new \folder\subfolder\CustomClassE();