1 |
joko |
1.1 |
<? |
2 |
|
|
// --------------------------------------------------------------------------- |
3 |
|
|
// $Id: Site.php,v 1.5 2002/12/23 11:33:58 jonen Exp $ |
4 |
|
|
// --------------------------------------------------------------------------- |
5 |
|
|
// $Log: Site.php,v $ |
6 |
|
|
// --------------------------------------------------------------------------- |
7 |
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
/* |
11 |
|
|
class DesignPattern_Object { |
12 |
|
|
function DesignPattern_Object() { |
13 |
|
|
|
14 |
|
|
} |
15 |
|
|
} |
16 |
|
|
*/ |
17 |
|
|
|
18 |
|
|
function _ns2file($nsName) { |
19 |
|
|
if ($filename = str_replace('::', '/', $nsName)) { |
20 |
|
|
$filename .= '.php'; |
21 |
|
|
return $filename; |
22 |
|
|
} |
23 |
|
|
} |
24 |
|
|
|
25 |
|
|
function mkObject($namespacedClassname) { |
26 |
|
|
$classname = $namespacedClassname; |
27 |
|
|
if (loadModule($namespacedClassname)) { |
28 |
|
|
$classname = str_replace('::', '_', $namespacedClassname); |
29 |
|
|
} |
30 |
|
|
$obj = new DesignPattern_Bridge($classname); |
31 |
|
|
return $obj; |
32 |
|
|
} |
33 |
|
|
|
34 |
|
|
function loadModule($namespacedClassname) { |
35 |
|
|
if ($filename = _ns2file($namespacedClassname)) { |
36 |
|
|
require_once($filename); |
37 |
|
|
return 1; |
38 |
|
|
} |
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
?> |