Skip to content

Commit c0fdce7

Browse files
committed
Add __autoload sample
1 parent 66fb681 commit c0fdce7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/dbObjectTests.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
<?
2-
error_reporting (E_STRICT);
2+
error_reporting (E_ALL|E_STRICT);
33
require_once ("../MysqliDb.php");
44
require_once ("../dbObject.php");
5-
require_once ("models/product.php");
5+
6+
function __autoload ($classname) {
7+
$filename = "models/". $classname .".php";
8+
include_once ($filename);
9+
}
610

711
$db = new Mysqlidb('localhost', 'root', '', 'testdb');
812
$tables = Array (

0 commit comments

Comments
 (0)