forked from laruence/yaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
047.phpt
45 lines (37 loc) · 817 Bytes
/
047.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--TEST--
Check for Yaf_Loader with spl_autoload
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_spl_autoload=0
yaf.lowcase_path=0
--FILE--
<?php
$config = array(
"application" => array(
"directory" => realpath(dirname(__FILE__)),
"library" => array(
"directory" => "/tmp",
"namespace" => "Foo",
),
),
);
function pre_load($name) {
var_dump($name);
}
function load($name) {
eval("class " . $name . " {} ");
return TRUE;
}
spl_autoload_register("pre_load");
$app = new Yaf_Application($config);
spl_autoload_register("load");
$a = new Foo();
print_r($a);
?>
--EXPECTF--
string(3) "Foo"
Warning: Yaf_Loader::autoload(): Failed opening script %stmp%cFoo.php: No such file or directory in %s047.php on line %d
Foo Object
(
)